[Toxine-cvs] CVS: toxine/src mangen.c,NONE,1.1 Makefile.am,1.1.1.1,1.2 commands.c,1.11,1.12 main.c,1
Brought to you by:
f1rmb
From: Daniel Caujolle-B. <f1...@us...> - 2002-07-04 15:56:08
|
Update of /cvsroot/toxine/toxine/src In directory usw-pr-cvs1:/tmp/cvs-serv21693/src Modified Files: Makefile.am commands.c main.c xine_commands.h Added Files: mangen.c Log Message: Add man page (first draft). mangen.c generate the commands man entries. --- NEW FILE: mangen.c --- /* ** Copyright (C) 2002 Daniel Caujolle-Bert <seg...@cl...> ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdio.h> #include <stdlib.h> #include "common.h" #include "commands.c" /* * */ static char *string_cleanup(char *str) { static char buffer[16384]; char *s, *d; int no_br = 0; memset(&buffer, 0, sizeof(buffer)); s = str; d = &buffer[0]; while(*s != '\0') { switch(*s) { case '\n': if(!no_br) { *d++ = '\n'; *d++ = '.'; *d++ = 'b'; *d++ = 'r'; *d++ = '\n'; *d++ = '\\'; *d++ = ' '; *d++ = '\\'; *d++ = ' '; } break; case '[': no_br = 1; *d++ = '['; break; case ']': no_br = 0; *d++ = ']'; break; case 'µ': *d++ = 'u'; break; default: *d++ = *s; break; } s++; } *d = '\0'; return buffer; } /* * */ int main(int argc, char **argv) { int i = 0; while(commands[i].command != NULL) { printf(".TP\n"); printf(".BR %s\n", (string_cleanup(commands[i].command))); printf(".br\n"); if(commands[i].help) { printf(".BR action:\n.br\n"); printf("%s\n", (string_cleanup(commands[i].help))); printf(".br\n\n"); } if(commands[i].syntax) { printf(".BR syntax:\n.br\n"); printf("\\ \\ %s\n", (string_cleanup(commands[i].syntax))); printf(".br\n"); } printf(".br\n"); i++; } printf(".br\n"); return 1; } Index: Makefile.am =================================================================== RCS file: /cvsroot/toxine/toxine/src/Makefile.am,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile.am 13 May 2002 20:46:36 -0000 1.1.1.1 +++ Makefile.am 4 Jul 2002 15:56:05 -0000 1.2 @@ -4,6 +4,7 @@ CFLAGS = @GLOBAL_CFLAGS@ @XINE_CFLAGS@ bin_PROGRAMS = toxine +EXTRA_PROGRAMS = mangen EXTRA_DIST = getopt.c getopt1.c getopt.h @@ -17,10 +18,14 @@ toxine_DEPENDENTIES = toxine_LDADD = $(TERMCAP_LIB) $(top_builddir)/readline/libreadline.la @XINE_LIBS@ $(DYNAMIC_LD_LIBS) -lm +mangen_SOURCES = $(GETOPT_C) mangen.c utils.c parse.c xine_commands.c loader.c script.c +mangen_LDADD = $(TERMCAP_LIB) $(top_builddir)/readline/libreadline.la @XINE_LIBS@ $(DYNAMIC_LD_LIBS) -lm + noinst_HEADERS = common.h utils.h commands.h parse.h xine_commands.h loader.h script.h $(top_builddir)/readline/libreadline.la: cd $(top_builddir)/readline && $(MAKE) libreadline.la + debug: @$(MAKE) CFLAGS="$(DEBUG_CFLAGS)" Index: commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/commands.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- commands.c 3 Jul 2002 12:12:22 -0000 1.11 +++ commands.c 4 Jul 2002 15:56:05 -0000 1.12 @@ -148,7 +148,7 @@ "set audio volume <level>\n" "set audio mute\n" "set audio volume <level>\n" - "set interative <yes|no|1|0|true|false>\n" + "set interative [yes | no | 1 | 0 | true | false]\n" "set mrl <mrl>" }, { "get", OPTIONAL_ARGS, do_get, @@ -221,7 +221,7 @@ " INPUT_ANGLE_NEXT | INPUT_ANGLE_PREVIOUS | SPU_FORCEDISPLAY |\n" " FRAME_CHANGE | CLOSED_CAPTION | FOREVER | NOTHING ]\n" "waitfor status [ PLAY | STOP | QUIT | PAUSE | SLOW_4 | SLOW_2 | NORMAL |\n" - " FAST_2 | FAST_4", + " FAST_2 | FAST_4]", }, /* Some event aliases */ { "menu1", NO_ARGS, do_events, Index: main.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/main.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- main.c 30 Jun 2002 15:38:54 -0000 1.4 +++ main.c 4 Jul 2002 15:56:05 -0000 1.5 @@ -82,13 +82,14 @@ printf("usage: toxine [options]\n"); printf(" -s, --script <filename> Use <filename> as toxine script file.\n"); - printf(" -e, --execute <commands> Execute commands specified (like in prompt mode).\n"); - printf(" -o, --output [filename] Save all messages in a file (toxine.out if no filename\n"); + printf(" -e, --execute <commands> Execute specified commands (like in prompt mode).\n"); + printf(" -o, --output [filename] Save all messages in a file(*).\n"); + printf(" *('toxine.out' if filename isn't specified).\n"); printf(" -V, --video <name> Use video driver <name>.\n"); printf(" -A, --audio <name> Use audio driver <name>.\n"); printf(" -i, --interactive Disable interactive more (no confirm).\n"); - printf(" -I, --autoinit Init xine engine on start.\n"); - printf(" *NOTE: video/audio driver names should be sets.\n"); + printf(" -I, --autoinit Init xine engine on start(*).\n"); + printf(" *(video/audio driver names should be sets).\n"); printf(" -v, --version Display version.\n"); printf(" -h, --help Display this help text.\n"); printf("\n"); Index: xine_commands.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/xine_commands.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- xine_commands.h 13 May 2002 20:46:36 -0000 1.1.1.1 +++ xine_commands.h 4 Jul 2002 15:56:05 -0000 1.2 @@ -129,8 +129,8 @@ { "xine_set_speed", REQUIRE_ARGS, _xine_set_speed, \ "Set playback speed.", \ "xine_set_speed <value>\n" \ - "xine_set_speed <constant name> (SPEED_PAUSE, SPEED_SLOW_4, SPEED_SLOW_2\n" \ - " SPEED_NORMAL, SPEED_FAST_2 , SPEED_FAST_4" \ + "xine_set_speed <constant name> [SPEED_PAUSE | SPEED_SLOW_4 | SPEED_SLOW_2 |\n" \ + " SPEED_NORMAL | SPEED_FAST_2 | SPEED_FAST_4]" \ }, \ { "xine_get_speed", NO_ARGS, _xine_get_speed, \ "Get current playback speed.", \ |