aboutsummaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>1999-10-05 22:58:32 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>1999-10-05 22:58:32 +0000
commit084fac40aceeeca57e774d4f8adb6a6ca461731d (patch)
treec92657a42b94419ab9579e8c52639c301764ec40 /internal.h
parent1f3e8dc36947bdcc2d008fba3cdc29e2c79f9c27 (diff)
downloadbusybox-w32-084fac40aceeeca57e774d4f8adb6a6ca461731d.tar.gz
busybox-w32-084fac40aceeeca57e774d4f8adb6a6ca461731d.tar.bz2
busybox-w32-084fac40aceeeca57e774d4f8adb6a6ca461731d.zip
More stuff works.
-Erik git-svn-id: svn://busybox.net/trunk/busybox@9 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h109
1 files changed, 54 insertions, 55 deletions
diff --git a/internal.h b/internal.h
index e658d3b7d..75e5503cf 100644
--- a/internal.h
+++ b/internal.h
@@ -1,3 +1,26 @@
1/*
2 * Busybox main header file
3 *
4 * Copyright (C) 1998 by Erik Andersen <andersee@debian.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell
21 * Permission has been granted to redistribute this code under the GPL.
22 *
23 */
1#ifndef _INTERNAL_H_ 24#ifndef _INTERNAL_H_
2#define _INTERNAL_H_ 25#define _INTERNAL_H_
3 26
@@ -13,8 +36,8 @@
13typedef int BOOL; 36typedef int BOOL;
14#define STDIN 0 37#define STDIN 0
15#define STDOUT 1 38#define STDOUT 1
16#define FALSE ((BOOL) 0) 39#define FALSE ((BOOL) 1)
17#define TRUE ((BOOL) 1) 40#define TRUE ((BOOL) 0)
18 41
19#define PATH_LEN 1024 42#define PATH_LEN 1024
20#define BUF_SIZE 8192 43#define BUF_SIZE 8192
@@ -129,60 +152,36 @@ parse_mode(
129 152
130extern int parse_user_name(const char* string, struct FileInfo * i); 153extern int parse_user_name(const char* string, struct FileInfo * i);
131 154
132extern const char block_device_usage[];
133extern const char chgrp_usage[];
134extern const char chmod_usage[];
135extern const char chown_usage[];
136extern const char chroot_usage[];
137extern const char clear_usage[];
138extern const char cp_usage[];
139extern const char date_usage[];
140extern const char dd_usage[];
141extern const char df_usage[];
142extern const char dmesg_usage[];
143extern const char dutmp_usage[];
144extern const char false_usage[];
145extern const char fdflush_usage[];
146extern const char find_usage[];
147extern const char grep_usage[];
148extern const char halt_usage[];
149extern const char init_usage[];
150extern const char kill_usage[];
151extern const char length_usage[];
152extern const char ln_usage[];
153extern const char loadkmap_usage[];
154extern const char losetup_usage[];
155extern const char ls_usage[];
156extern const char math_usage[];
157extern const char makedevs_usage[];
158extern const char mkdir_usage[];
159extern const char mknod_usage[];
160extern const char mkswap_usage[];
161extern const char mnc_usage[];
162extern const char more_usage[];
163extern const char mount_usage[];
164extern const char mt_usage[];
165extern const char mv_usage[];
166extern const char printf_usage[];
167extern const char pwd_usage[];
168extern const char reboot_usage[];
169extern const char rm_usage[];
170extern const char rmdir_usage[];
171extern const char scan_partitions_usage[];
172extern const char sleep_usage[];
173extern const char tar_usage[];
174extern const char swapoff_usage[];
175extern const char swapon_usage[];
176extern const char sync_usage[];
177extern const char touch_usage[];
178extern const char tput_usage[];
179extern const char true_usage[];
180extern const char tryopen_usage[];
181extern const char umount_usage[];
182extern const char update_usage[];
183extern const char zcat_usage[];
184extern const char gzip_usage[];
185 155
156/*
157 * A chunk of data.
158 * Chunks contain data which is allocated as needed, but which is
159 * not freed until all of the data needs freeing, such as at
160 * the beginning of the next command.
161 */
162typedef struct chunk CHUNK;
163#define CHUNK_INIT_SIZE 4
164
165struct chunk {
166 CHUNK *next;
167 char data[CHUNK_INIT_SIZE]; /* actually of varying length */
168};
169
170const char *modeString(int mode);
171const char *timeString(time_t timeVal);
172BOOL isDirectory(const char *name);
173BOOL isDevice(const char *name);
174BOOL copyFile(const char *srcName, const char *destName, BOOL setModes);
175const char *buildName(const char *dirName, const char *fileName);
176BOOL makeString(int argc, const char **argv, char *buf, int bufLen);
177char *getChunk(int size);
178char *chunkstrdup(const char *str);
179void freeChunks(void);
180int fullWrite(int fd, const char *buf, int len);
181int fullRead(int fd, char *buf, int len);
182int recursiveAction(const char *fileName, BOOL followLinks,
183 int (*fileAction) (const char *fileName),
184 int (*dirAction) (const char *fileName));
186 185
187 186
188#endif 187#endif