src/sexp.h

/* [<][>]
[^][v][top][bottom][index][help] */

FUNCTIONS

This source file includes following functions.

   1 /* sexp.h - a header for vfsexp.c
   2  *
   3  *  Programmmed by Hirotsugu Kakugawa
   4  *  E-Mail:  h.kakugawa@computer.org
   5  *
   6  *  Edition History
   7  *  7 Jan 1998  First implementation
   8  */
   9 
  10 /*
  11  * Copyright (C) 1997-1998 Hirotsugu Kakugawa. 
  12  * All rights reserved.
  13  *
  14  * This file is part of the VFlib Library.  This library is free
  15  * software; you can redistribute it and/or modify it under the terms of
  16  * the GNU Library General Public License as published by the Free
  17  * Software Foundation; either version 2 of the License, or (at your
  18  * option) any later version.  This library is distributed in the hope
  19  * that it will be useful, but WITHOUT ANY WARRANTY; without even the
  20  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  21  * PURPOSE.  See the GNU Library General Public License for more details.
  22  * You should have received a copy of the GNU Library General Public
  23  * License along with this library; if not, write to the Free Software
  24  * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  25  */
  26 
  27 #ifndef __VFLIB_SEXP_H__
  28 #define __VFLIB_SEXP_H__
  29 
  30 typedef struct  s_sexp   *SEXP;
  31 
  32 struct s_sexp_cons {
  33   SEXP   car;
  34   SEXP   cdr;
  35 };
  36 
  37 struct s_sexp {
  38   int    tag;                  /* data type */
  39   union {
  40     struct s_sexp_cons  cons;  /* cons */
  41     char                *str;  /* string or symbol */
  42   } t;
  43 };
  44 
  45 
  46 /* Data type.
  47  * String and Symbol are the same type except 
  48  * they are printed different ways by pretty-printer. */
  49 #define VF_SEXP_TAG_NIL        0
  50 #define VF_SEXP_TAG_CONS       1
  51 #define VF_SEXP_TAG_STRING     2
  52 #define VF_SEXP_TAG_SYMBOL     3
  53 #define VF_SEXP_TAG_RELEASED 255
  54 
  55 #define SEXP_LIST     SEXP
  56 #define SEXP_ALIST    SEXP
  57 #define SEXP_STRING   SEXP
  58 
  59 
  60 extern SEXP   vf_sexp_cons(SEXP s1, SEXP s2);
  61 extern SEXP   vf_sexp_car(SEXP s);
  62 extern SEXP   vf_sexp_cdr(SEXP s);
  63 extern SEXP   vf_sexp_caar(SEXP s);
  64 extern SEXP   vf_sexp_cadr(SEXP s);
  65 extern SEXP   vf_sexp_cdar(SEXP s);
  66 extern SEXP   vf_sexp_cddr(SEXP s);
  67 extern SEXP   vf_sexp_caddr(SEXP s);
  68 extern void   vf_sexp_rplaca(SEXP s, SEXP val);
  69 extern void   vf_sexp_rplacd(SEXP s, SEXP val);
  70 extern int    vf_sexp_atom(SEXP s);
  71 extern int    vf_sexp_null(SEXP s);
  72 extern int    vf_sexp_consp(SEXP s);
  73 extern int    vf_sexp_stringp(SEXP s);
  74 extern char*  vf_sexp_get_cstring(SEXP s);
  75 extern int    vf_sexp_listp(SEXP s);
  76 extern int    vf_sexp_alistp(SEXP s);
  77 extern int    vf_sexp_length(SEXP s);
  78 extern int    vf_sexp_member(char *key, SEXP s);
  79 extern SEXP   vf_sexp_assoc(char *key, SEXP s);
  80 extern SEXP   vf_sexp_alist_put(char *key, char *val, SEXP_ALIST alist);
  81 extern SEXP   vf_sexp_copy(SEXP s);
  82 extern SEXP   vf_sexp_list1(SEXP s);
  83 extern SEXP   vf_sexp_list2(SEXP s1, SEXP s2);
  84 extern void   vf_sexp_nconc(SEXP s1, SEXP s2);
  85 extern SEXP   vf_sexp_empty_list(void);
  86 
  87 extern SEXP   vf_sexp_cstring2string(char *str);
  88 extern SEXP   vf_sexp_cstring2list(char *str);
  89 extern SEXP   vf_sexp_cstring2alist(char *str);
  90 
  91 extern SEXP   vf_sexp_read(FILE *fp);
  92 extern SEXP   vf_sexp_read_from_file_stream(FILE *fp);
  93 extern SEXP   vf_sexp_read_from_string_stream(char *str);
  94 
  95 extern void   vf_sexp_pp(SEXP s);
  96 extern void   vf_sexp_pp_fp(SEXP s, FILE* fp);
  97 extern void   vf_sexp_pp_entry(SEXP s);
  98 extern void   vf_sexp_pp_entry_fp(SEXP s, FILE* fp);
  99 
 100 extern void   vf_sexp_free(SEXP *s);
 101 extern void   vf_sexp_free1(SEXP *s1);
 102 extern void   vf_sexp_free2(SEXP *s1, SEXP *s2);
 103 extern void   vf_sexp_free3(SEXP *s1, SEXP *s2, SEXP *s3);
 104 extern void   vf_sexp_free4(SEXP *s1, SEXP *s2, SEXP *s3, SEXP *s4);
 105 
 106 #endif /*__VFLIB_SEXP_H__*/

/* [<][>][^][v][top][bottom][index][help] */