aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h26
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};
222extern int sysinfo(struct sysinfo* info); 222int sysinfo(struct sysinfo* info);
223 223
224 224
225extern void chomp(char *s); 225extern void chomp(char *s);
@@ -232,10 +232,12 @@ extern const char *bb_mode_string(mode_t mode);
232extern int is_directory(const char *name, int followLinks, struct stat *statBuf); 232extern int is_directory(const char *name, int followLinks, struct stat *statBuf);
233extern int remove_file(const char *path, int flags); 233extern int remove_file(const char *path, int flags);
234extern int copy_file(const char *source, const char *dest, int flags); 234extern int copy_file(const char *source, const char *dest, int flags);
235#define action_recurse (1<<0) 235enum {
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};
239extern int recursive_action(const char *fileName, unsigned flags, 241extern 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);
260void xmove_fd(int, int); 262void xmove_fd(int, int);
261 263
262 264
263extern DIR *xopendir(const char *path); 265DIR *xopendir(const char *path);
264extern DIR *warn_opendir(const char *path); 266DIR *warn_opendir(const char *path);
265 267
266char *xrealloc_getcwd_or_warn(char *cwd); 268char *xrealloc_getcwd_or_warn(char *cwd);
267char *xmalloc_readlink_or_warn(const char *path); 269char *xmalloc_readlink_or_warn(const char *path);
268char *xmalloc_realpath(const char *path); 270char *xmalloc_realpath(const char *path);
269extern 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);
299void xchdir(const char *path); 300void xchdir(const char *path);
300void xsetenv(const char *key, const char *value); 301void xsetenv(const char *key, const char *value);
301void xunlink(const char *pathname); 302void xunlink(const char *pathname);
303void xstat(const char *pathname, struct stat *buf);
302int xopen(const char *pathname, int flags); 304int xopen(const char *pathname, int flags);
303int xopen3(const char *pathname, int flags, int mode); 305int xopen3(const char *pathname, int flags, int mode);
304off_t xlseek(int fd, off_t offset, int whence); 306off_t xlseek(int fd, off_t offset, int whence);