"Fossies" - the Fresh Open Source Software Archive

Member "dateutils-0.4.6/src/dexpr.h" (19 Mar 2019, 829 Bytes) of package /linux/privat/dateutils-0.4.6.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "dexpr.h" see the Fossies "Dox" file reference documentation.

    1 /*** dexpr.h -- helper for date expressions */
    2 #if !defined INCLUDED_dexpr_h_
    3 #define INCLUDED_dexpr_h_
    4 
    5 #include "dt-core.h"
    6 #include "token.h"
    7 
    8 typedef struct dexpr_s *dexpr_t;
    9 typedef const struct dexpr_s *const_dexpr_t;
   10 
   11 typedef struct dexkv_s *dexkv_t;
   12 typedef const struct dexkv_s *const_dexkv_t;
   13 
   14 typedef enum {
   15     DEX_UNK,
   16     DEX_VAL,
   17     DEX_CONJ,
   18     /* must be last as other types will be considered inferior */
   19     DEX_DISJ,
   20 } dex_type_t;
   21 
   22 struct dexkv_s {
   23     struct dt_spec_s sp;
   24     oper_t op:3;
   25     union {
   26         struct dt_dt_s d;
   27         signed int s;
   28     };
   29 };
   30 
   31 struct dexpr_s {
   32     dex_type_t type:31;
   33     unsigned int nega:1;
   34     dexpr_t left;
   35     union {
   36         struct dexkv_s kv[1];
   37         struct {
   38             dexpr_t right;
   39             dexpr_t up;
   40         };
   41     };
   42 };
   43 
   44 
   45 /* parser routine */
   46 extern int dexpr_parse(dexpr_t *root, const char *s, size_t l);
   47 
   48 #endif  /* INCLUDED_dexpr_h_ */