X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=userv.git;a=blobdiff_plain;f=tokens.h.m4;h=00b580b1b8d6f15468ecd60d2a6f4e6ddf121cc7;hp=21a3dbe0678ea90a23ddcf77b4ef303157c3937d;hb=f01eaa6588a9dc2673bd35d1c1be043976b9c09a;hpb=703b99b834625829d6b285e5bca619475ef54511 diff --git a/tokens.h.m4 b/tokens.h.m4 index 21a3dbe..00b580b 100644 --- a/tokens.h.m4 +++ b/tokens.h.m4 @@ -1,7 +1,7 @@ dnl userv - tokens.h.m4 dnl token values, passed through m4 with defs from langauge.i4 /* - * Copyright (C)1996-1997 Ian Jackson + * Copyright (C)1996-1997,1999 Ian Jackson * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -24,67 +24,18 @@ include(language.i4) #define TOKENS_H enum tokens { - tokm_instance= 000000000777, - tokm_repres= 000000007000, - tokm_type= 017777770000, - tokr_nonstring= 000000001000, - tokr_word= 000000002000, - tokr_punct= 000000003000, - tokr_string= 000000004000, + tokm_instance= 0x000000ff, + tokm_repres= 0x00000f00, + tokm_type= 0xfffff000, + tokr_nonstring= 0x00000100, + tokr_word= 0x00000200, + tokr_punct= 0x00000300, + tokr_string= 0x00000400, undivert(4) undivert(1) undivert(2) }; -typedef int directive_fnt(int dtoken); -directive_fnt df_reject, df_execute, df_executefrompath; -directive_fnt df_executefromdirectory; -directive_fnt df_errorstostderr, df_errorstosyslog, df_errorstofile; -directive_fnt dfg_fdwant, dfg_setflag; -directive_fnt df_reset, df_cd, df_userrcfile, df_include; -directive_fnt df_includelookup, df_includedirectory; -directive_fnt df_message, df_error, df_quit, df_eof; -directive_fnt df_if, df_catchquit, df_errorspush; -directive_fnt dfi_includeuserrcfile, dfi_includeclientconfig; -/* directive functions return: - * 0 for success - * having scanned up to and including end of line but not beyond - * an exception (eg tokv_error) for failure of some kind - */ - -typedef int parmcondition_fnt(int ctoken, char **parmvalues, int *rtrue); -parmcondition_fnt pcf_glob, pcf_range, pcf_grep; -/* all conditional functions return tokv_error or 0 for success at parsing - * and testing, in which case *rtrue is set to 0 or 1. On success they - * have scanned up to and including the condition's terminating newline. - * The parameter-based conditionals take a list of parameter values - * as obtained from the parameter functions and pa_parameter, - * and do _not_ free it. - */ - -typedef int parameter_fnt(int ptoken, char ***rvalues); -parameter_fnt pf_service; -parameter_fnt pf_callinguser, pf_serviceuser; -parameter_fnt pf_callinggroup, pf_servicegroup; -parameter_fnt pf_callingusershell, pf_serviceusershell; -/* Parameter functions return tokv_error or 0 for success at parsing - * and determining the value, in which case *rvalues is made to be - * a mallocd null-terminated array of pointers to mallocd strings. - * freeparm can be used to free such an array. - */ - -int yylex(void); -/* Returns a token (which may be a eof or error exception) */ - -extern directive_fnt *lr_dir; -extern parmcondition_fnt *lr_parmcond; -extern parameter_fnt *lr_parameter; -extern int lr_loglevel, lr_logfacility, lr_min, lr_max, *lr_flag; -extern int lr_flagval, lr_controlend; -extern int lr_fdwant_readwrite; /* -1=never, 0=opt, 1=always */ - -undivert(4) - #endif divert(-1)