]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/install+setup/libsmooth/libsmooth.h
Ich hab mal ein bisschen die Arbeit vom Cuebernommen :D
[people/teissler/ipfire-2.x.git] / src / install+setup / libsmooth / libsmooth.h
1 /* SmoothWall libsmooth.
2 *
3 * This program is distributed under the terms of the GNU General Public
4 * Licence. See the file COPYING for details.
5 *
6 * (c) Lawrence Manning, 2001
7 * Contains prototypes for library functions.
8 *
9 * $Id: libsmooth.h,v 1.4.2.3 2005/10/30 23:25:35 franck78 Exp $
10 *
11 */
12
13 #ifndef ___LIBSMOOTH_H
14 #define ___LIBSMOOTH_H
15
16 #include <stdio.h>
17 #include <stdlib.h>
18 #include <string.h>
19 #include <ctype.h>
20 #include <wchar.h>
21 #include <locale.h>
22 #include <unistd.h>
23 #include <sys/file.h>
24 #include <sys/types.h>
25 #include <sys/stat.h>
26 #include <fcntl.h>
27 #include <newt.h>
28 #include <dirent.h>
29 #include <sys/mount.h>
30
31 #include <sys/socket.h>
32 #include <netinet/in.h>
33 #include <arpa/inet.h>
34
35 #include <linux/cdrom.h>
36 #include <sys/ioctl.h>
37
38 #include "langs.h"
39
40 #define STRING_SIZE 1023
41
42 #define ADDRESS 0
43 #define NETADDRESS 1
44 #define NETMASK 2
45 #define DHCP 3
46 #define NETCHANGE_TOTAL 4
47
48 struct keyvalue
49 {
50 char key[STRING_SIZE];
51 char value[STRING_SIZE];
52 struct keyvalue *next;
53 };
54
55 /* for stuff in net.c */
56 struct nic
57 {
58 char *description;
59 char *modulename;
60 };
61 struct driver
62 {
63 char *description;
64 char *modulename;
65 };
66
67 /* libsmooth.c */
68 void reboot(void);
69 void stripnl(char *s);
70 int mysystem(char *command);
71 void errorbox(char *message);
72 void statuswindow(int width, int height, char *title, char *text, ...);
73 int runcommandwithprogress(int width, int height, char *title, char *command,
74 int lines, char *text, ...);
75 int runcommandwithstatus(char *command, char *message);
76 int runhiddencommandwithstatus(char *command, char *message);
77 int checkformodule(char *module);
78 int replace(char filename1[], char *from, char *to);
79 char* get_version(void);
80
81 /* netstuff.c */
82 int changeaddress(struct keyvalue *kv, char *colour, int typeflag,
83 char *defaultdhcphostname);
84 int gettype(char *type);
85 int setnetaddress(struct keyvalue *kv, char *colour);
86 void networkdialogcallbacktype(newtComponent cm, void *data);
87 int interfacecheck(struct keyvalue *kv, char *colour);
88 int probecards(char *driver, char *driveroptions);
89 int choosecards(char *driver, char *driveroptions);
90 int manualdriver(char *driver, char *driveroptions);
91 int countcards(void);
92 int findnicdescription(char *modulename, char *description);
93
94 /* data.c */
95 struct keyvalue *initkeyvalues(void);
96 void freekeyvalues(struct keyvalue *head);
97 int readkeyvalues(struct keyvalue *head, char *filename);
98 int writekeyvalues(struct keyvalue *head, char *filename);
99 int findkey(struct keyvalue *head, char *key, char *value);
100 void appendkeyvalue(struct keyvalue *head, char *key, char *value);
101 void replacekeyvalue(struct keyvalue *head, char *key, char *value);
102
103 #endif
104