From b74bb6d406f711d5259f90861400aee2b74f7c2c Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Fri, 17 Apr 2009 21:52:30 +0300 Subject: Rename movie_play to powwow-movieplay. I am currently trying to get powwow included in Fedora. Thomas Sailer is reviewing the spec file and he has expressed some concerns about possible name clashes. More info at: https://bugzilla.redhat.com/show_bug.cgi?id=491566 diff --git a/.gitignore b/.gitignore index 01dbfc5..a79a089 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ depcomp follow install-sh missing -movie_play muc powwow powwow.6 +powwow-movieplay diff --git a/Makefile.am b/Makefile.am index 6f362d0..3fbcafb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ # Default help file directory AM_CFLAGS=-DPOWWOW_DIR=\"$(pkgdatadir)\" -DPLUGIN_DIR=\"$(plugindir)\" -bin_PROGRAMS = powwow muc movie_play +bin_PROGRAMS = powwow muc powwow-movieplay powwow_SOURCES = beam.c cmd.c log.c edit.c cmd2.c eval.c \ utils.c main.c tcp.c list.c map.c tty.c \ ptr.c @@ -11,7 +11,7 @@ powwow_HEADERS = beam.h cmd.h log.h edit.h cmd2.h eval.h \ utils.h main.h tcp.h list.h map.h tty.h \ ptr.h defines.h muc_SOURCES = muc.c -movie_play_SOURCES = movie_play.c +powwow_movieplay_SOURCES = powwow-movieplay.c noinst_PROGRAMS = catrw follow follow_SOURCES = follow.c diff --git a/movie_play.c b/movie_play.c deleted file mode 100644 index c095137..0000000 --- a/movie_play.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * movie_play.c -- replay powwow movies or convert them into ASCII - * - * This file is placed in the public domain. - */ - -#include -#include -#include -#include -#include -#include - -void millisec_sleep(msec) -long msec; -{ - struct timeval t; - t.tv_sec = msec / 1000; - t.tv_usec = (msec % 1000) * 1000; - select(0, NULL, NULL, NULL, &t); -} - -int main(argc, argv) -int argc; char *argv[]; -{ - FILE *infile, *outfile; - char buf[4096]; - int i, play = 0; - - if (strstr(argv[0], "movie_play")) - play = 1; - else if (!strstr(argv[0], "movie2ascii")) { - fprintf(stderr, "Please run this program as \"movie_play\" or \"movie2ascii\"\n"); - return 1; - } - - if (play) { - if (argc == 2) { - infile = fopen(argv[1], "rb"); - outfile = stdout; - if (infile == NULL) { - fprintf(stderr, "Error opening input file \"%s\"\n", argv[1]); - return 1; - } - } else { - infile = stdin; - outfile = stdout; - } - } else { - if (argc == 3) { - infile = fopen(argv[1], "rb"); - outfile = fopen(argv[2], "wb"); - if (infile == NULL) { - fprintf(stderr, "Error opening input file \"%s\"\n", argv[1]); - return 1; - } - if (outfile == NULL) { - fprintf(stderr, "Error opening output file \"%s\"\n", argv[2]); - return 1; - } - } else { - fprintf(stderr, "Usage: %s [infile [outfile]]\n", argv[0]); - return 1; - } - } - - while (fgets(buf, 4096, infile) != NULL) { - i = strlen(buf); - if (i > 0 && buf[i-1] == '\n') - buf[i-1] = '\0'; - if (!strncmp(buf, "sleep ", 6)) { - if (play) - millisec_sleep(atoi(buf + 6)); - } - else if (!strncmp(buf, "line ", 5)) - fprintf(outfile, "%s\n", buf + 5); - else if (!strncmp(buf, "prompt ", 7)) - fprintf(outfile, "%s", buf + 7); - else { - fprintf(stderr, "Syntax error in line:\n%s\n", buf); - return 1; - } - fflush(outfile); - } - if (feof(infile)) { - fprintf(outfile, "\n"); - return 0; - } else { - fprintf(stderr, "Error reading file\n"); - return 1; - } -} - diff --git a/powwow-movieplay.c b/powwow-movieplay.c new file mode 100644 index 0000000..3cddef9 --- /dev/null +++ b/powwow-movieplay.c @@ -0,0 +1,93 @@ +/* + * powwow-movieplay.c -- replay powwow movies or convert them into ASCII + * + * This file is placed in the public domain. + */ + +#include +#include +#include +#include +#include +#include + +void millisec_sleep(msec) +long msec; +{ + struct timeval t; + t.tv_sec = msec / 1000; + t.tv_usec = (msec % 1000) * 1000; + select(0, NULL, NULL, NULL, &t); +} + +int main(argc, argv) +int argc; char *argv[]; +{ + FILE *infile, *outfile; + char buf[4096]; + int i, play = 0; + + if (strstr(argv[0], "powwow-movieplay")) + play = 1; + else if (!strstr(argv[0], "powwow-movie2ascii")) { + fprintf(stderr, "Please run this program as \"powwow-movieplay\" or \"powwow-movie2ascii\"\n"); + return 1; + } + + if (play) { + if (argc == 2) { + infile = fopen(argv[1], "rb"); + outfile = stdout; + if (infile == NULL) { + fprintf(stderr, "Error opening input file \"%s\"\n", argv[1]); + return 1; + } + } else { + infile = stdin; + outfile = stdout; + } + } else { + if (argc == 3) { + infile = fopen(argv[1], "rb"); + outfile = fopen(argv[2], "wb"); + if (infile == NULL) { + fprintf(stderr, "Error opening input file \"%s\"\n", argv[1]); + return 1; + } + if (outfile == NULL) { + fprintf(stderr, "Error opening output file \"%s\"\n", argv[2]); + return 1; + } + } else { + fprintf(stderr, "Usage: %s [infile [outfile]]\n", argv[0]); + return 1; + } + } + + while (fgets(buf, 4096, infile) != NULL) { + i = strlen(buf); + if (i > 0 && buf[i-1] == '\n') + buf[i-1] = '\0'; + if (!strncmp(buf, "sleep ", 6)) { + if (play) + millisec_sleep(atoi(buf + 6)); + } + else if (!strncmp(buf, "line ", 5)) + fprintf(outfile, "%s\n", buf + 5); + else if (!strncmp(buf, "prompt ", 7)) + fprintf(outfile, "%s", buf + 7); + else { + fprintf(stderr, "Syntax error in line:\n%s\n", buf); + return 1; + } + fflush(outfile); + } + if (feof(infile)) { + fprintf(outfile, "\n"); + return 0; + } else { + fprintf(stderr, "Error reading file\n"); + return 1; + } +} + diff --git a/powwow.doc b/powwow.doc index acf2740..3c8e759 100644 --- a/powwow.doc +++ b/powwow.doc @@ -671,11 +671,11 @@ SPECIAL COMMANDS: ALL OTHERS This is similar to #capture, but adds timestamps to each line received from the main MUD connection or typed from the keyboard, to allow replay at correct speed. - The program `movie_play' for replay is included with powwow sources. - Usage: `movie_play ' - To convert a movie to plain ASCII, the program `movie2ascii' + The program `powwow-movieplay' for replay is included with powwow sources. + Usage: `powwow-movieplay ' + To convert a movie to plain ASCII, the program `powwow-movie2ascii' is included too. - Usage: `movie2ascii '. + Usage: `powwow-movie2ascii '. It is possible to capture in the #movie file even text that you have _already_ received: see #setvar buffer. -- cgit v0.10.2