]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/cf_gen.cc
2 * DEBUG: none Generate squid.conf.default and cf_parser.cci
4 * AUTHOR: Francesco Chemolli
5 * AUTHOR: Amos Jeffries
7 * SQUID Web Proxy Cache http://www.squid-cache.org/
8 * ----------------------------------------------------------
10 * Squid is the result of efforts by numerous individuals from
11 * the Internet community; see the CONTRIBUTORS file for full
12 * details. Many organizations have provided support for Squid's
13 * development; see the SPONSORS file for full details. Squid is
14 * Copyrighted (C) 2001 by the Regents of the University of
15 * California; see the COPYRIGHT file for full details. Squid
16 * incorporates software developed and/or copyrighted by other
17 * sources; see the CREDITS file for full details.
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2 of the License, or
22 * (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
35 /*****************************************************************************
36 * Abstract: This program parses the input file and generates code and
37 * files used to configure the variables in squid.
38 * (ie it creates the squid.conf.default file from the cf.data file)
40 * The output files are as follows:
41 * cf_parser.cci - this file contains, default_all() which
42 * initializes variables with the default
43 * values, parse_line() that parses line from
44 * squid.conf.default, dump_config that dumps the
45 * current the values of the variables.
46 * squid.conf.default - default configuration file given to the server
48 *****************************************************************************/
51 * hack around a bug in intel's c++ compiler's libraries which do not
52 * correctly support 64-bit iostreams
54 #if defined(__INTEL_COMPILER) && defined(_FILE_OFFSET_BITS) && \
56 #undef _FILE_OFFSET_BITS
69 #include "cf_gen_defines.cci"
71 #define MAX_LINE 1024 /* longest configuration line */
72 #define _PATH_PARSER "cf_parser.cci"
73 #define _PATH_SQUID_CONF "squid.conf.documented"
74 #define _PATH_SQUID_CONF_SHORT "squid.conf.default"
75 #define _PATH_CF_DEPEND "cf.data.depend"
85 typedef std::list
<std::string
> LineList
;
86 typedef std::list
<std::string
> TypeDepList
;
87 typedef std::list
<std::string
> EntryAliasList
;
92 DefaultValues() : preset(), if_none(), docs() {}
95 /// Default config lines to be defined before parsing the config files.
98 /// Default config lines to parse if the directive has no prior settings.
99 /// This is mutually exclusive with preset values.
100 /// An error will be printed during build if they clash.
103 /// Default config lines to parse and add to any prior settings.
104 LineList postscriptum
;
106 /// Text description to use in documentation for the default.
107 /// If unset the preset or if-none values will be displayed.
114 Entry(const char *str
) :
115 name(str
), alias(),type(), loc(),
116 defaults(), comment(), ifdef(), doc(), nocomment(),
121 EntryAliasList alias
;
124 DefaultValues defaults
;
131 void genParse(std::ostream
&fout
) const;
134 void genParseAlias(const std::string
&, std::ostream
&) const;
137 typedef std::list
<class Entry
> EntryList
;
142 Type(const char *str
) : name(str
) {}
149 typedef std::list
<class Type
> TypeList
;
151 static const char WS
[] = " \t\n";
152 static int gen_default(const EntryList
&, std::ostream
&);
153 static void gen_parse(const EntryList
&, std::ostream
&);
154 static void gen_dump(const EntryList
&, std::ostream
&);
155 static void gen_free(const EntryList
&, std::ostream
&);
156 static void gen_conf(const EntryList
&, std::ostream
&, bool verbose_output
);
157 static void gen_default_if_none(const EntryList
&, std::ostream
&);
158 static void gen_default_postscriptum(const EntryList
&, std::ostream
&);
159 static bool isDefined(const std::string
&name
);
160 static const char *available_if(const std::string
&name
);
161 static const char *gen_quote_escape(const std::string
&var
);
164 checkDepend(const std::string
&directive
, const char *name
, const TypeList
&types
, const EntryList
&entries
)
166 for (TypeList::const_iterator t
= types
.begin(); t
!= types
.end(); ++t
) {
167 if (t
->name
.compare(name
) != 0)
169 for (TypeDepList::const_iterator dep
= t
->depend
.begin(); dep
!= t
->depend
.end(); ++dep
) {
170 EntryList::const_iterator entry
= entries
.begin();
171 for (; entry
!= entries
.end(); ++entry
) {
172 if (entry
->name
.compare(*dep
) == 0)
175 if (entry
== entries
.end()) {
176 std::cerr
<< "ERROR: '" << directive
<< "' (" << name
<< ") depends on '" << *dep
<< "'\n";
182 std::cerr
<< "ERROR: Dependencies for cf.data type '" << name
<< "' used in ' " << directive
<< "' not defined\n" ;
187 usage(const char *program_name
)
189 std::cerr
<< "Usage: " << program_name
<< " cf.data cf.data.depend\n";
194 errorMsg(const char *filename
, int line
, const char *detail
)
196 std::cerr
<< "Error in '" << filename
<< "' on line " << line
<<
197 "--> " << detail
<< std::endl
;
201 main(int argc
, char *argv
[])
203 char *input_filename
;
204 const char *output_filename
= _PATH_PARSER
;
205 const char *conf_filename
= _PATH_SQUID_CONF
;
206 const char *conf_filename_short
= _PATH_SQUID_CONF_SHORT
;
207 const char *type_depend
;
216 std::stack
<std::string
> IFDEFS
;
221 input_filename
= argv
[1];
222 type_depend
= argv
[2];
224 /*-------------------------------------------------------------------*
225 * Parse type dependencies
226 *-------------------------------------------------------------------*/
227 fp
.open(type_depend
, std::ifstream::in
);
229 std::cerr
<< "Error while opening type dependencies file '" <<
230 type_depend
<< "': " << strerror(errno
) << std::endl
;
235 fp
.getline(buff
,MAX_LINE
);
236 const char *type
= strtok(buff
, WS
);
238 if (!type
|| type
[0] == '#')
241 while ((dep
= strtok(NULL
, WS
)) != NULL
) {
242 t
.depend
.push_front(dep
);
247 fp
.clear(); // BSD does not reset flags in close().
249 /*-------------------------------------------------------------------*
251 *-------------------------------------------------------------------*/
253 /* Open input file */
254 fp
.open(input_filename
, std::ifstream::in
);
256 std::cerr
<< "Error while opening input file '" <<
257 input_filename
<< "': " << strerror(errno
) << std::endl
;
263 while (fp
.getline(buff
,MAX_LINE
), fp
.good() && state
!= sEXIT
) {
268 if ((t
= strchr(buff
, '\n')))
271 if (strncmp(buff
, "IF ", 3) == 0) {
272 if ((ptr
= strtok(buff
+ 3, WS
)) == NULL
) {
273 errorMsg(input_filename
, linenum
, "Missing IF parameter");
278 } else if (strcmp(buff
, "ENDIF") == 0) {
279 if (IFDEFS
.size() == 0) {
280 errorMsg(input_filename
, linenum
, "ENDIF without IF first");
284 } else if (!IFDEFS
.size() || isDefined(IFDEFS
.top()))
289 if ((strlen(buff
) == 0) || (!strncmp(buff
, "#", 1))) {
290 /* ignore empty and comment lines */
292 } else if (!strncmp(buff
, "NAME:", 5)) {
293 char *name
, *aliasname
;
295 if ((name
= strtok(buff
+ 5, WS
)) == NULL
) {
296 errorMsg(input_filename
, linenum
, buff
);
300 entries
.push_back(name
);
302 while ((aliasname
= strtok(NULL
, WS
)) != NULL
)
303 entries
.back().alias
.push_front(aliasname
);
306 } else if (!strcmp(buff
, "EOF")) {
308 } else if (!strcmp(buff
, "COMMENT_START")) {
309 entries
.push_back("comment");
310 entries
.back().loc
= "none";
313 errorMsg(input_filename
, linenum
, buff
);
320 Entry
&curr
= entries
.back();
322 if ((strlen(buff
) == 0) || (!strncmp(buff
, "#", 1))) {
323 /* ignore empty and comment lines */
325 } else if (!strncmp(buff
, "COMMENT:", 8)) {
328 while (isspace((unsigned char)*ptr
))
332 } else if (!strncmp(buff
, "DEFAULT:", 8)) {
335 while (isspace((unsigned char)*ptr
))
338 curr
.defaults
.preset
.push_back(ptr
);
339 } else if (!strncmp(buff
, "DEFAULT_IF_NONE:", 16)) {
342 while (isspace((unsigned char)*ptr
))
345 curr
.defaults
.if_none
.push_back(ptr
);
346 } else if (!strncmp(buff
, "POSTSCRIPTUM:", 13)) {
349 while (isspace((unsigned char)*ptr
))
352 curr
.defaults
.postscriptum
.push_back(ptr
);
353 } else if (!strncmp(buff
, "DEFAULT_DOC:", 12)) {
356 while (isspace((unsigned char)*ptr
))
359 curr
.defaults
.docs
.push_back(ptr
);
360 } else if (!strncmp(buff
, "LOC:", 4)) {
361 if ((ptr
= strtok(buff
+ 4, WS
)) == NULL
) {
362 errorMsg(input_filename
, linenum
, buff
);
367 } else if (!strncmp(buff
, "TYPE:", 5)) {
368 if ((ptr
= strtok(buff
+ 5, WS
)) == NULL
) {
369 errorMsg(input_filename
, linenum
, buff
);
373 /* hack to support arrays, rather than pointers */
374 if (0 == strcmp(ptr
+ strlen(ptr
) - 2, "[]")) {
376 *(ptr
+ strlen(ptr
) - 2) = '\0';
379 checkDepend(curr
.name
, ptr
, types
, entries
);
381 } else if (!strncmp(buff
, "IFDEF:", 6)) {
382 if ((ptr
= strtok(buff
+ 6, WS
)) == NULL
) {
383 errorMsg(input_filename
, linenum
, buff
);
388 } else if (!strcmp(buff
, "DOC_START")) {
390 } else if (!strcmp(buff
, "DOC_NONE")) {
393 errorMsg(input_filename
, linenum
, buff
);
400 if (!strcmp(buff
, "DOC_END") || !strcmp(buff
, "COMMENT_END")) {
402 } else if (!strcmp(buff
, "NOCOMMENT_START")) {
404 } else { // if (buff != NULL) {
405 assert(buff
!= NULL
);
406 entries
.back().doc
.push_back(buff
);
411 if (!strcmp(buff
, "NOCOMMENT_END")) {
413 } else { // if (buff != NULL) {
414 assert(buff
!= NULL
);
415 entries
.back().nocomment
.push_back(buff
);
420 assert(0); /* should never get here */
426 if (state
!= sEXIT
) {
427 errorMsg(input_filename
, linenum
, "Error: unexpected EOF");
433 /*-------------------------------------------------------------------*
434 * Generate default_all()
435 * Generate parse_line()
436 * Generate dump_config()
437 * Generate free_all()
438 * Generate example squid.conf.default file
439 *-------------------------------------------------------------------*/
441 /* Open output x.c file */
443 std::ofstream
fout(output_filename
,std::ostream::out
);
445 std::cerr
<< "Error while opening output .c file '" <<
446 output_filename
<< "': " << strerror(errno
) << std::endl
;
451 " * Generated automatically from " << input_filename
<< " by " <<
454 " * Abstract: This file contains routines used to configure the\n"
455 " * variables in the squid server.\n"
459 rc
= gen_default(entries
, fout
);
461 gen_default_if_none(entries
, fout
);
463 gen_default_postscriptum(entries
, fout
);
465 gen_parse(entries
, fout
);
467 gen_dump(entries
, fout
);
469 gen_free(entries
, fout
);
473 /* Open output x.conf file */
474 fout
.open(conf_filename
,std::ostream::out
);
476 std::cerr
<< "Error while opening output conf file '" <<
477 output_filename
<< "': " << strerror(errno
) << std::endl
;
481 gen_conf(entries
, fout
, 1);
485 fout
.open(conf_filename_short
,std::ostream::out
);
487 std::cerr
<< "Error while opening output short conf file '" <<
488 output_filename
<< "': " << strerror(errno
) << std::endl
;
491 gen_conf(entries
, fout
, 0);
498 gen_default(const EntryList
&head
, std::ostream
&fout
)
501 fout
<< "static void" << std::endl
<<
502 "default_line(const char *s)" << std::endl
<<
504 " LOCAL_ARRAY(char, tmp_line, BUFSIZ);" << std::endl
<<
505 " xstrncpy(tmp_line, s, BUFSIZ);" << std::endl
<<
506 " xstrncpy(config_input_line, s, BUFSIZ);" << std::endl
<<
507 " config_lineno++;" << std::endl
<<
508 " parse_line(tmp_line);" << std::endl
<<
509 "}" << std::endl
<< std::endl
;
510 fout
<< "static void" << std::endl
<<
511 "default_all(void)" << std::endl
<<
513 " cfg_filename = \"Default Configuration\";" << std::endl
<<
514 " config_lineno = 0;" << std::endl
;
516 for (EntryList::const_iterator entry
= head
.begin(); entry
!= head
.end(); ++entry
) {
517 assert(entry
->name
.size());
519 if (!entry
->name
.compare("comment"))
522 if (!entry
->type
.compare("obsolete"))
525 if (!entry
->loc
.size()) {
526 std::cerr
<< "NO LOCATION FOR " << entry
->name
<< std::endl
;
531 if (!entry
->defaults
.preset
.size() && entry
->defaults
.if_none
.empty()) {
532 std::cerr
<< "NO DEFAULT FOR " << entry
->name
<< std::endl
;
537 if (!entry
->defaults
.preset
.size() || entry
->defaults
.preset
.front().compare("none") == 0) {
538 fout
<< " // No default for " << entry
->name
<< std::endl
;
540 if (entry
->ifdef
.size())
541 fout
<< "#if " << entry
->ifdef
<< std::endl
;
543 for (LineList::const_iterator l
= entry
->defaults
.preset
.begin(); l
!= entry
->defaults
.preset
.end(); ++l
) {
544 fout
<< " default_line(\"" << entry
->name
<< " " << gen_quote_escape(*l
) << "\");" << std::endl
;
547 if (entry
->ifdef
.size())
548 fout
<< "#endif" << std::endl
;
552 fout
<< " cfg_filename = NULL;" << std::endl
<<
553 "}" << std::endl
<< std::endl
;
558 gen_default_if_none(const EntryList
&head
, std::ostream
&fout
)
560 fout
<< "static void" << std::endl
<<
561 "defaults_if_none(void)" << std::endl
<<
563 " cfg_filename = \"Default Configuration (if absent)\";" << std::endl
<<
564 " config_lineno = 0;" << std::endl
;
566 for (EntryList::const_iterator entry
= head
.begin(); entry
!= head
.end(); ++entry
) {
567 assert(entry
->name
.size());
569 if (!entry
->loc
.size())
572 if (entry
->defaults
.if_none
.empty())
575 if (!entry
->defaults
.preset
.empty()) {
576 std::cerr
<< "ERROR: " << entry
->name
<< " has preset defaults. DEFAULT_IF_NONE cannot be true." << std::endl
;
580 if (entry
->ifdef
.size())
581 fout
<< "#if " << entry
->ifdef
<< std::endl
;
583 fout
<< " if (check_null_" << entry
->type
<< "(" << entry
->loc
<< ")) {" << std::endl
;
584 for (LineList::const_iterator l
= entry
->defaults
.if_none
.begin(); l
!= entry
->defaults
.if_none
.end(); ++l
)
585 fout
<< " default_line(\"" << entry
->name
<< " " << gen_quote_escape(*l
) <<"\");" << std::endl
;
586 fout
<< " }" << std::endl
;
588 if (entry
->ifdef
.size())
589 fout
<< "#endif" << std::endl
;
592 fout
<< " cfg_filename = NULL;" << std::endl
<<
593 "}" << std::endl
<< std::endl
;
596 /// append configuration options specified by POSTSCRIPTUM lines
598 gen_default_postscriptum(const EntryList
&head
, std::ostream
&fout
)
600 fout
<< "static void" << std::endl
<<
601 "defaults_postscriptum(void)" << std::endl
<<
603 " cfg_filename = \"Default Configuration (postscriptum)\";" << std::endl
<<
604 " config_lineno = 0;" << std::endl
;
606 for (EntryList::const_iterator entry
= head
.begin(); entry
!= head
.end(); ++entry
) {
607 assert(entry
->name
.size());
609 if (!entry
->loc
.size())
612 if (entry
->defaults
.postscriptum
.empty())
615 if (entry
->ifdef
.size())
616 fout
<< "#if " << entry
->ifdef
<< std::endl
;
618 for (LineList::const_iterator l
= entry
->defaults
.postscriptum
.begin(); l
!= entry
->defaults
.postscriptum
.end(); ++l
)
619 fout
<< " default_line(\"" << entry
->name
<< " " << *l
<<"\");" << std::endl
;
621 if (entry
->ifdef
.size())
622 fout
<< "#endif" << std::endl
;
625 fout
<< " cfg_filename = NULL;" << std::endl
<<
626 "}" << std::endl
<< std::endl
;
630 Entry::genParseAlias(const std::string
&aName
, std::ostream
&fout
) const
632 fout
<< " if (!strcmp(token, \"" << aName
<< "\")) {" << std::endl
;
634 fout
<< "#if " << ifdef
<< std::endl
;
635 fout
<< " cfg_directive = \"" << aName
<< "\";" << std::endl
;
637 if (type
.compare("obsolete") == 0) {
638 fout
<< "debugs(0, DBG_CRITICAL, \"ERROR: Directive '" << aName
<< "' is obsolete.\");\n";
639 for (LineList::const_iterator l
= doc
.begin(); l
!= doc
.end(); ++l
) {
640 // offset line to strip initial whitespace tab byte
641 fout
<< " debugs(0, DBG_PARSE_NOTE(DBG_IMPORTANT), \"" << aName
<< " : " << &(*l
)[1] << "\");" << std::endl
;
643 fout
<< " parse_obsolete(token);";
644 } else if (!loc
.size() || loc
.compare("none") == 0) {
645 fout
<< "parse_" << type
<< "();";
647 fout
<< "parse_" << type
<< "(&" << loc
<< (array_flag
? "[0]" : "") << ");";
650 fout
<< " cfg_directive = NULL;" << std::endl
;
653 "#else" << std::endl
<<
654 " debugs(0, DBG_PARSE_NOTE(DBG_IMPORTANT), \"ERROR: '" << name
<< "' requires " << available_if(ifdef
) << "\");" << std::endl
<<
655 "#endif" << std::endl
;
657 fout
<< " return 1;" << std::endl
;
658 fout
<< " };" << std::endl
;
662 Entry::genParse(std::ostream
&fout
) const
664 if (name
.compare("comment") == 0)
667 // Once for the current directive name
668 genParseAlias(name
, fout
);
670 // All accepted aliases
671 for (EntryAliasList::const_iterator a
= alias
.begin(); a
!= alias
.end(); ++a
) {
672 genParseAlias(*a
, fout
);
677 gen_parse(const EntryList
&head
, std::ostream
&fout
)
681 "parse_line(char *buff)\n"
684 "\tif ((token = strtok(buff, w_space)) == NULL) \n"
685 "\t\treturn 1;\t/* ignore empty lines */\n"
686 "\tConfigParser::SetCfgLine(strtok(NULL, \"\"));\n";
688 for (EntryList::const_iterator e
= head
.begin(); e
!= head
.end(); ++e
)
691 fout
<< "\treturn 0; /* failure */\n"
697 gen_dump(const EntryList
&head
, std::ostream
&fout
)
700 "static void" << std::endl
<<
701 "dump_config(StoreEntry *entry)" << std::endl
<<
703 " debugs(5, 4, HERE);" << std::endl
;
705 for (EntryList::const_iterator e
= head
.begin(); e
!= head
.end(); ++e
) {
707 if (!e
->loc
.size() || e
->loc
.compare("none") == 0)
710 if (e
->name
.compare("comment") == 0)
714 fout
<< "#if " << e
->ifdef
<< std::endl
;
716 fout
<< " dump_" << e
->type
<< "(entry, \"" << e
->name
<< "\", " << e
->loc
<< ");" << std::endl
;
719 fout
<< "#endif" << std::endl
;
722 fout
<< "}" << std::endl
<< std::endl
;
726 gen_free(const EntryList
&head
, std::ostream
&fout
)
729 "static void" << std::endl
<<
730 "free_all(void)" << std::endl
<<
732 " debugs(5, 4, HERE);" << std::endl
;
734 for (EntryList::const_iterator e
= head
.begin(); e
!= head
.end(); ++e
) {
735 if (!e
->loc
.size() || e
->loc
.compare("none") == 0)
738 if (e
->name
.compare("comment") == 0)
742 fout
<< "#if " << e
->ifdef
<< std::endl
;
744 fout
<< " free_" << e
->type
<< "(&" << e
->loc
<< (e
->array_flag
? "[0]" : "") << ");" << std::endl
;
747 fout
<< "#endif" << std::endl
;
750 fout
<< "}" << std::endl
<< std::endl
;
754 isDefined(const std::string
&name
)
759 for (int i
= 0; defines
[i
].name
; ++i
) {
760 if (name
.compare(defines
[i
].name
) == 0)
761 return defines
[i
].defined
;
768 available_if(const std::string
&name
)
772 for (int i
= 0; defines
[i
].name
; ++i
) {
773 if (name
.compare(defines
[i
].name
) == 0)
774 return defines
[i
].enable
;
781 gen_conf(const EntryList
&head
, std::ostream
&fout
, bool verbose_output
)
783 for (EntryList::const_iterator entry
= head
.begin(); entry
!= head
.end(); ++entry
) {
789 if (!entry
->name
.compare("comment"))
791 else if (!entry
->name
.compare("obsolete"))
793 else if (verbose_output
) {
794 fout
<< "# TAG: " << entry
->name
;
796 if (entry
->comment
.size())
797 fout
<< "\t" << entry
->comment
;
802 // Display --enable/--disable disclaimer
803 if (!isDefined(entry
->ifdef
)) {
804 if (verbose_output
) {
805 fout
<< "# Note: This option is only available if Squid is rebuilt with the" << std::endl
<<
806 "# " << available_if(entry
->ifdef
) << std::endl
<<
812 // Display DOC_START section
813 if (verbose_output
&& entry
->doc
.size()) {
814 for (LineList::const_iterator line
= entry
->doc
.begin(); line
!= entry
->doc
.end(); ++line
) {
815 fout
<< "#" << *line
<< std::endl
;
819 if (entry
->defaults
.docs
.size()) {
820 // Display the DEFAULT_DOC line(s)
821 def
= entry
->defaults
.docs
;
823 if (entry
->defaults
.preset
.size() && entry
->defaults
.preset
.front().compare("none") != 0) {
824 // Display DEFAULT: line(s)
825 for (LineList::const_iterator l
= entry
->defaults
.preset
.begin(); l
!= entry
->defaults
.preset
.end(); ++l
) {
826 snprintf(buf
, sizeof(buf
), "%s %s", entry
->name
.c_str(), l
->c_str());
829 } else if (entry
->defaults
.if_none
.size()) {
830 // Display DEFAULT_IF_NONE: line(s)
831 for (LineList::const_iterator l
= entry
->defaults
.if_none
.begin(); l
!= entry
->defaults
.if_none
.end(); ++l
) {
832 snprintf(buf
, sizeof(buf
), "%s %s", entry
->name
.c_str(), l
->c_str());
838 // Display "none" if no default is set or comments to display
839 if (def
.empty() && entry
->nocomment
.empty() && entry
->name
.compare("comment") != 0)
840 def
.push_back("none");
842 if (verbose_output
&& def
.size()) {
843 fout
<< "#Default:\n";
845 fout
<< "# " << def
.front() << std::endl
;
848 if (entry
->doc
.empty() && entry
->nocomment
.empty())
852 if (verbose_output
&& entry
->nocomment
.size())
853 fout
<< "#" << std::endl
;
855 if (enabled
|| verbose_output
) {
856 for (LineList::const_iterator line
= entry
->nocomment
.begin(); line
!= entry
->nocomment
.end(); ++line
) {
857 if (!enabled
&& line
->at(0) != '#')
859 fout
<< *line
<< std::endl
;
863 if (verbose_output
&& entry
->doc
.size()) {
870 gen_quote_escape(const std::string
&var
)
872 static std::string esc
;
875 for (int i
= 0; i
< var
.length(); ++i
) {