]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/install+setup/libsmooth/libsmooth.h
git-svn-id: http://svn.ipfire.org/svn/ipfire/IPFire/source@16 ea5c0bd1-69bd-2848...
[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
62 /* libsmooth.c */
63 void reboot(void);
64 void stripnl(char *s);
65 int mysystem(char *command);
66 void errorbox(char *message);
67 void statuswindow(int width, int height, char *title, char *text, ...);
68 int runcommandwithprogress(int width, int height, char *title, char *command,
69 int lines, char *text, ...);
70 int runcommandwithstatus(char *command, char *message);
71 int runhiddencommandwithstatus(char *command, char *message);
72 int checkformodule(char *module);
73 int replace(char filename1[], char *from, char *to);
74 char* get_version(void);
75
76 /* netstuff.c */
77 int changeaddress(struct keyvalue *kv, char *colour, int typeflag,
78 char *defaultdhcphostname);
79 int gettype(char *type);
80 int setnetaddress(struct keyvalue *kv, char *colour);
81 void networkdialogcallbacktype(newtComponent cm, void *data);
82 int interfacecheck(struct keyvalue *kv, char *colour);
83 int probecards(char *driver, char *driveroptions);
84 int choosecards(char *driver, char *driveroptions);
85 int manualdriver(char *driver, char *driveroptions);
86 int countcards(void);
87 int findnicdescription(char *modulename, char *description);
88
89 /* data.c */
90 struct keyvalue *initkeyvalues(void);
91 void freekeyvalues(struct keyvalue *head);
92 int readkeyvalues(struct keyvalue *head, char *filename);
93 int writekeyvalues(struct keyvalue *head, char *filename);
94 int findkey(struct keyvalue *head, char *key, char *value);
95 void appendkeyvalue(struct keyvalue *head, char *key, char *value);
96 void replacekeyvalue(struct keyvalue *head, char *key, char *value);
97
98 #endif
99