autogen-users Mailing List for AutoGen: The Automated Program Generator (Page 6)
Brought to you by:
bkorb
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(8) |
Aug
(7) |
Sep
(4) |
Oct
(2) |
Nov
(26) |
Dec
(3) |
2002 |
Jan
(7) |
Feb
(1) |
Mar
(10) |
Apr
(22) |
May
(8) |
Jun
(6) |
Jul
(2) |
Aug
(4) |
Sep
(5) |
Oct
(2) |
Nov
(5) |
Dec
(13) |
2003 |
Jan
(5) |
Feb
(1) |
Mar
(38) |
Apr
(16) |
May
(13) |
Jun
(12) |
Jul
(21) |
Aug
(6) |
Sep
|
Oct
|
Nov
(5) |
Dec
(7) |
2004 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
(2) |
May
(4) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(6) |
Nov
(7) |
Dec
(5) |
2005 |
Jan
(11) |
Feb
(12) |
Mar
(4) |
Apr
(16) |
May
(6) |
Jun
(5) |
Jul
(5) |
Aug
|
Sep
(4) |
Oct
(4) |
Nov
(4) |
Dec
(7) |
2006 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(4) |
Jul
(17) |
Aug
(2) |
Sep
(13) |
Oct
(20) |
Nov
(6) |
Dec
(18) |
2007 |
Jan
(15) |
Feb
(21) |
Mar
(9) |
Apr
(9) |
May
(3) |
Jun
|
Jul
(9) |
Aug
(9) |
Sep
(2) |
Oct
(4) |
Nov
(7) |
Dec
|
2008 |
Jan
(7) |
Feb
(4) |
Mar
(4) |
Apr
(12) |
May
(6) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
|
Nov
(7) |
Dec
(5) |
2009 |
Jan
(3) |
Feb
(1) |
Mar
(6) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(16) |
Nov
|
Dec
|
2010 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
(3) |
Aug
(2) |
Sep
(3) |
Oct
|
Nov
(4) |
Dec
(16) |
2011 |
Jan
|
Feb
|
Mar
(10) |
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(5) |
Dec
(2) |
2012 |
Jan
(9) |
Feb
(6) |
Mar
(1) |
Apr
(1) |
May
(5) |
Jun
(14) |
Jul
|
Aug
(9) |
Sep
(2) |
Oct
|
Nov
(4) |
Dec
(14) |
2013 |
Jan
(4) |
Feb
(1) |
Mar
(3) |
Apr
(5) |
May
(8) |
Jun
(1) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
(12) |
Nov
(8) |
Dec
(1) |
2014 |
Jan
(2) |
Feb
|
Mar
(3) |
Apr
(9) |
May
(1) |
Jun
(9) |
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(2) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
(3) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(10) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
From: Bruce K. <bk...@gn...> - 2012-12-27 22:53:48
|
GNU AutoGen/AutoOpts is a two-part project that serves two separate purposes. The two parts are combined because they are inextricably intertwined: AutoGen is a tool designed to simplify the creation and maintenance of programs that contain large amounts of repetitious text. It is especially valuable in programs that have several blocks of text that must be kept synchronized. AutoOpts is both an example of that and a project in its own right. It is a very powerful configuration file, environment variable and command line option documentation and management tool consisting of a set of AutoGen templates and a run time library that nearly eliminates the hassle of managing, parsing and documenting program options. The self-referential example: http://www.gnu.org/software/autogen/man1-autogen.html Subprojects: AutoGen contains several "subprojects" since it relies on them and arranging for their distribution ahead of time is painful. There are basically two: FSM - A finite state machine generator. It allows you to specify an fsm by specifying the states, the valid transitions and the actions to take for the valid transitions. The actions may be either function calls or switch/case elements. The processing may be step-and-return, process-until-done or reentrant. Further details can be seen in the leading comments of fsm.tpl. New in 5.17 - December, 2012 NEWS entries since the last release: * Bit Map and Enumeration templates are now fully integrated. They have their own section in the texi docs and the templates produce more easily used output. * Guile adjustments. Guile inserts /usr/local/lib into the LD_LIBRARY_PATH variable, causing problems when you are trying to run programs that use not-yet-installed libraries. LD_LIBRARY_PATH is now discarded. :( * The AG_TEST_GUILE_VERSION will now try "rpm -q" first before dpkg, "guile-config --verision" and "guile --version". * If a "min" count value has been specified, the emitted shell script option parsing code will now verify that the option appears that minimum number of times. AutoGen home: http://www.gnu.org/software/autogen/ primary ftp: ftp://ftp.gnu.org/gnu/autogen/rel5.17/ .tar.gz: ftp://ftp.gnu.org/gnu/autogen/rel5.17/autogen-5.17.tar.gz .tar.xz: ftp://ftp.gnu.org/gnu/autogen/rel5.17/autogen-5.17.tar.xz bug reports: autogen-users at the lists dot SourceForge net domain bug archive: http://sourceforge.net/mailarchive/forum.php?forum_name=autogen-users maintainer: Bruce Korb - bkorb at the usual GNU domain |
From: Manuel H <mo...@co...> - 2012-12-20 17:57:57
|
Hello Bruce! Thanks for the update! > > So my idea is to create a AutoGen template for AutoOpts, which allows > > the creation of shell-scripts (i will create the necessary template(s)). > > What do you think? Could such a template become part of AutoOpts? > > I still think this is the best solution, but someone other than me > will have to have the time to do it (a few 10's of hours). Well, i'll do it. I'm thinking of github.com as the platform to share the AutoGen Shell Script template. I'll name the repository AutoShell or the like. I hope that's fine with you? Cheers, Manuel |
From: Bruce K. <bru...@gm...> - 2012-12-17 18:29:15
|
On 12/15/12 03:37, Manuel H wrote: > Hello Bruce! > > Thanks for your kind answer and the tip which C-file to edit. You're welcome. > Unfortunately i'm not very comfortable with C at the time of writing OK, I spent a couple of hours at it this weekend. (Expected 1, took 2.) Please give http://autogen.sourceforge.net/data/autogen-5.17.0pre11.tar.xz a spin. It validates the min/max occurrences. "must-set", by the way, is intended to ensure that a setting (option) has been set either on the command line or in a config file, whereas "min = 1" says it has to be on the command line. Shell scripts should not be making such a distinction, so I think you want "min = 1" in your def file. In any event, for a shell script, "must-set" now implies a min of 1 when min is unspecified or even specified as 0 (zero). > So my idea is to create a AutoGen template for AutoOpts, which allows > the creation of shell-scripts (i will create the necessary template(s)). > What do you think? Could such a template become part of AutoOpts? I still think this is the best solution, but someone other than me will have to have the time to do it (a few 10's of hours). Cheers - Bruce |
From: Bruce K. <bru...@gm...> - 2012-12-16 13:48:57
|
Hi Manuel, On Sat, Dec 15, 2012 at 3:37 AM, Manuel H <mo...@co...> wrote: > Hello Bruce! > > Thanks for your kind answer and the tip which C-file to edit. > Unfortunately i'm not very comfortable with C at the time of writing > this. Also, i feel it complicates things when i have to create a binary > which creates my shell-script for checking the arguments. (My goal is to > use AutoOpts for argument checking of shell scripts.) > > So my idea is to create a AutoGen template for AutoOpts, which allows > the creation of shell-scripts (i will create the necessary template(s)). > What do you think? Could such a template become part of AutoOpts? Definitely. I'd probably obsolete the "makeshell" code, in fact. I think it is a better approach, but 14 years ago "makeshell.c" seemed easier. :) |
From: Manuel H <mo...@co...> - 2012-12-15 11:38:13
|
Hello Bruce! Thanks for your kind answer and the tip which C-file to edit. Unfortunately i'm not very comfortable with C at the time of writing this. Also, i feel it complicates things when i have to create a binary which creates my shell-script for checking the arguments. (My goal is to use AutoOpts for argument checking of shell scripts.) So my idea is to create a AutoGen template for AutoOpts, which allows the creation of shell-scripts (i will create the necessary template(s)). What do you think? Could such a template become part of AutoOpts? All the best, -Manuel |
From: Bruce K. <bru...@gm...> - 2012-12-14 22:06:37
|
Hi Manuel, > I want to use AutoOpts for Shell script generation, and in previous > letters Bruce already introduced me on how to compile the def-file so a > shell script is created. Bruce has forgotten which flavor, since you can either produce shell script or a binary option processing "partner", a la: opts=`${0}-opts ${1+"$@"}` eval "$opts" case "X${OPTION_CT}" in X ) exit 1 ;; X0 ) : ;; * ) shift ${OPTION_CT} ;; esac or source or auto-edit in the generated script: . ${0}-opts.sh ${1+"$@"} > Now i want to to modify the shell script found at > https://github.com/codeless/MyRex/blob/master/myrex.sh to use AutoOpts. > Several parameters for this script are forced, but this doesn't seem to > work with AutoOpts. For instance: > > flag = { > name = sqlfile; > descrip = "SQL file to be executed"; > arg-type = file; > must-set = true; > } > > I want AutoOpts to check for the parameter "sqlfile", which has to be > set and should be checked if it's a valid (existing) file. How to > achieve this? Is it possible with AutoOpts for Shell-Scripts? That is done with a companion binary, but I don't know if I did that for the emitted shell script. It would be reasonable to check the minimum count/must-set status and emit appropriate code. I am certain I haven't done it for "must-set", I might have for "min = 1". "must-set" is only 6 or 7 years old. > Further on, i want to force the user to pass a directory-path to the > script (not as flag); i used: > > argument = file; > > Is this the way to go? That is the way to go. Is it actually implemented? That is a completely different question. Since "file" arguments are something from the last few years and I haven't done much with shell script stuff for close to a decade, (Parts of makeshell.c file havn't been touched in 14 years. :) I'm pretty sure that no verifications get inserted into the script. If you are willing and able to have a binary option parser program, you'd get more consistency and easier support. Otherwise, for fastest support, you'd be most welcome to fiddle the code in autoopts/makeshell.c and the various strings it uses in autoopts/ao-strs.def. > Thanks for any help!! I'd be thanking -you-! :) Cheers - Bruc |
From: Manuel H <mo...@co...> - 2012-12-10 08:36:34
|
Hello AutoGen lovers! I want to use AutoOpts for Shell script generation, and in previous letters Bruce already introduced me on how to compile the def-file so a shell script is created. Now i want to to modify the shell script found at https://github.com/codeless/MyRex/blob/master/myrex.sh to use AutoOpts. Several parameters for this script are forced, but this doesn't seem to work with AutoOpts. For instance: flag = { name = sqlfile; descrip = "SQL file to be executed"; arg-type = file; must-set = true; } I want AutoOpts to check for the parameter "sqlfile", which has to be set and should be checked if it's a valid (existing) file. How to achieve this? Is it possible with AutoOpts for Shell-Scripts? Further on, i want to force the user to pass a directory-path to the script (not as flag); i used: argument = file; Is this the way to go? Thanks for any help!! -Manuel |
From: Nikos M. <nm...@gn...> - 2012-11-26 08:36:31
|
On 11/26/2012 01:12 AM, Bruce Korb wrote: > The whole machination is about not having to know if you are printing > a format for a long option, a short option, an option without hyphen > introductions or options in GNU format or in the more elaborate > "autoopts native" format. (This is allowed when all command line > arguments must be options.) So "pzOptFmt" will point to one of these: [...] > So there needs to be some windows only code that checks the value of > "pAT->pzOptFmt": > #ifdef WINDOWS > if (pAT->pzOptFmt == zGnuOptFmt) > snprintf(z, sizeof(z), "--%s%s", pOD->pz_Name, pzArgType); > else if (pAT->pzOptFmt == zGnuOptFmt + 2) > snprintf(z, sizeof(z), "%s%s", pOD->pz_Name, pzArgType); > else > #endif It works perfectly, thank you. To work I replaced #ifdef WINDOWS with #ifdef _WIN32. regards, Nikos |
From: Bruce K. <bru...@gm...> - 2012-11-26 00:13:04
|
On 11/25/12 14:51, Nikos Mavrogiannopoulos wrote: > Hello, > I noticed that in windows the help string of my program is something like: > -v, --$s$s Output version information and exit > -h, --$s$s Display extended usage information and exit > > The offending code seems to be the string "--%2$s%1$s\0" in usage-txt.h > and the 2$ and 1$ operators. I couldn't quite get the logic in order to > simplify it, but if it could be avoided it would fix the --help option > on that system. Nope. It isn't in autogen's library where this happens. It is in "print_one_usage()": static void prt_one_usage(tOptions * pOptions, tOptDesc * pOD, arg_types_t * pAT) { prt_preamble(pOptions, pOD, pAT); [...] snprintf(z, sizeof(z), pAT->pzOptFmt, pzArgType, pOD->pz_Name, (pOD->optMinCt != 0) ? pAT->pzReq : pAT->pzOpt); fprintf(option_usage_fp, line_fmt_buf, z, pOD->pzText); The whole machination is about not having to know if you are printing a format for a long option, a short option, an option without hyphen introductions or options in GNU format or in the more elaborate "autoopts native" format. (This is allowed when all command line arguments must be options.) So "pzOptFmt" will point to one of these: "%s" "--%2$s%1$s" "%2$s%1$s" " %3s %s" " %3s %-14s %s" So there needs to be some windows only code that checks the value of "pAT->pzOptFmt": #ifdef WINDOWS if (pAT->pzOptFmt == zGnuOptFmt) snprintf(z, sizeof(z), "--%s%s", pOD->pz_Name, pzArgType); else if (pAT->pzOptFmt == zGnuOptFmt + 2) snprintf(z, sizeof(z), "%s%s", pOD->pz_Name, pzArgType); else #endif snprintf(z, sizeof(z), pAT->pzOptFmt, pzArgType, pOD->pz_Name, (pOD->optMinCt != 0) ? pAT->pzReq : pAT->pzOpt); Ick. If you confirm the hack, I'll put it out for the next release. |
From: Bruce K. <bru...@gm...> - 2012-11-25 23:33:19
|
On 11/25/12 14:54, Nikos Mavrogiannopoulos wrote: > Hello, > I noticed that in windows the help string of my program is something like: > -v, --$s$s Output version information and exit > -h, --$s$s Display extended usage information and exit > > The offending code seems to be the string "--%2$s%1$s\0" in usage-txt.h > and the 2$ and 1$ operators. I couldn't quite get the logic in order to > simplify it, but if it could be avoided it would fix the --help option > on that system. I'll look. I am supposed to be using an internal printf library that would correctly handle the argument indexes. Obviously, whatever printf library is in use is off in la-la land somewhere. It ought to either error out or do the right thing. Windows. I'm not really surprised. Oh, if you would, please: autogen --trace=everything --trace-out=/tmp/something ..... and email that, along with the .c file, I could chase it down more readily. Thanks! - Bruce |
From: Nikos M. <nm...@gn...> - 2012-11-25 22:51:28
|
Hello, I noticed that in windows the help string of my program is something like: -v, --$s$s Output version information and exit -h, --$s$s Display extended usage information and exit The offending code seems to be the string "--%2$s%1$s\0" in usage-txt.h and the 2$ and 1$ operators. I couldn't quite get the logic in order to simplify it, but if it could be avoided it would fix the --help option on that system. regards, Nikos |
From: Bruce K. <bru...@gm...> - 2012-09-04 15:06:16
|
On 09/04/12 02:37, Simon Josefsson wrote: > Hi. I'm having problems building 5.16.2. Ideas? Hi Simon, Yes, a pretty good idea: > make[3]: Entering directory `/home/jas/src/autogen-5.16.2/agen5' > gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I.. -I../autoopts -pthread -I/usr/include/guile/2.0 -g -O2 -MT autogen-ag.o -MD -MP -MF .deps/autogen-ag.Tpo -c -o autogen-ag.o `test -f 'ag.c' || echo './'`ag.c > In file included from ag.c:8:0: > autogen.h:32:19: error: operator '<' has no left operand > In file included from autogen.h:40:0, > from ag.c:8: > expr.h:28:19: error: operator '>=' has no left operand > expr.h:31:23: fatal error: guile/gh.h: No such file or directory http://lists.gnu.org/archive/html/guile-devel/2012-08/msg00042.html Apparently, guile.m4 expects that anybody using it ought to have read and understood all the contained comments: >>> configure.ac:140: the top level >>> configure:14130: error: possibly undefined macro: AC_LIB_LINKFLAGS_FROM_LIBS >>> If this token and others are legitimate, please use m4_pattern_allow. >>> See the Autoconf documentation. >>> bootstrap failure: trapped exit signal >>> mk-all: line 197: 5702 Killed > > As the comment says: > > dnl AC_LIB_LINKFLAGS_FROM_LIBS is defined in gnulib/m4/lib-link.m4 and needs > dnl the file gnulib/build-aux/config.rpath. > > This means that these two files have to be imported in[to] your project for > this to work. In other words, using guile.m4 requires using gnulib. I was "lucky" in that it worked in my environment. I think the correct fix is going to be to scrap the guile.m4 file. Not because I want to duplicate their code myself, but because autogen still has glitches that cause gnulib usage to fail, meaning config.rpath is out. Besides, 50% of my build time is involved in running configure and configure takes twice as long using gnulib, so it isn't clear I even want to wholesale import gnulib. Anyway, thank you for prodding me on this issue. I'll try to rip it out next weekend. Regards, Bruce |
From: Simon J. <si...@jo...> - 2012-09-04 09:52:40
|
Hi. I'm having problems building 5.16.2. Ideas? There was an error from 'expr' during ./configure, maybe it is related? /Simon make[3]: Entering directory `/home/jas/src/autogen-5.16.2/agen5' gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I.. -I../autoopts -pthread -I/usr/include/guile/2.0 -g -O2 -MT autogen-ag.o -MD -MP -MF .deps/autogen-ag.Tpo -c -o autogen-ag.o `test -f 'ag.c' || echo './'`ag.c In file included from ag.c:8:0: autogen.h:32:19: error: operator '<' has no left operand In file included from autogen.h:40:0, from ag.c:8: expr.h:28:19: error: operator '>=' has no left operand expr.h:31:23: fatal error: guile/gh.h: No such file or directory compilation terminated. make[3]: *** [autogen-ag.o] Error 1 checking whether with-libguile was specified... no checking whether with-libguile-cflags was specified... no checking whether with-libguile-libs was specified... no configure: guile-config used for CFLAGS: -pthread -I/usr/include/guile/2.0 configure: guile-config used for LIBS: -lguile-2.0 -lgc checking whether libguile can be linked with... yes checking whether the guile version... 2.0.5-deb+1-1 expr: non-integer argument checking whether with-libxml2 was specified... no |
From: Manuel H <mo...@co...> - 2012-08-21 04:32:15
|
Hello! My first public project that uses AutoGen for PHP Code Generation is done. Please have a look at the github repository: https://github.com/codeless/logmore Also, this project was posted on packagist.org, a PHP package manager: http://packagist.org/packages/codeless/logmore The AutoGen templates can be found in the buildsrc/ directory. |
From: Manuel H <mo...@co...> - 2012-08-14 07:00:38
|
Hello Bruce! Thank you for the hot tip; the installation worked very well using ./configure --disable-shared Too, i spotted the failure in my tries to compile the AutoOpts-C-File: to correctly link the libopts inside a Makefile, i had to use the dollar character twice, like: cc -o gen-joiner-opts -DTEST_JOINER_OPTS joiner-opts.c $$( \ autoopts-config cflags ldflags) |
From: Bruce K. <bk...@gn...> - 2012-08-13 19:11:45
|
Hi, It's that detestable dynamic linking junk. Type this: $ ldd $(which autogen) and you'll see which libopts the thing is trying to link against. The binary is supposed to have been relinked with -Wl,-rpath -Wl,/path/to/lib and, thus, load the correct library. Like this: libtool: link: /usr/bin/gcc -std=gnu99 -pthread -I/usr/local/include/guile/2.0 -ggdb3 -Wall -Werror -Wcast-align -Wmissing-prototypes -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings -Wno-format-contains-nul -fno-strict-aliasing -Wstrict-aliasing=2 -o .libs/autogen autogen-ag.o -Wl,--export-dynamic ../autoopts/.libs/libopts.so ../snprintfv/.libs/libsnprintfv.a -L/usr/local/lib64 /usr/local/lib64/libguile-2.0.so -lffi -lrt -lunistring -lgmp /usr/local/lib64/libltdl.so -lcrypt -lgc -lm -ldl -pthread -Wl,-rpath -Wl,/usr/local/lib64 make[3]: Entering directory `/old-home/bkorb/ag/ag/agen5' /bin/sh ../libtool --mode=install /usr/bin/install -c autogen '/usr/local/bin' libtool: install: /usr/bin/install -c .libs/autogen /usr/local/bin/autogen and the ldd yields: $ ldd $(which autogen) linux-vdso.so.1 => (0x00007fffdd3ff000) libopts.so.25 => /usr/local/lib64/libopts.so.25 (0x00007f9a71ed4000) [......] There is also an interesting "got'cha" introduced with recent autoconfs -- please notice the library directory: "lib64" This is new behavior. Make sure that /etc/ld.so.conf references the correct directories and prefers the more explicit (lib64) over the platform generic (lib). Otherwise, build the thing with ./configure --disable-shared Shared libraries are for folks that build distributions. For everyone else, they are too flaky. On Mon, Aug 13, 2012 at 11:38 AM, Manuel H <mo...@co...> wrote: > Hello! > > Under my Ubuntu 10.04 system i have encountered the following error > after successfully installing the newest AutoGen, by simply running: > > autogen -v > > on the shell. The output: > > Automated Options Processing Error! > autogen called AutoOpts function with structure version 36:0:5. > This exceeds the compiled library version: |
From: Manuel H <mo...@co...> - 2012-08-13 18:39:02
|
Hello! Under my Ubuntu 10.04 system i have encountered the following error after successfully installing the newest AutoGen, by simply running: autogen -v on the shell. The output: Automated Options Processing Error! autogen called AutoOpts function with structure version 36:0:5. This exceeds the compiled library version: |
From: Bruce K. <bk...@gn...> - 2012-08-11 17:21:15
|
GNU AutoGen/AutoOpts is a two-part project that serves two separate purposes. The two parts are combined because they are inextricably intertwined: AutoGen is a tool designed to simplify the creation and maintenance of programs that contain large amounts of repetitious text. It is especially valuable in programs that have several blocks of text that must be kept synchronized. AutoOpts is both an example of that and a project in its own right. It is a very powerful configuration file, environment variable and command line option documentation and management tool consisting of a set of AutoGen templates and a run time library that nearly eliminates the hassle of managing, parsing and documenting program options. The self-referential example: http://www.gnu.org/software/autogen/man1-autogen.html New in 5.16.2 - August, 2012 NEWS entries since the last release: * Coverity cleanups * evade Guile issue on BSD platform. * avoid emitting non-error messages to stderr * Many improvements in markup conversions between mdoc, man page and texinfo documentation. (This enables the same text to be used in all three output formats.) AutoGen home: http://www.gnu.org/software/autogen/ primary ftp: ftp://ftp.gnu.org/gnu/autogen/rel5.16.2/ .tar.gz: ftp://ftp.gnu.org/gnu/autogen/rel5.16.2/autogen-5.16.2.tar.gz .tar.xz: ftp://ftp.gnu.org/gnu/autogen/rel5.16.2/autogen-5.16.2.tar.xz bug reports: autogen-users at the lists dot SourceForge net domain bug archive: http://sourceforge.net/mailarchive/forum.php?forum_name=autogen-users maintainer: Bruce Korb - bkorb at the usual GNU domain |
From: Bruce K. <bru...@gm...> - 2012-08-09 14:41:17
|
On 08/08/12 23:39, Manuel H wrote: > Hello! > > Currently i'm struggling with creating a portable shell-script out of my > options-definition file. Here is my options.def file: > > [...] > > When calling autogen with my definitions-file as only option, AutoGen > should write the generated shell script to standard output -- if i > interpret the text in the first paragraph of chapter 7.12.2 of the > AutoGen manual correctly. > > My second attempt was to use getdefs, but this will result in an error: > > getdefs input=options.def "getdefs" is for extracting special markup comments into autogen definitions. Your "options.def" file is already in autogen definitions format. So, no, that won't work. WRT creating a shell script to parse options, perhaps it isn't clear enough. You must go through several steps: 1. generate C source 2. compile a program that emits the shell script 3. run that program 4. incorporate the resulting output into your script. That would be: $ autogen joiner-opts.def # NOTE: do not use options.def as "options.h" conflicts # note to self: fix this $ cc -o gen-joiner-opts -DTEST_JOINER_OPTS joiner-opts.c $( autoopts-config cflags ldflags) $ ./gen-joiner-opts -o joiner-opts.sh $ cat joiner-opts.sh #! /bin/bash # # # # # # # # # # -- do not modify this marker -- # # DO NOT EDIT THIS SECTION OF joiner-opts.sh # # From here to the next `-- do not modify this marker --', # the text has been generated Thursday August 9, 2012 at 07:34:59 AM PDT # From the JOINER option definitions # JOINER_LONGUSAGE_TEXT='joiner - File joiner USAGE: joiner [ <option-name>[{=| }<val>] ]... Arg Option-Name Description Fil basefile The basefile... no help Display extended usage information and exit All arguments are named options.' JOINER_USAGE_TEXT='joiner - File joiner USAGE: joiner [ <option-name>[{=| }<val>] ]... Arg Option-Name Description Fil basefile The basefile... no help Display extended usage information and exit All arguments are named options.' JOINER_BASEFILE=${JOINER_BASEFILE} JOINER_BASEFILE_set=false export JOINER_BASEFILE OPT_ARG=$1 while [ $# -gt 0 ] do OPT_ELEMENT='' OPT_ARG_VAL='' OPT_ARG=${1} OPT_CODE=`echo "X${OPT_ARG}"|sed 's/^X-*//'` shift OPT_ARG=$1 case "${OPT_CODE}" in *=* ) OPT_ARG_VAL=`echo "${OPT_CODE}"|sed 's/^[^=]*=//'` OPT_CODE=`echo "${OPT_CODE}"|sed 's/=.*$//'` ;; esac case "${OPT_CODE}" in 'ba' | \ 'bas' | \ 'base' | \ 'basef' | \ 'basefi' | \ 'basefil' | \ 'basefile' ) if [ -n "${JOINER_BASEFILE}" ] && ${JOINER_BASEFILE_set} ; then echo Error: duplicate BASEFILE option >&2 echo "$JOINER_USAGE_TEXT" exit 1 ; fi JOINER_BASEFILE_set=true OPT_NAME='BASEFILE' OPT_ARG_NEEDED=YES ;; 'he' | \ 'hel' | \ 'help' ) echo "$JOINER_LONGUSAGE_TEXT" exit 0 ;; [....] |
From: Manuel H <mo...@co...> - 2012-08-09 06:39:23
|
Hello! Currently i'm struggling with creating a portable shell-script out of my options-definition file. Here is my options.def file: *** AutoGen Definitions options; prog-name = "joiner"; prog-title = "File joiner"; main = { main-type = shell-parser; test-main = optionParseShell; }; flag = { name = basefile; arg-type = file; max = 1; descrip = "The basefile..."; }; *** When calling autogen with my definitions-file as only option, AutoGen should write the generated shell script to standard output -- if i interpret the text in the first paragraph of chapter 7.12.2 of the AutoGen manual correctly. My second attempt was to use getdefs, but this will result in an error: getdefs input=options.def Thank you for any hints in advance! -Manuel P.S.: I'm using AutoGen 5.10 |
From: Bruce K. <bru...@gm...> - 2012-08-03 14:50:27
|
Hi Manuel, On Thu, Aug 2, 2012 at 11:28 PM, Manuel H <mo...@co...> wrote: > > This is my first post on the list, Welcome! > But my current main problem is that i seem unable to loop through > definitions. I would be glad for any help on this. My XML definitions > are: xml2ag -O joomla.def joomla.xml yields: /* Parsing file joomla.xml */ AutoGen Definitions joomla-2.5.6.tpl; XML-version = '1.0'; XML-URL = 'joomla.xml'; XML-standalone = true; template = 'joomla-2.5.6.tpl'; defaults = { content = ''; language = 'en-GB'; category = { content = ''; status = 'published'; }; }; categories = { content = ''; category = { content = ''; title = 'News'; text = 'Description'; category = { content = ''; title = 'Media'; }; }; category = { content = ''; title = 'Internals'; text = 'Description'; }; }; > My Template is: > > [+ AutoGen5 template sql +] > [+ (get "template") +] > [+ (get "defaults.language") +] > [+ IF (len "categories") >= 1 +] > [+ # Loop through categories +] > [+ # FOR categories.category +] > [+ # FOR categories.category (for-from 0) (for-to (len > "categories.category")) +] > [+ FOR categories.category (for-from 0) (for-to 2) +] http://www.gnu.org/software/autogen/manual/html_node/AGMacro-syntax.html#AGMacro-syntax says: 2. AutoGen FOR macros must be in one of three forms: FOR <name> [ <separator-string> ] FOR <name> (...Scheme expression list) FOR <name> IN <string-entry> [ ... ] where: ‘<name>’ must be a simple name. In other words, you cannot use categories.category. Instead, just use nested invocations of the first form: [+ FOR categories +][+ FOR category +] ... [+ENDFOR+][+ENDFOR+] Also, the conditional ``[+ IF (len "categories") >= 1 +]'' is both unnecessary and incorrect. The FOR won't iterate over categories if there aren't any. The correct spelling is: [+ IF (>= (len "categories") 1) +] It has to be a valid Guile/scheme expression. > [+ categories.category.title +] If you are wanting the title for the current category, lose the name qualifications. The search for this three part name will fail at the current ("category") level, try and fail at the "categories" level and succeed at the top level. > [+ ENDFOR categories.category +] > [+ ENDIF +] > Thank you in advance! You're welcome. Good luck! Cheers - Bruce P.S. using another variant of the template: $ cat joomla-2.5.6.tpl ; autogen joomla.def;cat joomla.sql [+ AutoGen5 template sql +] [+ (get "template") +] [+ (get "defaults.language") +] [+ FOR categories \+] [+ FOR category \+] [+ title +] [+ ENDFOR \+] [+ ENDFOR categories +] joomla-2.5.6.tpl en-GB News Internals |
From: Manuel H <mo...@co...> - 2012-08-03 06:28:25
|
Hello! This is my first post on the list, so i want to give a short introduction on myself: i'm a software developer from Austria, mostly working on Web-Applications. My first contact with AutoGen was whilst devloping a TCL-Application, about one year ago. Since then i continued to use this package on and on and am slowly discovering the benefits of AutoOpts! My current aim is to create an (unofficial) SQL-generator for the Joomla!-CMS-project. For this, i'm using xml2ag (AutoGen 5.10 on Ubuntu 10) and discovered, that xml2ag probably hangs up when called without any arguments. But my current main problem is that i seem unable to loop through definitions. I would be glad for any help on this. My XML definitions are: <website template="joomla-2.5.6.tpl"> <defaults language="en-GB"> <category status="published"></category> </defaults> <categories> <category title="News"> Description <category title="Media"></category> </category> <category title="Internals"> Description </category> </categories> </website> My Template is: [+ AutoGen5 template sql +] [+ (get "template") +] [+ (get "defaults.language") +] [+ IF (len "categories") >= 1 +] [+ # Loop through categories +] [+ # FOR categories.category +] [+ # FOR categories.category (for-from 0) (for-to (len "categories.category")) +] [+ FOR categories.category (for-from 0) (for-to 2) +] [+ categories.category.title +] [+ ENDFOR categories.category +] [+ ENDIF +] Now the problem is that the template doesn't seem to loop through all defined categories. Not the nested category-definition is the problem -- i tried it already. Please help me with what i've missed! Thank you in advance! -Manuel |
From: Harlan S. <st...@nt...> - 2012-06-18 22:31:21
|
Bruce wrote: > I've found the problem: It exists in an atrophied section of code > for Guile 1.6 only code. I've fixed it in my source now. > Since I don't have access to any platform with 6 year old Guile, > I have to depend on others to alert me during the "pre" release phase. > Guile 1.8 was released in 2006 and 1.7 before that. > > To be clear: Guile 1.4 is now utterly de-supported. > I'd like to be rid of 1.6, too. I'm happy to try this - my hesitation is that my experience with updating some of these packages under Solaris is a must miserable experience. But if you want I'l give it a shot. H |
From: Bruce K. <bru...@gm...> - 2012-06-18 20:56:10
|
On 06/18/12 11:22, Bruce Korb wrote: > > I have not seen Harlan's message about zNotStr, > so I don't know what the issue is. I've found the problem: It exists in an atrophied section of code for Guile 1.6 only code. I've fixed it in my source now. Since I don't have access to any platform with 6 year old Guile, I have to depend on others to alert me during the "pre" release phase. Guile 1.8 was released in 2006 and 1.7 before that. To be clear: Guile 1.4 is now utterly de-supported. I'd like to be rid of 1.6, too. |
From: Bruce K. <bru...@gm...> - 2012-06-18 19:04:27
|
On 06/18/12 10:57, Dave Hart wrote: So curiosity got the better of me. Here is code from glibc: > /* Find the first occurrence of C in S. */ > char * > strchr (s, c_in) > const char *s; > int c_in; > { > const unsigned char *char_ptr; > const unsigned long int *longword_ptr; > unsigned long int longword, magic_bits, charmask; > unsigned reg_char c; > > c = (unsigned char) c_in; > > /* Handle the first few characters by reading one character at a time. > Do this until CHAR_PTR is aligned on a longword boundary. */ > for (char_ptr = (const unsigned char *) s; > ((unsigned long int) char_ptr & (sizeof (longword) - 1)) != 0; > ++char_ptr) > if (*char_ptr == c) > return (void *) char_ptr; Please notice the last line. The cast is being used to strip the const-ness from "char_ptr". This is not really different from stripping it from the argument. |