GNUnet 0.22.2
pq.h File Reference

shared internal data structures of libgnunetpq More...

#include "gnunet_util_lib.h"
#include "gnunet_pq_lib.h"
Include dependency graph for pq.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GNUNET_PQ_Context
 Handle to Postgres database. More...
 
struct  pq_array_header
 the header for a postgresql array in binary format. More...
 

Enumerations

enum  array_types {
  array_of_bool , array_of_uint16 , array_of_uint32 , array_of_uint64 ,
  array_of_byte , array_of_string , array_of_abs_time , array_of_rel_time ,
  array_of_timestamp , array_of_MAX
}
 Internal types that are supported as array types. More...
 

Functions

struct pq_array_header __attribute__ ((packed))
 
void GNUNET_PQ_event_reconnect_ (struct GNUNET_PQ_Context *db, int fd)
 Internal API. More...
 

Variables

uint32_t ndim
 
uint32_t has_null
 
uint32_t oid
 
uint32_t dim
 
uint32_t lbound
 

Detailed Description

shared internal data structures of libgnunetpq

Author
Christian Grothoff

Definition in file pq.h.

Enumeration Type Documentation

◆ array_types

Internal types that are supported as array types.

Enumerator
array_of_bool 
array_of_uint16 
array_of_uint32 
array_of_uint64 
array_of_byte 
array_of_string 
array_of_abs_time 
array_of_rel_time 
array_of_timestamp 
array_of_MAX 

Definition at line 141 of file pq.h.

142{
147 array_of_byte, /* buffers of (char *), (void *), ... */
148 array_of_string, /* NULL-terminated (char *) */
152 array_of_MAX, /* must be last */
153};
@ array_of_byte
Definition: pq.h:147
@ array_of_uint32
Definition: pq.h:145
@ array_of_MAX
Definition: pq.h:152
@ array_of_string
Definition: pq.h:148
@ array_of_rel_time
Definition: pq.h:150
@ array_of_uint16
Definition: pq.h:144
@ array_of_uint64
Definition: pq.h:146
@ array_of_abs_time
Definition: pq.h:149
@ array_of_timestamp
Definition: pq.h:151
@ array_of_bool
Definition: pq.h:143

Function Documentation

◆ __attribute__()

struct pq_array_header __attribute__ ( (packed)  )

◆ GNUNET_PQ_event_reconnect_()

void GNUNET_PQ_event_reconnect_ ( struct GNUNET_PQ_Context db,
int  fd 
)

Internal API.

Reconnect should re-register notifications after a disconnect.

Parameters
dbthe DB handle
fdsocket to listen on

Definition at line 412 of file pq_event.c.

414{
416 "Change in PQ event FD to %d\n",
417 fd);
419 fd);
422 db);
423}
static struct GNUNET_FS_DirectoryBuilder * db
int GNUNET_CONTAINER_multishortmap_iterate(struct GNUNET_CONTAINER_MultiShortmap *map, GNUNET_CONTAINER_ShortmapIterator it, void *it_cls)
Iterate over all entries in the map.
#define GNUNET_log(kind,...)
@ GNUNET_ERROR_TYPE_INFO
static enum GNUNET_GenericReturnValue register_notify(void *cls, const struct GNUNET_ShortHashCode *sh, void *value)
Re-subscribe to notifications after disconnect.
Definition: pq_event.c:397
static void scheduler_fd_cb(void *cls, int fd)
Function called when the Postgres FD changes and we need to update the scheduler event loop task.
Definition: pq_event.c:313

References db, GNUNET_CONTAINER_multishortmap_iterate(), GNUNET_ERROR_TYPE_INFO, GNUNET_log, register_notify(), and scheduler_fd_cb().

Referenced by GNUNET_PQ_reconnect().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ ndim

uint32_t ndim

Definition at line 0 of file pq.h.

◆ has_null

uint32_t has_null

Definition at line 1 of file pq.h.

◆ oid

uint32_t oid

Definition at line 2 of file pq.h.

◆ dim

uint32_t dim

Definition at line 3 of file pq.h.

◆ lbound

uint32_t lbound

Definition at line 4 of file pq.h.