Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Macros
array.h File Reference
#include <stdlib.h>
#include <glib.h>

Go to the source code of this file.

Macros

#define array_length(x)   (sizeof (x) / sizeof (x)[0])
 
#define g_ptr_array_len(a)   ((a) ? (a)->len : 0)
 

Detailed Description

Utility functions/macros for handling arrays, C and/or glib.

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Macro Definition Documentation

◆ array_length

#define array_length (   x)    (sizeof (x) / sizeof (x)[0])

Useful when you have an array whose size is known at compile-time.

◆ g_ptr_array_len

#define g_ptr_array_len (   a)    ((a) ? (a)->len : 0)

glib doesn't have g_ptr_array_len, of all things!