]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/i4b/isdntel/defs.h
This commit was generated by cvs2svn to compensate for changes in r52750,
[FreeBSD/FreeBSD.git] / usr.sbin / i4b / isdntel / defs.h
1 /*
2  * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23  * SUCH DAMAGE.
24  *
25  *---------------------------------------------------------------------------
26  *
27  *      isdntel - isdn4bsd telephone answering support
28  *      ==============================================
29  *
30  * $FreeBSD$ 
31  *
32  *      last edit-date: [Mon Apr 26 13:55:35 1999]
33  *
34  *----------------------------------------------------------------------------*/
35
36 #include <ncurses.h>
37 #include <stdio.h>
38 #include <signal.h>
39 #include <errno.h>
40 #include <string.h>
41 #include <stdlib.h>
42 #include <stdarg.h>
43 #include <unistd.h>
44 #include <fcntl.h>
45 #include <ctype.h>
46 #include <sys/time.h>
47 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
48 #include <dirent.h>
49 #else
50 #include <sys/dir.h>
51 #endif
52 #include <sys/param.h>
53
54 #include <machine/i4b_ioctl.h>
55
56 #define GOOD    0
57 #define ERROR   (-1)
58 #define WARNING (-2)
59
60 #define SPOOLDIR        "/var/isdn"
61 #define PLAYCMD         "cat %s | g711conv -a >/dev/audio"
62
63 /* reread timeout in seconds */
64
65 #define REREADTIMEOUT   60
66
67 /* window dimensions */
68
69 #define START_O         3       /* main window start  */
70
71 #define DAT_POS         0
72 #define TIM_POS         (DAT_POS+10)
73 #define DST_POS         (TIM_POS+8)
74 #define SRC_POS         (DST_POS+17)
75 #define ALI_POS         (SRC_POS+17)
76 #define SEC_POS         (ALI_POS+21)
77 #define LAST_POS        (SEC_POS+5)
78
79 /* fullscreen mode menu window */
80
81 #define WMITEMS         5               /* no of items */
82 #define WMENU_LEN       18              /* window width */
83 #define WMENU_HGT       (WMITEMS+4)     /* window height */
84 #define WMENU_TITLE     "Command"
85 #define WMENU_POSLN     8               /* window position: lines */
86 #define WMENU_POSCO     20              /* window position: columns */
87
88 #define CR              0x0d
89 #define LF              0x0a
90 #define TAB             0x09
91 #define CNTRL_D         0x04
92 #define CNTRL_L         0x0c
93
94 struct onefile {
95         char    *fname;         /* filename */
96         char    *date;
97         char    *time;
98         char    *srcnumber;
99         char    *dstnumber;
100         char    *seconds;
101         char    *alias;
102         int     len;
103         struct onefile *next;   /* ptr to next entry */
104         struct onefile *prev;   /* prt to previous entry */
105 };
106
107 #ifdef MAIN
108
109 int curses_ready = 0;           /* flag, curses display is initialized */
110
111 struct onefile *cur_file = NULL;/* the CURRENT filename */
112 struct onefile *first = NULL;   /* init dir-list head-ptr */
113 struct onefile *last = NULL;    /* init dir-list tail-ptr */
114
115 WINDOW *main_w;                 /* curses main window pointer */
116
117 int nofiles = 0;
118 int cur_pos = 0;
119
120 char *spooldir = SPOOLDIR;
121 char *playstring = PLAYCMD;
122
123 #else
124
125 extern int curses_ready;
126
127 extern struct onefile *cur_file;
128 extern struct onefile *first;
129 extern struct onefile *last;
130
131 extern WINDOW *main_w;
132
133 extern int nofiles;
134 extern int cur_pos;
135
136 extern char *spooldir;
137 extern char *playstring;
138
139 #endif
140
141 extern void init_alias( char *filename );
142 extern void init_files( int inipos );
143 extern void init_screen ( void );
144 extern void do_menu ( void );
145 extern int fill_list( void );
146 extern char *get_alias( char *number );
147 extern int main ( int argc, char **argv );
148 extern void do_quit ( int exitval );
149 extern void fatal ( char *fmt, ... );
150 extern void error ( char *fmt, ... );
151 extern void play ( struct onefile * );
152 extern void delete ( struct onefile * );
153 extern void reread( void );
154
155 /* EOF */