00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef ACE_SVC_CONF_H
00015 #define ACE_SVC_CONF_H
00016
00017 #include "ace/pre.h"
00018
00019
00020
00021
00022 #include "ace/Obstack.h"
00023
00024 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 # pragma once
00026 #endif
00027
00028 #include "ace/Service_Config.h"
00029 #include "ace/Parse_Node.h"
00030
00031 #if (ACE_USES_CLASSIC_SVC_CONF == 1)
00032
00033
00034 struct ace_yy_buffer_state;
00035
00036
00037
00038 #if defined (DEBUGGING)
00039 #if defined (ACE_YY_DECL)
00040 #undef ACE_YY_DECL
00041 #endif
00042 #define ACE_YY_DECL extern "C" char *ace_yylex (ACE_YYSTYPE *ace_yylval, void *ACE_YYLEX_PARAM)
00043 #else
00044 #define ACE_YY_DECL extern "C" int ace_yylex (ACE_YYSTYPE *ace_yylval, void *ACE_YYLEX_PARAM)
00045 #endif
00046
00047 extern void ace_yy_delete_buffer (ace_yy_buffer_state *buffer);
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 class ACE_Svc_Conf_Param
00063 {
00064 public:
00065
00066 enum SVC_CONF_PARAM_TYPE
00067 {
00068
00069 SVC_CONF_FILE,
00070
00071
00072 SVC_CONF_DIRECTIVE
00073 };
00074
00075
00076 ACE_Svc_Conf_Param (FILE *file)
00077 : type (SVC_CONF_FILE),
00078 yyerrno (0),
00079 yylineno (1),
00080 buffer (0),
00081 obstack ()
00082 {
00083 source.file = file;
00084 }
00085
00086
00087 ACE_Svc_Conf_Param (const ACE_TCHAR *directive)
00088 : type (SVC_CONF_DIRECTIVE),
00089 yyerrno (0),
00090 yylineno (1),
00091 buffer (0),
00092 obstack ()
00093 {
00094 source.directive = directive;
00095 }
00096
00097 ~ACE_Svc_Conf_Param (void)
00098 {
00099 ace_yy_delete_buffer (this->buffer);
00100 }
00101
00102 public:
00103
00104 union
00105 {
00106
00107 FILE *file;
00108
00109
00110 const ACE_TCHAR *directive;
00111
00112 } source;
00113
00114
00115 SVC_CONF_PARAM_TYPE type;
00116
00117
00118 int yyerrno;
00119
00120
00121 int yylineno;
00122
00123
00124
00125 ace_yy_buffer_state *buffer;
00126
00127
00128
00129 ACE_Obstack_T<ACE_TCHAR> obstack;
00130
00131 };
00132
00133
00134
00135 #define ACE_YYPARSE_PARAM ace_svc_conf_parameter
00136 #define ACE_YYLEX_PARAM ACE_YYPARSE_PARAM
00137
00138 #define ACE_SVC_CONF_PARAM (ACE_static_cast (ACE_Svc_Conf_Param *, ACE_YYLEX_PARAM))
00139
00140
00141
00142
00143 typedef union
00144 {
00145 int type_;
00146 ACE_Location_Node *location_node_;
00147 ACE_Parse_Node *parse_node_;
00148 ACE_Static_Node *static_node_;
00149 ACE_Service_Type *svc_record_;
00150 ACE_TCHAR *ident_;
00151 } ACE_YYSTYPE;
00152
00153
00154 struct ace_yy_buffer_state;
00155
00156
00157
00158 void ace_yy_push_buffer (FILE *file,
00159 ace_yy_buffer_state *&buffer);
00160
00161
00162
00163 void ace_yy_push_buffer (const ACE_TCHAR *directive,
00164 ace_yy_buffer_state *&buffer);
00165
00166
00167
00168 void ace_yy_pop_buffer (ace_yy_buffer_state *buf);
00169
00170
00171 #ifdef ACE_YYPARSE_PARAM
00172 int ace_yyparse (void *);
00173 #else
00174 int ace_yyparse (void);
00175 #endif
00176
00177
00178 ACE_YY_DECL;
00179
00180
00181 extern FILE *ace_yyin;
00182
00183
00184 void ace_yyerror (int yyerrno, int yylineno, const ACE_TCHAR *);
00185
00186
00187 extern ACE_TCHAR *ace_yytext;
00188
00189
00190 extern int ace_yyleng;
00191
00192 #endif
00193
00194
00195 extern ACE_Service_Type_Impl *
00196 ace_create_service_type (const ACE_TCHAR *,
00197 int,
00198 void *,
00199 unsigned int,
00200 ACE_Service_Object_Exterminator = 0);
00201
00202
00203 #include "ace/post.h"
00204
00205 #endif