9
0
Fork 0
barebox/include/libbb.h

41 lines
1.2 KiB
C
Raw Permalink Normal View History

2007-09-23 23:36:07 +00:00
#ifndef __LIBBB_H
#define __LIBBB_H
#include <linux/stat.h>
#define DOT_OR_DOTDOT(s) ((s)[0] == '.' && (!(s)[1] || ((s)[1] == '.' && !(s)[2])))
2007-09-23 23:36:07 +00:00
char *concat_path_file(const char *path, const char *filename);
char *concat_subpath_file(const char *path, const char *f);
2007-09-23 23:36:07 +00:00
int execable_file(const char *name);
char *find_execable(const char *filename);
char* last_char_is(const char *s, int c);
enum {
ACTION_RECURSE = (1 << 0),
ACTION_FOLLOWLINKS = (1 << 1),
ACTION_DEPTHFIRST = (1 << 2),
/*ACTION_REVERSE = (1 << 3), - unused */
};
int recursive_action(const char *fileName, unsigned flags,
int (*fileAction) (const char *fileName, struct stat* statbuf, void* userData, int depth),
int (*dirAction) (const char *fileName, struct stat* statbuf, void* userData, int depth),
void* userData, const unsigned depth);
2007-09-28 08:45:59 +00:00
char * safe_strncpy(char *dst, const char *src, size_t size);
int copy_file(const char *src, const char *dst, int verbose);
int process_escape_sequence(const char *source, char *dest, int destlen);
char *simple_itoa(unsigned int i);
int write_full(int fd, void *buf, size_t size);
int read_full(int fd, void *buf, size_t size);
char *read_file_line(const char *fmt, ...);
2007-09-23 23:36:07 +00:00
#endif /* __LIBBB_H */