fix fetchCol to return true/false and pass value int pass-by-ref param
[m6w6/ext-pq] / src / php_pq_misc.h
1 /*
2 +--------------------------------------------------------------------+
3 | PECL :: pq |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2013, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13
14 #ifndef PHP_PQ_ERROR_H
15 #define PHP_PQ_ERROR_H
16
17 #include <libpq-fe.h>
18
19 typedef int STATUS; /* SUCCESS/FAILURE */
20
21 /* trim LF from EOL */
22 char *rtrim(char *e);
23
24 /* R, W, RW */
25 const char *strmode(long mode);
26
27 /* compare array index */
28 int compare_index(const void *lptr, const void *rptr TSRMLS_DC);
29
30 #define PHP_PQerrorMessage(c) rtrim(PQerrorMessage((c)))
31 #define PHP_PQresultErrorMessage(r) rtrim(PQresultErrorMessage((r)))
32
33 int php_pq_types_to_array(HashTable *ht, Oid **types TSRMLS_DC);
34 int php_pq_params_to_array(HashTable *ht, char ***params, HashTable *zdtor TSRMLS_DC);
35
36 #endif
37
38 /*
39 * Local variables:
40 * tab-width: 4
41 * c-basic-offset: 4
42 * End:
43 * vim600: noet sw=4 ts=4 fdm=marker
44 * vim<600: noet sw=4 ts=4
45 */