test Statement::bind()
[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 zend_class_entry *php_pqdt_class_entry;
34 zval *php_pqdt_from_string(char *datetime_str, size_t datetime_len, char *fmt, zval *zv TSRMLS_DC);
35
36 zend_class_entry *php_pqconv_class_entry;
37
38 HashTable *php_pq_parse_array(const char *val_str, size_t val_len, Oid typ TSRMLS_DC);
39 zval *php_pq_typed_zval(char *val_str, size_t val_len, Oid typ TSRMLS_DC);
40
41 PHP_MINIT_FUNCTION(pq_misc);
42
43 #endif
44
45 /*
46 * Local variables:
47 * tab-width: 4
48 * c-basic-offset: 4
49 * End:
50 * vim600: noet sw=4 ts=4 fdm=marker
51 * vim<600: noet sw=4 ts=4
52 */