aboutsummaryrefslogtreecommitdiff
path: root/src/Make.am
AgeCommit message (Collapse)AuthorFiles
2016-07-04Split declarations between several header files.Sergey Poznyakoff1
* Makefile.am (SUBDIRS): Add include * am/grecs.m4 (GRECS_INCLUDES): Update (GRECS_COND_BUILD_INSTALL) (GRECS_COND_BUILD_SHARED) (GRECS_COND_BUILD_STATIC): New conditions. Build include/Makefile and include/grecs/Makefile. * configure.ac: Use src/grecs-gram.y as a source validity marker * include/Makefile.a: New file. * src/grecs.hin: Remove. Split into include/*. See below. * include/grecs.h: New file. * include/grecs/.gitignore: New file. * include/grecs/Makefile.am: New file. * include/grecs/doc.h: New file. * include/grecs/error.h: New file. * include/grecs/format.h: New file. * include/grecs/lex.h: New file. * include/grecs/list.h: New file. * include/grecs/mem.h: New file. * include/grecs/node.h: New file. * include/grecs/parser.h: New file. * include/grecs/preproc.h: New file. * include/grecs/sockaddr.h: New file. * include/grecs/symtab.h: New file. * include/grecs/table.h: New file. * include/grecs/tree.h: New file. * include/grecs/txtacc.h: New file. * include/grecs/types.h.in: New file. * include/grecs/util.h: New file. * include/grecs/value.h: New file. * include/grecs/version.h: New file. * src/grecs-locus.h: Move to ... * include/grecs/locus.h: ... here * src/grecsopt.h: Move to ... * include/grecs/opt.h: ... here * src/json.h: Move to ... * include/grecs/json.h: ... here * src/wordsplit.h: Move to ... * include/wordsplit.h: ... here * src/Make-inst.am (include_HEADERS): Remove. * src/Make-shared.am (grecsinclude_HEADERS) (noinst_HEADERS): Remove. * src/Make-static.am (noinst_HEADERS): Remove. * src/Make.am: Remove header-related stuff * src/bind-gram.y: Fix includes. * src/bind-lex.l: Likewise. * src/cidr.c: Likewise. * src/dhcpd-gram.y: Likewise. * src/dhcpd-lex.l: Likewise. * src/diag.c: Likewise. * src/format.c: Likewise. * src/grecs-gram.y: Likewise. * src/grecs-lex.l: Likewise. * src/json-gram.y: Likewise. * src/json-lex.l: Likewise. * src/jsonfmt.c: Likewise. * src/lookup.c: Likewise. * src/meta1-gram.y: Likewise. * src/meta1-lex.l: Likewise. * src/opthelp.c: Likewise. * src/preproc.c: Likewise. * src/sockaddr.c: Likewise. * src/txtacc.c: Likewise. * src/version.c: Likewise. * tests/gcfenum.c: Likewise. * tests/gcffmt.c: Likewise. * tests/gcfpeek.c: Likewise. * tests/gcfset.c: Likewise. * tests/gcfver.c: Likewise. * tests/json.c: Likewise.
2016-07-04Update copyright yearsSergey Poznyakoff1
2015-12-20Implement function for formatting JSON valuesSergey Poznyakoff1
* src/Make.am: Add jsonfmt.c * src/json.h (json_format): New struct. (json_format_value): New proto. * src/jsonfmt.c: New file. * tests/json.c: Use json_format_value.
2015-12-18Add basic JSON support functions.Sergey Poznyakoff1
* src/Make-inst.am: Add json.h * src/Make-shared.am: Likewise. * src/Make-static.am: Likewise. * src/Make.am: Likewise. * src/json-gram.y: New file. * src/json-lex.l: New file. * src/json.h: New file. * src/yytrans: Translate json prefixes. * src/.gitignore: Update. * tests/json.c: New file. * tests/json00.at: New file. * tests/json01.at: New file. * tests/Makefile.am: Add new tests; build json * tests/testsuite.at: Add new tests. * tests/.gitignore: Update. * am/grecs.m4: New flag "json" * configure.ac (GRECS_SETUP): Require json * src/Make-inst.am (include_HEADERS): Assign GRECS_HDR value. * src/Make-shared.a [GRECS_COND_INSTALLHEADERS] (grecsinclude_HEADERS) [!GRECS_COND_INSTALLHEADERS] (noinst_HEADERS): Likewise. * src/Make-static.am (noinst_HEADERS): Likewise. * src/Make.am [GRECS_COND_JSON]: Define GRECS_JSON and GRECS_EXTRA_JSON.
2015-12-17Update copyright yearsSergey Poznyakoff1
2014-09-25Add support for IPv6, multiple addresses and CIDRs.Sergey Poznyakoff1
* am/grecs.m4 (GRECS_SETUP): New option sockaddr-list. Build grecs.h at configure stage. * src/Make.am (GRECS_SRC): Add cidr.c and ipstr.c [GRECS_COND_SOCKADDR_LIST] (GRECS_SRC): Add sockaddr.c Remove rule for building grecs.h (see above). * src/cidr.c: New file. * src/ipstr.c: New file. * src/sockaddr.c: New file. * src/format.c (grecs_data_type_string): Change spelling of sockaddr. * src/grecs-lex.l: Treat square brackets as part of word. * src/grecs.hin (GRECS_SOCKADDR_LIST): New define. [GRECS_SOCKADDR_LIST] (grecs_sockaddr): New member: next. (grecs_str_is_ipv4,grecs_str_is_ipv6) (grecs_str_is_ipaddr,grecs_str_is_num): New functions. [GRECS_SOCKADDR_LIST] (grecs_sockaddr_hints): New struct. [GRECS_SOCKADDR_LIST] (grecs_sockaddr_new,grecs_sockaddr_free) (grecs_str_to_sockaddr): New protos. (grecs_cidr): New struct. (grecs_str_to_cidr,grecs_sockaddr_to_cidr) (grecs_sockadd_cidr_match): New protos. * src/tree.c [GRECS_SOCKADDR_LIST] (grecs_sockaddr_hints): New global. [!GRECS_SOCKADDR_LIST] (string_to_sockaddr): Retain for backward compatibility. [GRECS_SOCKADDR_LIST] (grecs_string_convert): Use grecs_str_to_sockaddr. (grecs_prop_tab): Add entry for grecs_type_cidr
2013-02-26Introduce an alternative callback function calling convention.Sergey Poznyakoff1
Depending on the tree-api option to the GRECS_SETUP macro, the signature of callback functions changes. If the option is supplied, a pointer to grecs_node_t is passwd to callback functions as an argument instead of pointers to the value and locus. * am/grecs.m4 (GRECS_SETUP): New option tree-api. * src/.gitignore: Add grecs.h * src/Make.am: Build grecs.h * src/grecs.h: Rename to src/grecs.hin (GRECS_TREE_API): New define (grecs_callback_fn): Provide two alternative signatures depending on the value of GRECS_TREE_API. All uses updated. * src/tree.c (fake_callback): Update signature. (grecs_process_ident) (stmt_begin,stmt_end): Update calls to callback. * tests/gcfset.c: Likewise.
2012-12-29Use AM_CPPFLAGS instead of the INCLUDES in Makefiles.Sergey Poznyakoff1
2012-09-26Improve getopt interface.Sergey Poznyakoff1
* build-aux/getopt.m4: Move function declarations to the library. Introduce new options: nopermute, nousage, noversion. * src/grecsopt.h: New file. * src/opthelp.c: New file. * src/Make-shared.am: Add new files. * src/Make-static.am: Likewise. * src/Make.am: Likewise.
2012-08-13Implement a parser for dhcpd.confSergey Poznyakoff1
* am/grecs.m4 (parser-dhcpd): New option. * doc/GRECS_SETUP.3: Document parser-dhcpd * src/.gitignore: Add dhcpd-* generated files. * src/Make.am [GRECS_COND_DHCPD_PARSER]: Define DHCPD variables. (GRECS_SRC, EXTRA_DIST): Reference them. * src/dhcpd-gram.y: New file. * src/dhcpd-lex.l: New file. * src/grecs.h (grecs_dhcpd_parser): New proto. * src/tree.c (node_reduce): Fix return without a value.
2012-01-03Happy GNU YearSergey Poznyakoff1
2011-06-26Keep track of columns in the node and value locations. Improve error ↵Sergey Poznyakoff1
diagnostics. * src/grecs.h (grecs_locus_point): New struct. (grecs_locus_point_advance_line): New macro. (grecs_locus_t): Redesign. (grecs_value) <locus>: New member. (grecs_node) <idloc>: New member. (grecs_print_diag_fun): Change signature. (grecs_warning,grecs_error): Change signature. (grecs_parse_line_directive) (grecs_parse_line_directive_cpp) (grecs_string_convert): Change signature. (grecs_current_locus): Remove. (grecs_current_locus_point): New extern. * src/grecs-locus.h: New file. * src/Make.am (noinst_HEADERS): Add grecs-locus.h. * src/join.c (reset_locus): Rewrite. * src/lookup.c: Initialize new members of grecs_value and grecs_node. (split_cfg_path): Return wrdse error code. (grecs_node_from_path_locus): Take two grecs_locus_t arguments. Make sure all created nodes have their locus members properly initialized. * src/parser.c (grecs_parse): Initialize grecs_current_locus_point. * src/tree.c (grecs_node_create_points): New function. (string_to_bool,string_to_host,string_to_sockaddr) (grecs_string_convert): Change signatures. Be more precise in what locus to report. * src/diag.c (default_print_diag): Use YY_LOCATION_PRINT to output locus. (grecs_print_diag_fun): Change signature. (grecs_warning,grecs_error): Change signature. * src/format.c (grecs_format_locus): Rewrite. (grecs_format_node): Be more precise in what locus is being output. * src/bind-gram.y: Keep track of locations. Turn on error-verbose mode. * src/grecs-gram.y: Likewise. * src/meta1-gram.y: Likewise. * src/bind-lex.l: Keep track of locations. * src/git-parser.c: Likewise. * src/grecs-lex.l: Likewise. * src/meta1-lex.l: Likewise. * src/path-parser.c: Likewise. * src/preproc.c: Likewise. * tests/gcf1.conf: Untabify. * tests/format01.at: Reflect changes in the output. * tests/join.at: Likewise. * tests/set.at: Likewise. * tests/locus-bind.at: New testcase. * tests/locus-git.at: New testcase. * tests/locus-meta1.at: New testcase. * tests/locus00.at: New testcase. * tests/locus01.at: New testcase. * tests/locus02.at: New testcase. * tests/path-locus.at: New testcase.
2011-06-23Conditionally include tests related to parser formats that can be disabled ↵Sergey Poznyakoff1
at configuration time. * src/Make.am (PARSER_DEFS, AM_CPPFLAGS): New variables. [GRECS_COND_META1_PARSER]: Update PARSER_DEFS. [GRECS_COND_BIND_PARSER]: Likewise. [GRECS_COND_GIT_PARSER]: Likewise. (GRECS_SRC): Add parsertab.c * src/parsertab.c: New file. * src/grecs.h (grecs_parser_t): New typedef. (grecs_enumerate_parsers) (grecs_get_parser_by_type): New functions. * tests/Makefile.am (PARSER_DEFS): New variable. [GRECS_COND_META1_PARSER]: Update PARSER_DEFS. [GRECS_COND_BIND_PARSER]: Likewise. [GRECS_COND_GIT_PARSER]: Likewise. (package.m4): Define ENABLE_* according to the PARSER_DEFS settings. * tests/empty.at: Test ENABLE_* defines to avoid testing unsupported parser formats. * tests/testsuite.at: Likewise. * tests/gcffmt.c: New option -list. Improve help output.
2011-05-19Implement "path-style" (Xres-style) config parser.Sergey Poznyakoff1
* src/path-parser.c: New file. * src/format.c (grecs_format_node): Attempt to print value only if the node is grecs_node_stmt. * src/grecs.h (grecs_path_parser): New proto. (grecs_node_from_path_locus): New proto. * src/lookup.c (grecs_node_from_path_locus): New function. * src/Make.am (GRECS_SRC): Add path-parser.c. * build-aux/getopt.m4: Implement print_help_hook.
2011-05-16Implement parser for git-style config files.Sergey Poznyakoff1
* am/grecs.m4: New option: parser-git * doc/GRECS_SETUP.3: Document new options. * src/git-parser.c: New file. * src/Make.am [GRECS_COND_GIT_PARSER]: Define GRECS_PARSER_GIT. (GRECS_SRC): Add GRECS_PARSER_GIT. * src/grecs.h (grecs_git_parser): New proto. * src/txtacc.c (grecs_txtacc_free): Ignore NULL argument.
2011-05-16Implement BIND config parser.Sergey Poznyakoff1
* am/grecs.m4: New option: parser-bind. * src/.gitignore: Update. * src/Make.am [GRECS_COND_BIND_PARSER]: Set GRECS_PARSER_BIND and GRECS_EXTRA_BIND. (GRECS_SRC): Include GRECS_PARSER_BIND. (EXTRA_DIST): Include GRECS_EXTRA_BIND. * src/bind-gram.y: New file. * src/bind-lex.l: New file. * src/format.c (grecs_txtacc_format_value): New function. * src/grecs.h (grecs_bind_parser): New proto. * src/parser.c: Set grecs_current_locus. * src/tree.c (grecs_node_bind): Return immediately if node==NULL. * src/yytrans: Update.
2011-05-15Provide a framework for multiple parsers. Implement meta1 parser.Sergey Poznyakoff1
* Makefile.am (EXTRA_DIST): Add build-aux/yyrename * am/grecs.m4: New options: parser-meta1 and all-parsers * src/.gitignore: Update. * src/Make.am [GRECS_COND_META1_PARSER]: Set GRECS_PARSER_META1 and GRECS_EXTRA_META1 (GRECS_SRC): Add new files. (EXTRA_DIST): Add GRECS_EXTRA_META1. (LEXCOMPILE,YACCCOMPILE): Redefine * src/grecs-gram.y: Don't include yygrecs.h (grecs_vasprintf,grecs_asprintf): Move to a separate file. (grecs_parse): Rename to grecs_grecs_parser. Actual grecs_parse is defined in parser.c (grecs_gram_trace): Move to parser.c * src/grecs-lex.l: Don't include yygrecs.h Use line_acc functions. * src/grecs.h (grecs_trace_flags): New extern. (GRECS_TRACE_GRAM, GRECS_TRACE_LEX): New flags. (grecs_lex_begin): Change signature. (grecs_grecs_parser,grecs_meta1_parser): New protos. (grecs_line_acc_create) (grecs_line_acc_free,grecs_line_acc_grow_char) (grecs_line_acc_grow_char_unescape) (grecs_line_acc_grow) (grecs_line_acc_grow_unescape_last): New protos. (GRECS_TXTACC_BUFSIZE): New const (grecs_txtacc_create,grecs_txtacc_free) (grecs_txtacc_grow,grecs_txtacc_finish) (grecs_txtacc_free_string): New protos. (grecs_value_match): New proto. * src/wordsplit.c (quote_transtab): Translate \" * src/yygrecs.h: Remove. * src/yytrans: New file. * build-aux/yyrename: New file. * src/asprintf.c: New file. * src/lineacc.c: New file. * src/meta1-gram.y: New file. * src/meta1-lex.l: New file. * src/parser.c: New file. * src/txtacc.c: New file. * doc/grecs_parse.3: Update. * doc/GRECS_SETUP.3: Update.
2011-05-13Improvements in git2chg.awk and grecs setup sequence.Sergey Poznyakoff1
* build-aux/git2chg.awk: New configuration variables: since=YYYY-MM-DD, to cut off entries earlier than the given date, and append=FILE, to append FILE to the generated ChangeLog. * am/grecs.m4 (GRECS_HOST_PROJECT_INCLUDES): New substitution variable. * src/Make.am (INCLUDES): Expand GRECS_HOST_PROJECT_INCLUDES. * tests/Makefile.am: Likewise.
2011-05-08Various fixes.Sergey Poznyakoff1
* .gitignore: Add gitid.h * Makefile.am: Build gitid.h. * am/grecs.m4: Remove GRECS_VEROK_AT. * build-aux/getopt.m4 (print_version_hook): New variable. (print_version): Call print_version_hook, if defined. * src/Make.am (INCLUDES): Update. * src/grecs.h (grecs_version_info) <id>: New member. * src/version.c (grecs_version): Initialize id. * tests/Makefile.am: Remove GRECS_VEROK_AT. * tests/testsuite.at: Likewise.
2011-05-07Support standalone compilation.Sergey Poznyakoff1
* AUTHORS, COPYING, NEWS, README: New files. * .gitignore: Update. * am/.gitignore: New file. * build-aux/.gitignore: New file. * build-aux/ylwrap: Remove. * Makefile.am: Define ACLOCAL_AMFLAGS [GRECS_CHANGELOG]: Build ChangeLog. * am/grecs.m4: Define GRECS_CHANGELOG and GRECS_SRCDIR. Fixup first argument, if it is [.]. * configure.ac: New file. * src/Make-inst.am (include_HEADERS): Add wordsplit.h. Install libgrecs.m4. * Make-shared.am (noinst_HEADERS): Add wordsplit.h. * src/Make-static.am: Likewise. * src/Make.am (GRECS_SRC): Remove wordsplit.h (noinst_HEADERS): Add yygrecs.h (YLWRAP): Remove. * src/libgrecs.m4: New file. * src/yygrecs.h: New file. * src/grecs-gram.y: Include yygrecs.h. * src/grecs-lex.l: Likewise. * src/preproc.c (yy_grecs_flex_debug): Rename to grecs_yy_flex_debug.
2011-05-07Minor change in makefiles.Sergey Poznyakoff1
* src/Makefile.am: Remove. * src/Make.am (GRECS_SRC): Remove grecs.h * src/Make-inst.am (include_HEADERS): Add grecs.h * src/Make-shared.am (noinst_HEADERS): Add grecs.h * src/Make-static.am: Likewise.
2011-05-07Implement tree join.Sergey Poznyakoff1
* src/join.c: New file. * src/Make.am: Add join.c * src/grecs.h (grecs_tree_join): New function. * tests/gcffmt.c (main): If several files are given, process them all and join the resulting trees. * tests/join.at: New testcase. * tests/testsuite.at: Include join.at. * tests/Makefile.am: Add join.at.
2011-05-06Implement tree sorting.Sergey Poznyakoff1
* src/sort.c: New file. * src/Make.am: Add sort.c. * tests/gcffmt.c: New option -sort. * src/grecs-lex.l (ID): Allow for single-character identifiers.
2011-05-05Improve node formatting. Add version comparasion functions.Sergey Poznyakoff1
* am/grecs.m4 (GRECS_SETUP): New option: shared. * doc/GRECS_SETUP.3: Document new options. * doc/grecs_format_locus.3: Update. * doc/grecs_format_node.3: Document new flags. * src/.gitignore: Update. * src/version.c: New file. * src/Make.am (GRECS_SRC): Add version.c (EXTRA_DIST): Update. * src/diag.c (default_print_diag): Flush stdout as per the docs. * src/format.c (grecs_format_locus): Don't print trailing semicolon. (grecs_format_value): Handle GRECS_NODE_FLAG_NOQUOTE flag. (grecs_format_node): Print delimiters when needed. * src/grecs.h (grecs_version_info): New struct. (grecs_version, grecs_version_cmp): New protos. (GRECS_NODE_FLAG_NOQUOTE): New flag. * tests/gcfver.c: New file. * tests/vercmp.at: New file. * tests/.gitignore: Update. * tests/Makefile.am: Define GRECS_VERCMP_AT in package.m4 (TESTSUITE_AT): Add vercmp.at (conditionally). (noinst_PROGRAMS): Add gcfver. * tests/testsuite.at: Conditionally include vercmp.at.
2011-05-04Improve docs. Add an option to create installable distribution.Sergey Poznyakoff1

Return to:

Send suggestions and report system problems to the System administrator.