"Fossies" - the Fresh Open Source Software Archive

Member "delegate9.9.13/include/SLL.h" (16 Aug 2009, 1911 Bytes) of package /linux/misc/old/delegate9.9.13.tar.gz:


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 "SLL.h" see the Fossies "Dox" file reference documentation.

    1 /*////////////////////////////////////////////////////////////////////////
    2 Copyright (c) 1994 Electrotechnical Laboratry (ETL)
    3 
    4 Permission to use, copy, modify, and distribute this material for any
    5 purpose and without fee is hereby granted, provided that the above
    6 copyright notice and this permission notice appear in all copies, and
    7 that the name of ETL not be used in advertising or publicity pertaining
    8 to this material without the specific, prior written permission of an
    9 authorized representative of ETL.
   10 ETL MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY OF THIS
   11 MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS", WITHOUT ANY EXPRESS
   12 OR IMPLIED WARRANTIES.
   13 /////////////////////////////////////////////////////////////////////////
   14 Content-Type:   program/C; charset=US-ASCII
   15 Program:        SLL.h (Simple LL parser)
   16 Author:         Yutaka Sato <ysato@etl.go.jp>
   17 Description:
   18 History:
   19         940320  created
   20 //////////////////////////////////////////////////////////////////////#*/
   21 
   22 typedef struct _state {
   23   const char        *r_name;
   24   const char        *r_gate;
   25     struct _state   *r_dest;
   26     int      r_flag;
   27 /*
   28     int      r_glen;
   29   const char        *r_from;
   30   const char        *r_to;
   31 */
   32 } SLLRule;
   33 
   34 #define ISRULE(s)   extern SLLRule s[]
   35 #ifdef _AIX
   36 #define RULE(s)     SLLRule s[] =
   37 #else
   38 #define RULE(s)     SLLRule s[] =
   39 #endif
   40 #define ALT(s)      RULE(s){ {"s",0,0,ISALT},
   41 #define SEQ(s)      RULE(s){ {"s",0,0,ISSEQ},
   42 #define END     0};
   43 
   44 static char IMM[] = "";
   45 
   46 #define SUCCESS     ((SLLRule*)1)
   47 #define NEXT        ((SLLRule*)2)
   48 #define FAILURE     ((SLLRule*)3)
   49 
   50 #define ISSEQ        1
   51 #define ISALT        2
   52 #define xOPTIONAL    4
   53 #define CHARSET      8
   54 #define PUTVAL      16
   55 #define PUTGATE     32
   56 #define IGNCASE     64
   57 
   58 typedef void (*putvFunc)(PCStr(name),PCStr(src),int len,PVStr(out));
   59 void SLL_putval(PCStr(name),PCStr(val),int len,PVStr(out));
   60 int SLLparse(int lev,SLLRule *prp,PCStr(srca),const char **nsrcp,putvFunc putv,PVStr(vala),int size,char **nvalp);