avoid adding a ref to the object of the iterator actually living inside
[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 /* TSRM morony */
22 #if PHP_VERSION_ID >= 50700
23 # define z_is_true(z) zend_is_true(z TSRMLS_CC)
24 #else
25 # define z_is_true zend_is_true
26 #endif
27
28 /* trim LF from EOL */
29 char *rtrim(char *e);
30
31 /* R, W, RW */
32 const char *strmode(long mode);
33
34 /* compare array index */
35 int compare_index(const void *lptr, const void *rptr TSRMLS_DC);
36
37 #define PHP_PQerrorMessage(c) rtrim(PQerrorMessage((c)))
38 #define PHP_PQresultErrorMessage(r) rtrim(PQresultErrorMessage((r)))
39
40 zend_class_entry *php_pqdt_class_entry;
41 zval *php_pqdt_from_string(char *datetime_str, size_t datetime_len, char *fmt, zval *zv TSRMLS_DC);
42
43 zend_class_entry *php_pqconv_class_entry;
44
45 HashTable *php_pq_parse_array(const char *val_str, size_t val_len, Oid typ TSRMLS_DC);
46 zval *php_pq_typed_zval(char *val_str, size_t val_len, Oid typ TSRMLS_DC);
47
48 PHP_MINIT_FUNCTION(pq_misc);
49
50 #endif
51
52 /*
53 * Local variables:
54 * tab-width: 4
55 * c-basic-offset: 4
56 * End:
57 * vim600: noet sw=4 ts=4 fdm=marker
58 * vim<600: noet sw=4 ts=4
59 */