annotate pwplib/pwplib-unix.c @ 50:e2b6a35bcb0c

Remove usage of malloc.h; Other misc cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 24 May 2010 08:48:18 +0300
parents d83239a98d1e
children 53676367d46f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 #define __PWPLIB_C
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 #include "config.h"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 #include <stdio.h>
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 #include <stdlib.h>
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7
15
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
8 #ifdef DRIVE_SDL
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
9 #include <SDL.h>
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
10 #endif
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 #include <signal.h>
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 #include <time.h>
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 #include <sys/time.h>
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 #include "pwplib.h"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 #include "tty.h"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 /******************** random stuff *************************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20
15
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
21 static int sdl_init = 0;
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
22
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 extern void pwplib_dummy();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 #define pwp_dummy pwplib_dummy
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25
17
c60e531d19cd Some misc. cleanups and minor warning removals.
Matti Hamalainen <ccr@tnsp.org>
parents: 15
diff changeset
26 void pwpwrite(const char *fmt, ...)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 {
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
28 if (!pwplib.setup[SETUP_SHUTUP]) {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
29 va_list ap;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
30 va_start(ap, fmt);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
31 vfprintf(stderr, fmt, ap);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
32 va_end(ap);
17
c60e531d19cd Some misc. cleanups and minor warning removals.
Matti Hamalainen <ccr@tnsp.org>
parents: 15
diff changeset
33
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
34 usleep(1000 * pwplib.set.infodelay);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
35 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 /********************* timer ******************************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 #define TIMERHZ 72
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 int pwp_unix_tod()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 {
15
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
43 #ifdef DRIVE_SDL
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
44 if (sdl_init) {
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
45 int quit = 0;
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
46 SDL_Event event;
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
47 if (SDL_PollEvent(&event) >= 0) {
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
48 switch (event.type) {
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
49 case SDL_KEYDOWN:
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
50 if (event.key.keysym.sym == SDLK_ESCAPE)
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
51 quit = 1;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
52 break;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
53 case SDL_QUIT:
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
54 quit = 1;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
55 break;
15
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
56 }
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
57 }
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
58 if (quit) {
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
59 SDL_Quit();
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
60 pwplib_shutdown();
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
61 exit(1);
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
62 }
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
63 return (SDL_GetTicks() * TIMERHZ) / 1000;
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
64 }
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
65 else
15
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
66 #endif
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
67 {
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68 struct timeval tod;
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
69 gettimeofday(&tod, NULL);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
70 return (tod.tv_sec * TIMERHZ) + (tod.tv_usec * TIMERHZ / 1000000);
15
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
71 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 /********************* destructors, signals etc **********/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 void pwp_fatalsignal(int n)
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 {
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
78 pwpwrite("* pwplib shutting down\n");
15
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
79
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
80 #ifdef DRIVE_SDL
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
81 if (sdl_init) {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
82 sdl_init = 0;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
83 SDL_Quit();
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
84 }
15
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
85 #endif
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
86
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
87 pwplib_shutdown();
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
89 pwpwrite("* died to signal %d\n", n);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
90
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
91 exit(1);
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94 /******************** initialization *********************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96 int pwplib_initcore()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97 {
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
98 int sdl_flags = 0;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
99 pwplib_init_common();
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
101 /*** setup signals, etc ***/
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102
15
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
103 #ifdef DRIVE_SDL
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
104 #ifdef DRIVE_VIDEO
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
105 sdl_flags |= SDL_INIT_VIDEO;
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
106 #endif
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
107 #ifdef DRIVE_AUDIO
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
108 sdl_flags |= SDL_INIT_AUDIO;
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
109 #endif
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
110 /* With SDL, we let it handle the signals */
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
111 if (SDL_Init(SDL_INIT_TIMER | SDL_INIT_EVENTTHREAD | sdl_flags) != 0) {
28
e45ae779d439 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 19
diff changeset
112 pwpwrite("* SDL could not be initialized (%s).\n", SDL_GetError());
15
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
113 sdl_init = 0;
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
114 } else
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
115 sdl_init = 1;
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
116 #endif
fa87f8897f21 Implement hacky and crummy SDL event handling in timer value fetching function; moved SDL general initialization into pwplib-unix.c.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
117
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
118 if (!sdl_init) {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
119 signal(SIGTERM, pwp_fatalsignal);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
120 signal(SIGINT, pwp_fatalsignal);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
121 signal(SIGQUIT, pwp_fatalsignal);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
122 signal(SIGKILL, pwp_fatalsignal);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
123 signal(SIGSEGV, pwp_fatalsignal);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
124 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
126 /*** video ***/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128 # ifdef DRIVE_VIDEO
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
130 # ifdef DRIVE_SDL
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
131 if (sdl_init && pwp_SDL_init())
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
132 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
133 }
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
134 else
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135 # endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136 # ifdef DRIVE_PVP
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
137 if (pwplib.setup[SETUP_PVP])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
138 pvp_init();
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
139 else
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
140 # endif
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
141 if (!pwplib.setup[SETUP_NOVIDEO])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
142 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
143 tty_init();
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
144 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
145 # endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
146
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
147 /*** audio ***/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
148 # ifdef DRIVE_AUDIO
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
149 if (!pwplib.setup[SETUP_NOSOUND])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
150 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
151 int snd = 0;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
152 #ifdef DRIVE_SDL
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
153 if (!snd)
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
154 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
155 if (sdl_init && pwp_sdlaudio_init())
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
156 snd++;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
157 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
158 #endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
159
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
160 #ifdef DRIVE_OSS
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
161 if (!snd)
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
162 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
163 if (oss_init())
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
164 snd++;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
165 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
166 #endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
167
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
168 #ifdef DRIVE_HPUX
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
169 if (!snd)
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
170 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
171 if (hpuxsnd_init())
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
172 snd++;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
173 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
174 #endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
175
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
176 if (!snd)
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
177 pwpwrite("* couldn't init sound. going silent.\n");
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
178
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
179 }
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
180 else
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
181 pwpwrite("* no sound, as requested\n");
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
182 # endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
183
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
184 /*** fallbacks - remove? ***/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
185
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
186 if (pwplib.dump_rast == pwplib_dummy && pwplib.dump_attr != pwplib_dummy)
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
187 pwplib.dump_rast = pwplib_dump_rast_plain;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
188
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
189 /*** timer ***/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
190
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
191 if (pwplib.setup[SETUP_BPS] | pwplib.setup[SETUP_FPS])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
192 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
193 pwpwrite("non-realtime output (bps=%d fps=%d)\n", pwplib.setup[SETUP_BPS], pwplib.setup[SETUP_FPS]);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
194 pwplib.timerfunc = pwp_timer_nrt;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
195 pwplib.timer_counter = 0;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
196 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
197 else
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
198 pwplib.timerfunc = pwp_unix_tod;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
199
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
200 /*** hmmm ***/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
201
29
d83239a98d1e Take SDL into account when halving height of rendering buffer, and remove the corresponding "hack" from sdl.c. Also misc. cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 28
diff changeset
202 if (!sdl_init && pwplib.setup[SETUP_HALVE])
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
203 pwplib.videobuf.height <<= 1;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
204
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
205 /* only allow if smaller than original? */
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
206
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
207 if (pwplib.setup[SETUP_USERHEIGHT])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
208 pwplib.videobuf.height = pwplib.setup[SETUP_USERHEIGHT];
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
209 if (pwplib.setup[SETUP_USERWIDTH])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
210 pwplib.videobuf.width = pwplib.setup[SETUP_USERWIDTH];
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
211
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
212 /*** done ***/
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
213
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
214 # ifdef DRIVE_VIDEO
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
215 if (!pwplib.setup[SETUP_NOVIDEO])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
216 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
217 pwpwrite("* pwplib now controls a %d x %d framebuffer\n", pwplib.videobuf.width, pwplib.videobuf.height);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
218 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
219 # endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
220
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
221 return 1;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
222 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
223
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
224 /************************************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
225
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
226 const char *pwplogo =
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
227 "\033[2J\033[H\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
228 " \033[36;46mMMmmmmmmMM\033[0m\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
229 " \033[36;46mMM\033[0m\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
230 " \033[31;41mxxxxxxxxxxxx\033[0m\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
231 " \033[31;41mxxxxxxxxxxxxxxxxxxx\033[0m\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
232 " \033[31;41mxxxxxxxxx\033[0m\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
233 " \033[33;43mZZZZZ\033[34;44m....\033[0m %%%%%%%%% %%% %%% %%%%%%%%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
234 " \033[37;47m@@@@\033[34;44m......\033[0m %%%%%%%%%. %%%....... %%%. %%%%%%%%%....\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
235 " \033[37;47m@@@@\033[34;44m....\033[37mo\033[34m.\033[0m .....%%% %%% %%% %%% %%% %%% %%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
236 " \033[37;47m@@@@@@@\033[34;44m....\033[0m %%% %%% %%% %%% %%% %%% %%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
237 " \033[37;47m@@@@@@@@@@@\033[0m %%%% %%% %%% %%% %%% %%%% %%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
238 " \033[37;47m@@@@@@@@@@@@@\033[0m %%%% %%% %%% %%% %%% %%%% %%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
239 " \033[37;47m@@@@@@@@@@@@@@@\033[0m %%%%%%%%% %%% %%% %%% %%%%%%%%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
240 " \033[37;47m@@@@\033[0m %%%%%%%%% %%% %%% %%% %%%%%%%%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
241 " \033[37;47m@@@@@@\033[0m %%% %%%%% %%% %%% %%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
242 " \033[37;47m@@@@@@@@@@\033[0m \033[31;41mxx\033[0m %%% %%%%% %%% %%% %%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
243 " \033[37;47m@@@@@@@@@@@@@@\033[0m %%% %%%%% %%%% %%% %%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
244 " \033[37;47m@@@@@@@@@@@\033[0m %%% %%%%% %%%% %%% %%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
245 " \033[37;47m@@@@@@@@@\033[0m .....%%%....... %%%%%%%%%%%%%%. %%%..........\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
246 " \033[37;47m@@@@@\033[0m %%% %%%%%%%%%%%%%% %%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
247 " \033[37;47m@@@@\033[0m\n\n";
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
248
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
249
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
250 void pwplib_startup()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
251 {
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
252 if (!pwplib.setup[SETUP_SHUTUP])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
253 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
254 pwpwrite("starting up.... 2sec delay for ^C");
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
255 sleep(2);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
256 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
257
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
258 /* send initstuff? */
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
259 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
260
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
261 void pwplib_end()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
262 {
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
263 if (pwplib.setup[SETUP_SHUTUP])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
264 return;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
265
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
266 pwplib_shutdown();
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
267 sleep(2);
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
268
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
269 fputs(pwplogo, stderr);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
270 pwpwrite("shutting down multimedia subsystems\n" "operation finished - support pwp\n\n\n");
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
271 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
272
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
273 /***************************************************************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
274
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
275 int pwplib_init(int argc, char **argv)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
276 {
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
277 pwplib.argc = argc;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
278 pwplib.argv = argv;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
279
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
280 pwplib_getopts();
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
281
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
282 if (pwplib.setup[SETUP_WANTHELP])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
283 {
50
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 29
diff changeset
284 pwplib_printhelp();
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
285 exit(0);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
286 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
287
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
288 if (!pwplib.setup[SETUP_SHUTUP])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
289 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
290 fputs(pwplogo, stderr);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
291 pwpwrite("pwplib " PWPLIB_VERSION " initializing..\n\nrun with --help for some options\n\n");
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
292 }
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
293
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
294 pwpwrite("* using locale '%s'\n", pwplib.set.lang);
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
295
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
296 if (!pwplib_initcore())
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
297 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
298 pwpwrite("initialization failed!\n");
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
299 return 0;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
300 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
301
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
302 if (pwplib.setup[SETUP_WANTHELP])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
303 return 0;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
304
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
305 return 1;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
306 }