Index: src/interfaces/ecpg/ecpglib/misc.c =================================================================== RCS file: /cvsroot/pgsql-server/src/interfaces/ecpg/ecpglib/misc.c,v retrieving revision 1.3 diff -c -c -r1.3 misc.c *** src/interfaces/ecpg/ecpglib/misc.c 15 Jun 2003 04:07:58 -0000 1.3 --- src/interfaces/ecpg/ecpglib/misc.c 15 Jun 2003 04:46:37 -0000 *************** *** 78,84 **** static int simple_debug = 0; static FILE *debugstream = NULL; ! void ECPGinit_sqlca(struct sqlca_t *sqlca) { memcpy((char *)sqlca, (char *)&sqlca_init, sizeof(struct sqlca_t)); } --- 78,85 ---- static int simple_debug = 0; static FILE *debugstream = NULL; ! void ! ECPGinit_sqlca(struct sqlca_t *sqlca) { memcpy((char *)sqlca, (char *)&sqlca_init, sizeof(struct sqlca_t)); } *************** *** 98,122 **** } #ifdef USE_THREADS ! static void ecpg_sqlca_key_init(void) { pthread_key_create(&sqlca_key, NULL); } #endif ! struct sqlca_t *ECPGget_sqlca(void) { #ifdef USE_THREADS struct sqlca_t *sqlca; pthread_once(&sqlca_key_once, ecpg_sqlca_key_init); ! sqlca = pthread_getspecific(&sqlca_key); if( sqlca == NULL ) { sqlca = malloc(sizeof(struct sqlca_t)); ECPGinit_sqlca(sqlca); ! pthread_setspecific(&sqlca_key, sqlca); } return( sqlca ); #else --- 99,125 ---- } #ifdef USE_THREADS ! static void ! ecpg_sqlca_key_init(void) { pthread_key_create(&sqlca_key, NULL); } #endif ! struct sqlca_t * ! ECPGget_sqlca(void) { #ifdef USE_THREADS struct sqlca_t *sqlca; pthread_once(&sqlca_key_once, ecpg_sqlca_key_init); ! sqlca = pthread_getspecific(sqlca_key); if( sqlca == NULL ) { sqlca = malloc(sizeof(struct sqlca_t)); ECPGinit_sqlca(sqlca); ! pthread_setspecific(sqlca_key, sqlca); } return( sqlca ); #else Index: src/interfaces/ecpg/include/ecpglib.h =================================================================== RCS file: /cvsroot/pgsql-server/src/interfaces/ecpg/include/ecpglib.h,v retrieving revision 1.49 diff -c -c -r1.49 ecpglib.h *** src/interfaces/ecpg/include/ecpglib.h 13 Jun 2003 10:50:57 -0000 1.49 --- src/interfaces/ecpg/include/ecpglib.h 15 Jun 2003 04:46:37 -0000 *************** *** 38,43 **** --- 38,46 ---- { #endif + struct sqlca_t; + + void ECPGinit_sqlca(struct sqlca_t *sqlca); void ECPGdebug(int, FILE *); bool ECPGstatus(int, const char *); bool ECPGsetcommit(int, const char *, const char *); *************** *** 49,58 **** bool ECPGprepare(int, char *, char *); bool ECPGdeallocate(int, char *); bool ECPGdeallocate_all(int); ! char *ECPGprepared_statement(char *); void ECPGlog(const char *format,...); ! char *ECPGerrmsg(void); /* print an error message */ void sqlprint(void); --- 52,61 ---- bool ECPGprepare(int, char *, char *); bool ECPGdeallocate(int, char *); bool ECPGdeallocate_all(int); ! char *ECPGprepared_statement(char *); void ECPGlog(const char *format,...); ! char *ECPGerrmsg(void); /* print an error message */ void sqlprint(void);