klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

kkeyword.h (829B)


      1 /*
      2 ** kkeywrod.h
      3 ** Kernel Keywords
      4 ** See Copyright Notice in klisp.h
      5 */
      6 
      7 #ifndef kkeyword_h
      8 #define kkeyword_h
      9 
     10 #include "kobject.h"
     11 #include "kstate.h"
     12 #include "kstring.h"
     13 #include "kmem.h"
     14 
     15 /* All keywords are interned */
     16 /* No case folding is performed by these constructors */
     17 
     18 /* buffer + size, may contain nulls */
     19 TValue kkeyword_new_bs(klisp_State *K, const char *buf, uint32_t size);
     20 /* null terminated buffer */
     21 TValue kkeyword_new_b(klisp_State *K, const char *buf);
     22 /* copies str if not immutable */
     23 TValue kkeyword_new_str(klisp_State *K, TValue str);
     24 
     25 #define kkeyword_str(tv_) (tv2keyw(tv_)->str)
     26 #define kkeyword_buf(tv_) (kstring_buf(tv2keyw(tv_)->str))
     27 #define kkeyword_size(tv_) (kstring_size(tv2keyw(tv_)->str))
     28 
     29 bool kkeywordp(TValue obj);
     30 
     31 int32_t kkeyword_cstr_cmp(TValue str, const char *buf);
     32 
     33 #endif