annotate pwplib/pwplib-unix.c @ 53:f0c596c5905b

Make Final Isi hack more easily configurable.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 26 May 2010 00:42:25 +0300
parents 411c1c8d810e
children 85671798fdb3
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
53
f0c596c5905b Make Final Isi hack more easily configurable.
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
3 #undef FISI_HACK /* NOTICE! Enabling this is a hack for Final ISI only */
f0c596c5905b Make Final Isi hack more easily configurable.
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
4
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 #include "config.h"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 #include <stdio.h>
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 #include <stdlib.h>
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9
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
10 #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
11 #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
12 #endif
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 #include <signal.h>
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 #include <time.h>
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 #include <sys/time.h>
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 #include "pwplib.h"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 #include "tty.h"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 /******************** random stuff *************************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22
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
23 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
24
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 extern void pwplib_dummy();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 #define pwp_dummy pwplib_dummy
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
17
c60e531d19cd Some misc. cleanups and minor warning removals.
Matti Hamalainen <ccr@tnsp.org>
parents: 15
diff changeset
28 void pwpwrite(const char *fmt, ...)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 {
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
30 if (!pwplib.setup[SETUP_SHUTUP]) {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
31 va_list ap;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
32 va_start(ap, fmt);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
33 vfprintf(stderr, fmt, ap);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
34 va_end(ap);
17
c60e531d19cd Some misc. cleanups and minor warning removals.
Matti Hamalainen <ccr@tnsp.org>
parents: 15
diff changeset
35
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
36 usleep(1000 * pwplib.set.infodelay);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
37 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 /********************* timer ******************************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 #define TIMERHZ 72
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 int pwp_unix_tod()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 {
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
45 #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
46 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
47 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
48 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
49 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
50 switch (event.type) {
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
51 case SDL_KEYDOWN:
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
52 if (event.key.keysym.sym == SDLK_ESCAPE)
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
53 quit = 1;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
54 break;
53
f0c596c5905b Make Final Isi hack more easily configurable.
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
55 #ifdef FISI_HACK
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
56 case SDL_QUIT:
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
57 quit = 1;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
58 break;
52
411c1c8d810e Use #if 0 instead of commenting out.
Matti Hamalainen <ccr@tnsp.org>
parents: 51
diff changeset
59 #endif
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
60 }
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 }
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 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
63 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
64 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
65 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
66 }
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 return (SDL_GetTicks() * TIMERHZ) / 1000;
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
68 }
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
69 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
70 #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
71 {
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 struct timeval tod;
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
73 gettimeofday(&tod, NULL);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
74 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
75 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 /********************* destructors, signals etc **********/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80 void pwp_fatalsignal(int n)
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81 {
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
82 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
83
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
84 #ifdef DRIVE_SDL
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
85 if (sdl_init) {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
86 sdl_init = 0;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
87 SDL_Quit();
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
88 }
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
89 #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
90
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
91 pwplib_shutdown();
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
93 pwpwrite("* died to signal %d\n", n);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
94
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
95 exit(1);
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 /******************** initialization *********************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100 int pwplib_initcore()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101 {
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
102 int sdl_flags = 0;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
103 pwplib_init_common();
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
105 /*** setup signals, etc ***/
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106
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
107 #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
108 #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
109 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
110 #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
111 #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
112 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
113 #endif
53
f0c596c5905b Make Final Isi hack more easily configurable.
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
114 #ifdef FISI_HACK
f0c596c5905b Make Final Isi hack more easily configurable.
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
115 sdl_flags |= SDL_INIT_NOPARACHUTE;
f0c596c5905b Make Final Isi hack more easily configurable.
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
116 #endif
f0c596c5905b Make Final Isi hack more easily configurable.
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
117
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
118 /* With SDL, we let it handle the signals */
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
119 if (SDL_Init(SDL_INIT_TIMER | SDL_INIT_EVENTTHREAD | sdl_flags) != 0) {
28
e45ae779d439 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 19
diff changeset
120 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
121 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
122 } 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
123 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
124 #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
125
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
126 if (!sdl_init) {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
127 signal(SIGTERM, pwp_fatalsignal);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
128 signal(SIGINT, pwp_fatalsignal);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
129 signal(SIGQUIT, pwp_fatalsignal);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
130 signal(SIGKILL, pwp_fatalsignal);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
131 signal(SIGSEGV, pwp_fatalsignal);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
132 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
133
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
134 /*** video ***/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136 # ifdef DRIVE_VIDEO
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138 # ifdef DRIVE_SDL
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
139 if (sdl_init && pwp_SDL_init())
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
140 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
141 }
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
142 else
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
143 # endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
144 # ifdef DRIVE_PVP
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
145 if (pwplib.setup[SETUP_PVP])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
146 pvp_init();
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
147 else
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
148 # endif
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
149 if (!pwplib.setup[SETUP_NOVIDEO])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
150 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
151 tty_init();
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
152 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
153 # endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
154
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
155 /*** audio ***/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156 # ifdef DRIVE_AUDIO
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
157 if (!pwplib.setup[SETUP_NOSOUND])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
158 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
159 int snd = 0;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
160 #ifdef DRIVE_SDL
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 (sdl_init && pwp_sdlaudio_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_OSS
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 (oss_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
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
176 #ifdef DRIVE_HPUX
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
177 if (!snd)
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
178 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
179 if (hpuxsnd_init())
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
180 snd++;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
181 }
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
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
184 if (!snd)
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
185 pwpwrite("* couldn't init sound. going silent.\n");
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
186
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
187 }
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
188 else
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
189 pwpwrite("* no sound, as requested\n");
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
190 # endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
191
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
192 /*** fallbacks - remove? ***/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
193
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
194 if (pwplib.dump_rast == pwplib_dummy && pwplib.dump_attr != pwplib_dummy)
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
195 pwplib.dump_rast = pwplib_dump_rast_plain;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
196
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
197 /*** timer ***/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
198
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
199 if (pwplib.setup[SETUP_BPS] | pwplib.setup[SETUP_FPS])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
200 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
201 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
202 pwplib.timerfunc = pwp_timer_nrt;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
203 pwplib.timer_counter = 0;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
204 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
205 else
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
206 pwplib.timerfunc = pwp_unix_tod;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
207
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
208 /*** hmmm ***/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
209
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
210 if (!sdl_init && pwplib.setup[SETUP_HALVE])
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
211 pwplib.videobuf.height <<= 1;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
212
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
213 /* only allow if smaller than original? */
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
214
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
215 if (pwplib.setup[SETUP_USERHEIGHT])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
216 pwplib.videobuf.height = pwplib.setup[SETUP_USERHEIGHT];
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
217 if (pwplib.setup[SETUP_USERWIDTH])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
218 pwplib.videobuf.width = pwplib.setup[SETUP_USERWIDTH];
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
219
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
220 /*** done ***/
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
221
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
222 # ifdef DRIVE_VIDEO
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
223 if (!pwplib.setup[SETUP_NOVIDEO])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
224 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
225 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
226 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
227 # endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
228
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
229 return 1;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
230 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
231
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
232 /************************************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
233
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
234 const char *pwplogo =
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
235 "\033[2J\033[H\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
236 " \033[36;46mMMmmmmmmMM\033[0m\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
237 " \033[36;46mMM\033[0m\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
238 " \033[31;41mxxxxxxxxxxxx\033[0m\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
239 " \033[31;41mxxxxxxxxxxxxxxxxxxx\033[0m\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
240 " \033[31;41mxxxxxxxxx\033[0m\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
241 " \033[33;43mZZZZZ\033[34;44m....\033[0m %%%%%%%%% %%% %%% %%%%%%%%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
242 " \033[37;47m@@@@\033[34;44m......\033[0m %%%%%%%%%. %%%....... %%%. %%%%%%%%%....\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
243 " \033[37;47m@@@@\033[34;44m....\033[37mo\033[34m.\033[0m .....%%% %%% %%% %%% %%% %%% %%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
244 " \033[37;47m@@@@@@@\033[34;44m....\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"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
248 " \033[37;47m@@@@\033[0m %%%%%%%%% %%% %%% %%% %%%%%%%%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
249 " \033[37;47m@@@@@@\033[0m %%% %%%%% %%% %%% %%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
250 " \033[37;47m@@@@@@@@@@\033[0m \033[31;41mxx\033[0m %%% %%%%% %%% %%% %%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
251 " \033[37;47m@@@@@@@@@@@@@@\033[0m %%% %%%%% %%%% %%% %%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
252 " \033[37;47m@@@@@@@@@@@\033[0m %%% %%%%% %%%% %%% %%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
253 " \033[37;47m@@@@@@@@@\033[0m .....%%%....... %%%%%%%%%%%%%%. %%%..........\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
254 " \033[37;47m@@@@@\033[0m %%% %%%%%%%%%%%%%% %%%\n"
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
255 " \033[37;47m@@@@\033[0m\n\n";
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
256
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
257
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
258 void pwplib_startup()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
259 {
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
260 if (!pwplib.setup[SETUP_SHUTUP])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
261 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
262 pwpwrite("starting up.... 2sec delay for ^C");
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
263 sleep(2);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
264 }
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 /* send initstuff? */
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
267 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
268
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
269 void pwplib_end()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
270 {
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
271 if (pwplib.setup[SETUP_SHUTUP])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
272 return;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
273
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
274 pwplib_shutdown();
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
275 sleep(2);
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 fputs(pwplogo, stderr);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
278 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
279 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
280
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
281 /***************************************************************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
282
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
283 int pwplib_init(int argc, char **argv)
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
284 {
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
285 pwplib.argc = argc;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
286 pwplib.argv = argv;
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 pwplib_getopts();
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
289
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
290 if (pwplib.setup[SETUP_WANTHELP])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
291 {
50
e2b6a35bcb0c Remove usage of malloc.h; Other misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 29
diff changeset
292 pwplib_printhelp();
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
293 exit(0);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
294 }
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.setup[SETUP_SHUTUP])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
297 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
298 fputs(pwplogo, stderr);
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
299 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
300 }
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
301
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
302 pwpwrite("* using locale '%s'\n", pwplib.set.lang);
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
303
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
304 if (!pwplib_initcore())
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
305 {
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
306 pwpwrite("initialization failed!\n");
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
307 return 0;
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
308 }
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
309
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
310 if (pwplib.setup[SETUP_WANTHELP])
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
311 return 0;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
312
19
2c72092554fa Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
313 return 1;
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
314 }