This one is complicated because a gboolean is an int, but a bool is not, in the way that a pointer to a bool (including in the return of a function pointer) cannot be substituted for a pointer to a gboolean. (They can convert a bool used internally to a gboolean on return.) Continue for that reason to have some functions return gboolean when used with glib callback functions: https://docs.gtk.org/glib/callback.HRFunc.html Another small gotcha is that macros like UINT64_C are not necessarily guaranteed to wrap the return in parentheses, which G_GUINT64_CONSTANT and the like do. In wtap.h, the file subtype "dump_open" function was typedef'd as returning an int, but almost all users (except in wslua) returned a gboolean. Switch it to a bool. Make a note about why can_write_encap does not return a bool, because it returns error codes on failure (for Lua) instead of having the err as a separate parameter. Update the usbdump wiretap plugin too. A few places outside of wiretap use wiretap function pointers, such as in the Lua interface, adding IP addresses to NRBs, merging, and the frame dissector using wiretap functions. Switch those to bool. Ping #19116
18 lines
309 B
C
18 lines
309 B
C
/** @file
|
|
*
|
|
* Wiretap Library
|
|
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#ifndef __NETMON_H__
|
|
#define __NETMON_H__
|
|
|
|
#include <glib.h>
|
|
#include "wtap.h"
|
|
|
|
wtap_open_return_val netmon_open(wtap *wth, int *err, char **err_info);
|
|
|
|
#endif
|