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 #ifndef JX_ANY
00092 #define JX_ANY -1
00093 #endif
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106 #ifndef __GNUC_PREREQ__
00107 #ifdef __GNUC__
00108 #define __GNUC_PREREQ__(x, y) \
00109 ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || \
00110 (__GNUC__ > (x)))
00111 #else
00112 #define __GNUC_PREREQ__(x, y) 0
00113 #endif
00114 #endif
00115
00116 #ifndef __wur
00117 #if __GNUC_PREREQ__(3, 4)
00118 #define __wur __attribute__((warn_unused_result))
00119 #else
00120 #define __wur
00121 #endif
00122 #endif
00123
00124 #ifndef __sentinel
00125 #if __GNUC_PREREQ__(4, 0)
00126 #define __sentinel __attribute__((sentinel))
00127 #else
00128 #define __sentinel
00129 #endif
00130 #endif
00131
00138 int jx_match_boolean(struct jx *j, int *v) __wur;
00139
00146 int jx_match_integer(struct jx *j, jx_int_t *v) __wur;
00147
00154 int jx_match_double(struct jx *j, double *v) __wur;
00155
00174 int jx_match_string(struct jx *j, char **v) __wur;
00175
00186 int jx_match_symbol(struct jx *j, char **v) __wur;
00187
00203 int jx_match_array(struct jx *j, ...) __wur __sentinel;
00204
00205 #endif