summaryrefslogtreecommitdiffstats
path: root/usr.sbin/i4b/isdntel/defs.h
blob: 34d474185b580dee16438c1122ddd01e9e6e0b11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
 * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *---------------------------------------------------------------------------
 *
 *	isdntel - isdn4bsd telephone answering support
 *      ==============================================
 *
 *	$Id: defs.h,v 1.9 1999/04/26 12:10:39 hm Exp $ 
 *
 *      last edit-date: [Mon Apr 26 13:55:35 1999]
 *
 *----------------------------------------------------------------------------*/

#include <ncurses.h>
#include <stdio.h>
#include <signal.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>
#include <fcntl.h>
#include <ctype.h>
#include <sys/time.h>
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
#include <dirent.h>
#else
#include <sys/dir.h>
#endif
#include <sys/param.h>

#include <machine/i4b_ioctl.h>

#define GOOD	0
#define	ERROR	(-1)
#define WARNING (-2)

#define	SPOOLDIR	"/var/isdn"
#define PLAYCMD		"cat %s | g711conv -a >/dev/audio"

/* reread timeout in seconds */

#define REREADTIMEOUT	60

/* window dimensions */

#define START_O		3	/* main window start  */

#define DAT_POS		0
#define TIM_POS		(DAT_POS+10)
#define DST_POS		(TIM_POS+8)
#define SRC_POS		(DST_POS+17)
#define ALI_POS		(SRC_POS+17)
#define SEC_POS		(ALI_POS+21)
#define LAST_POS	(SEC_POS+5)

/* fullscreen mode menu window */

#define WMITEMS 	5		/* no of items */
#define WMENU_LEN 	18		/* window width */
#define WMENU_HGT 	(WMITEMS+4)	/* window height */
#define WMENU_TITLE 	"Command"
#define WMENU_POSLN	8		/* window position: lines */
#define WMENU_POSCO	20		/* window position: columns */

#define CR		0x0d
#define LF		0x0a
#define	TAB		0x09
#define	CNTRL_D		0x04
#define CNTRL_L		0x0c

struct onefile {
	char	*fname;		/* filename */
	char	*date;
	char	*time;
	char	*srcnumber;
	char	*dstnumber;
	char	*seconds;
	char	*alias;
	int	len;
	struct onefile *next;	/* ptr to next entry */
	struct onefile *prev;	/* prt to previous entry */
};

#ifdef MAIN

int curses_ready = 0;		/* flag, curses display is initialized */

struct onefile *cur_file = NULL;/* the CURRENT filename */
struct onefile *first = NULL;	/* init dir-list head-ptr */
struct onefile *last = NULL;	/* init dir-list tail-ptr */

WINDOW *main_w;			/* curses main window pointer */

int nofiles = 0;
int cur_pos = 0;

char *spooldir = SPOOLDIR;
char *playstring = PLAYCMD;

#else

extern int curses_ready;

extern struct onefile *cur_file;
extern struct onefile *first;
extern struct onefile *last;

extern WINDOW *main_w;

extern int nofiles;
extern int cur_pos;

extern char *spooldir;
extern char *playstring;

#endif

extern void init_alias( char *filename );
extern void init_files( int inipos );
extern void init_screen ( void );
extern void do_menu ( void );
extern int fill_list( void );
extern char *get_alias( char *number );
extern int main ( int argc, char **argv );
extern void do_quit ( int exitval );
extern void fatal ( char *fmt, ... );
extern void error ( char *fmt, ... );
extern void play ( struct onefile * );
extern void delete ( struct onefile * );
extern void reread( void );

/* EOF */
OpenPOWER on IntegriCloud