jx_match.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00088 #ifndef JX_MATCH_H
00089 #define JX_MATCH_H
00090
00091 #include <jx.h>
00092
00093 #ifndef JX_ANY
00094 #define JX_ANY -1
00095 #endif
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108 #ifndef __GNUC_PREREQ__
00109 #ifdef __GNUC__
00110 #define __GNUC_PREREQ__(x, y) \
00111 ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || \
00112 (__GNUC__ > (x)))
00113 #else
00114 #define __GNUC_PREREQ__(x, y) 0
00115 #endif
00116 #endif
00117
00118 #ifndef __wur
00119 #if __GNUC_PREREQ__(3, 4)
00120 #define __wur __attribute__((warn_unused_result))
00121 #else
00122 #define __wur
00123 #endif
00124 #endif
00125
00126 #ifndef __sentinel
00127 #if __GNUC_PREREQ__(4, 0)
00128 #define __sentinel __attribute__((sentinel))
00129 #else
00130 #define __sentinel
00131 #endif
00132 #endif
00133
00140 int jx_match_boolean(struct jx *j, int *v) __wur;
00141
00148 int jx_match_integer(struct jx *j, jx_int_t *v) __wur;
00149
00156 int jx_match_double(struct jx *j, double *v) __wur;
00157
00176 int jx_match_string(struct jx *j, char **v) __wur;
00177
00188 int jx_match_symbol(struct jx *j, char **v) __wur;
00189
00205 int jx_match_array(struct jx *j, ...) __wur __sentinel;
00206
00207 #endif