2 Copyright (C) 2001-2002 Ben Kibbey <bjk@luxsci.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include <sys/types.h>
40 #ifdef _POSIX2_LINE_MAX
41 #define LINE_MAX _POSIX2_LINE_MAX
42 #elif defined(_POSIX_LINE_MAX)
43 #define LINE_MAX _POSIX_LINE_MAX
50 #define BACKSPACE '\010'
52 #define COPYRIGHT "Copyright (C) 2001-2002 " PACKAGE_BUGREPORT "\nDistributed under the terms of the GNU General Public License version 2."
54 #define LOADING "Loading %s, please wait..."
55 #define DETECT "could not detect file type for %s"
56 #define NOTAFILE "%s is not a regular file"
57 #define VINFO ("[ " PACKAGE_STRING " ]")
58 #define ERROR "[ ERROR ]"
59 #define NOTICE "[ NOTICE ]"
60 #define INFO "[ FRAME INFORMATION ]"
61 #define HELP "[ HELP ]"
64 #define GOTO "Goto frame: "
65 #define CHGSSTIMEOUT "Seconds: "
66 #define SSTIMEOUT "Seconds: "
68 #define ANYKEY "[ press any key to continue ]"
69 #define HELPTEXT "Press 'h' for help"
70 #define FATAL (message("[ FATAL ]", ANYKEY, "%s(%i): %s", __FILE__, \
71 __LINE__ - 1, strerror(errno)))
73 #define ARRCNT(x) (sizeof(x) / sizeof(x[0]))
74 #define CALCWIDTH(str) (strlen(str) + 4) /*
75 * 2 for box, 2 for padding
77 #define CALCHEIGHT() (4) /*
78 * 2 box, 2 padding, 1 prompt
80 #define CALCPOSY(y) ((y > LINES - 1) ? 0 : LINES / 2 - y / 2)
81 #define CALCPOSX(x) (COLS / 2 - x / 2)
82 #define CENTERX(x, str) (x / 2 - strlen(str) / 2)
84 typedef struct frames
{
89 typedef struct scenes
{
90 unsigned long frameid
;
92 unsigned long timepos
;
99 int message(const char *, const char *, const char *, ...);
100 void *Malloc(size_t);
101 void *Calloc(size_t num
, size_t size
);
102 char *sepfile(char *);
104 unsigned regexdelay
, maxx
, maxy
;
105 unsigned long frames
, delaylen
;