gvm-libs  11.0.1
About: GVM Libraries for the Greenbone Vulnerability Management (GVM-10) framework (derived from the former openvas-libraries).
  Fossies Dox: gvm-libs-11.0.1.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

array.c File Reference

Array utilities. More...

#include "array.h"
Include dependency graph for array.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

GPtrArray * make_array ()
 Make a global array. More...
 
void array_reset (array_t **array)
 Reset an array. More...
 
void array_free (GPtrArray *array)
 Free global array value. More...
 
void array_add (array_t *array, gpointer pointer)
 Push a generic pointer onto an array. More...
 
void array_terminate (array_t *array)
 Terminate an array. More...
 

Detailed Description

Array utilities.

Definition in file array.c.

Function Documentation

◆ array_add()

void array_add ( array_t array,
gpointer  pointer 
)

Push a generic pointer onto an array.

Parameters
[in]arrayArray.
[in]pointerPointer.

Definition at line 76 of file array.c.

77 {
78  if (array)
79  g_ptr_array_add (array, pointer);
80 }

Referenced by port_range_ranges().

Here is the caller graph for this function:

◆ array_free()

void array_free ( GPtrArray *  array)

Free global array value.

Also g_free any elements.

Parameters
[in]arrayPointer to array.

Definition at line 58 of file array.c.

59 {
60  if (array)
61  {
62  guint index = array->len;
63  while (index--)
64  g_free (g_ptr_array_index (array, index));
65  g_ptr_array_free (array, TRUE);
66  }
67 }

Referenced by array_reset().

Here is the caller graph for this function:

◆ array_reset()

void array_reset ( array_t **  array)

Reset an array.

Parameters
[in]arrayPointer to array.

Definition at line 44 of file array.c.

45 {
46  array_free (*array);
47  *array = make_array ();
48 }

References array_free(), and make_array().

Here is the call graph for this function:

◆ array_terminate()

void array_terminate ( array_t array)

Terminate an array.

Parameters
[in]arrayArray.

Definition at line 88 of file array.c.

89 {
90  if (array)
91  g_ptr_array_add (array, NULL);
92 }

◆ make_array()

GPtrArray* make_array ( )

Make a global array.

Returns
New array.

Definition at line 33 of file array.c.

34 {
35  return g_ptr_array_new ();
36 }

Referenced by array_reset(), Ensure(), and port_range_ranges().

Here is the caller graph for this function:
array_free
void array_free(GPtrArray *array)
Free global array value.
Definition: array.c:58
make_array
GPtrArray * make_array()
Make a global array.
Definition: array.c:33