PostgreSQL Source Code  git master
sqlca.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sqlca_t
 

Macros

#define PGDLLIMPORT
 
#define SQLERRMC_LEN   150
 
#define sqlca   (*ECPGget_sqlca())
 

Functions

struct sqlca_tECPGget_sqlca (void)
 

Macro Definition Documentation

◆ PGDLLIMPORT

#define PGDLLIMPORT

Definition at line 8 of file sqlca.h.

◆ sqlca

#define sqlca   (*ECPGget_sqlca())

Definition at line 59 of file sqlca.h.

◆ SQLERRMC_LEN

#define SQLERRMC_LEN   150

Definition at line 12 of file sqlca.h.

Function Documentation

◆ ECPGget_sqlca()

struct sqlca_t* ECPGget_sqlca ( void  )

Definition at line 141 of file misc.c.

142 {
143 #ifdef ENABLE_THREAD_SAFETY
144  struct sqlca_t *sqlca;
145 
146  pthread_once(&sqlca_key_once, ecpg_sqlca_key_init);
147 
148  sqlca = pthread_getspecific(sqlca_key);
149  if (sqlca == NULL)
150  {
151  sqlca = malloc(sizeof(struct sqlca_t));
152  if (sqlca == NULL)
153  return NULL;
155  pthread_setspecific(sqlca_key, sqlca);
156  }
157  return sqlca;
158 #else
159  return &sqlca;
160 #endif
161 }
#define malloc(a)
Definition: header.h:50
static struct sqlca_t sqlca
Definition: misc.c:62
void ecpg_init_sqlca(struct sqlca_t *sqlca)
Definition: misc.c:98
void * pthread_getspecific(pthread_key_t key)
Definition: pthread-win32.c:29
void pthread_setspecific(pthread_key_t key, void *val)
Definition: pthread-win32.c:24
Definition: sqlca.h:20