| 138 | #endif |
| 139 | |
| 140 | struct sqlca_t * |
| 141 | ECPGget_sqlca(void) |
| 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; |
| 154 | ecpg_init_sqlca(sqlca); |
| 155 | pthread_setspecific(sqlca_key, sqlca); |
| 156 | } |
| 157 | return sqlca; |
| 158 | #else |
| 159 | return &sqlca; |
| 160 | #endif |
| 161 | } |
| 162 | |
| 163 | bool |
| 164 | ECPGstatus(int lineno, const char *connection_name) |
no test coverage detected