diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/include/libbb.h b/include/libbb.h index 764d707b8..6956aaf7b 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -178,7 +178,7 @@ struct hwtype { | |||
178 | 178 | ||
179 | /* buffer allocation schemes */ | 179 | /* buffer allocation schemes */ |
180 | #if ENABLE_FEATURE_BUFFERS_GO_ON_STACK | 180 | #if ENABLE_FEATURE_BUFFERS_GO_ON_STACK |
181 | #define RESERVE_CONFIG_BUFFER(buffer,len) char buffer[len] | 181 | #define RESERVE_CONFIG_BUFFER(buffer,len) char buffer[len] |
182 | #define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char buffer[len] | 182 | #define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char buffer[len] |
183 | #define RELEASE_CONFIG_BUFFER(buffer) ((void)0) | 183 | #define RELEASE_CONFIG_BUFFER(buffer) ((void)0) |
184 | #else | 184 | #else |
@@ -187,9 +187,9 @@ struct hwtype { | |||
187 | #define RESERVE_CONFIG_UBUFFER(buffer,len) static unsigned char buffer[len] | 187 | #define RESERVE_CONFIG_UBUFFER(buffer,len) static unsigned char buffer[len] |
188 | #define RELEASE_CONFIG_BUFFER(buffer) ((void)0) | 188 | #define RELEASE_CONFIG_BUFFER(buffer) ((void)0) |
189 | #else | 189 | #else |
190 | #define RESERVE_CONFIG_BUFFER(buffer,len) char *buffer=xmalloc(len) | 190 | #define RESERVE_CONFIG_BUFFER(buffer,len) char *buffer = xmalloc(len) |
191 | #define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len) | 191 | #define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char *buffer = xmalloc(len) |
192 | #define RELEASE_CONFIG_BUFFER(buffer) free (buffer) | 192 | #define RELEASE_CONFIG_BUFFER(buffer) free(buffer) |
193 | #endif | 193 | #endif |
194 | #endif | 194 | #endif |
195 | 195 | ||
@@ -219,7 +219,7 @@ struct sysinfo { | |||
219 | unsigned int mem_unit; /* Memory unit size in bytes */ | 219 | unsigned int mem_unit; /* Memory unit size in bytes */ |
220 | char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ | 220 | char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ |
221 | }; | 221 | }; |
222 | extern int sysinfo(struct sysinfo* info); | 222 | int sysinfo(struct sysinfo* info); |
223 | 223 | ||
224 | 224 | ||
225 | extern void chomp(char *s); | 225 | extern void chomp(char *s); |
@@ -232,10 +232,12 @@ extern const char *bb_mode_string(mode_t mode); | |||
232 | extern int is_directory(const char *name, int followLinks, struct stat *statBuf); | 232 | extern int is_directory(const char *name, int followLinks, struct stat *statBuf); |
233 | extern int remove_file(const char *path, int flags); | 233 | extern int remove_file(const char *path, int flags); |
234 | extern int copy_file(const char *source, const char *dest, int flags); | 234 | extern int copy_file(const char *source, const char *dest, int flags); |
235 | #define action_recurse (1<<0) | 235 | enum { |
236 | #define action_followLinks (1<<1) | 236 | ACTION_RECURSE = (1 << 0), |
237 | #define action_depthFirst (1<<2) | 237 | ACTION_FOLLOWLINKS = (1 << 1), |
238 | #define action_reverse (1<<3) | 238 | ACTION_DEPTHFIRST = (1 << 2), |
239 | /*ACTION_REVERSE = (1 << 3), - unused */ | ||
240 | }; | ||
239 | extern int recursive_action(const char *fileName, unsigned flags, | 241 | extern int recursive_action(const char *fileName, unsigned flags, |
240 | int (*fileAction) (const char *fileName, struct stat* statbuf, void* userData, int depth), | 242 | int (*fileAction) (const char *fileName, struct stat* statbuf, void* userData, int depth), |
241 | int (*dirAction) (const char *fileName, struct stat* statbuf, void* userData, int depth), | 243 | int (*dirAction) (const char *fileName, struct stat* statbuf, void* userData, int depth), |
@@ -260,13 +262,12 @@ int ndelay_off(int fd); | |||
260 | void xmove_fd(int, int); | 262 | void xmove_fd(int, int); |
261 | 263 | ||
262 | 264 | ||
263 | extern DIR *xopendir(const char *path); | 265 | DIR *xopendir(const char *path); |
264 | extern DIR *warn_opendir(const char *path); | 266 | DIR *warn_opendir(const char *path); |
265 | 267 | ||
266 | char *xrealloc_getcwd_or_warn(char *cwd); | 268 | char *xrealloc_getcwd_or_warn(char *cwd); |
267 | char *xmalloc_readlink_or_warn(const char *path); | 269 | char *xmalloc_readlink_or_warn(const char *path); |
268 | char *xmalloc_realpath(const char *path); | 270 | char *xmalloc_realpath(const char *path); |
269 | extern void xstat(const char *filename, struct stat *buf); | ||
270 | 271 | ||
271 | /* Unlike waitpid, waits ONLY for one process, | 272 | /* Unlike waitpid, waits ONLY for one process, |
272 | * It's safe to pass negative 'pids' from failed [v]fork - | 273 | * It's safe to pass negative 'pids' from failed [v]fork - |
@@ -299,6 +300,7 @@ void xsetuid(uid_t uid); | |||
299 | void xchdir(const char *path); | 300 | void xchdir(const char *path); |
300 | void xsetenv(const char *key, const char *value); | 301 | void xsetenv(const char *key, const char *value); |
301 | void xunlink(const char *pathname); | 302 | void xunlink(const char *pathname); |
303 | void xstat(const char *pathname, struct stat *buf); | ||
302 | int xopen(const char *pathname, int flags); | 304 | int xopen(const char *pathname, int flags); |
303 | int xopen3(const char *pathname, int flags, int mode); | 305 | int xopen3(const char *pathname, int flags, int mode); |
304 | off_t xlseek(int fd, off_t offset, int whence); | 306 | off_t xlseek(int fd, off_t offset, int whence); |