summaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2010-03-26 17:55:51 +0100
committerKarel Klic <kklic@redhat.com>2010-03-26 18:11:09 +0100
commit7ccd55eb10921e94a81b699a2c96cb1dc25515d1 (patch)
tree66297ccd0633eb5b8f817c3d710c36b267b3bc61 /inc
parent605c31f9d0897c18a900c7a4c0ad75bc439d18e5 (diff)
downloadabrt-7ccd55eb10921e94a81b699a2c96cb1dc25515d1.tar.gz
abrt-7ccd55eb10921e94a81b699a2c96cb1dc25515d1.tar.xz
abrt-7ccd55eb10921e94a81b699a2c96cb1dc25515d1.zip
Move backtrace parser from src/Backtrace to lib/Utils.
Move abrt-backtrace app from src/Backtrace/main.c to src/utils/abrt-backtrace. Move backtrace preprocessign code from abrt-backtrace to the parser. Implemented new backtrace rating algorithm. Added old bt rating algorithm to backtrace.c Move strbuf to lib/Utils, and updated it to use xfuncs. Created separate header for xfuncs. Some functions in xfuncs marked as extern "c", so they can be used in C code. Merged backtrace fallback (independent_backtrace) "parser" into backtrace.{h/c}. Added option --rate to abrt-backtrace, to be able to use the new backtrace rating algorithm in scripts.
Diffstat (limited to 'inc')
-rw-r--r--inc/abrtlib.h50
1 files changed, 1 insertions, 49 deletions
diff --git a/inc/abrtlib.h b/inc/abrtlib.h
index 7b00fe35..7cafc99c 100644
--- a/inc/abrtlib.h
+++ b/inc/abrtlib.h
@@ -41,6 +41,7 @@
#include <string>
#include "abrt_types.h"
+#include "xfuncs.h"
/* Some libc's forget to declare these, do it ourself */
extern char **environ;
@@ -95,13 +96,6 @@ extern int g_verbose;
#define VERB3 if (g_verbose >= 3)
/* there is no level > 3 */
-
-void* xmalloc(size_t size);
-void* xrealloc(void *ptr, size_t size);
-void* xzalloc(size_t size);
-char* xstrdup(const char *s);
-char* xstrndup(const char *s, int n);
-
char* skip_whitespace(const char *s);
char* skip_non_whitespace(const char *s);
@@ -123,38 +117,6 @@ extern ssize_t safe_write(int fd, const void *buf, size_t count);
// NB: will return short write on error, not -1,
// if some data was written before error occurred
extern ssize_t full_write(int fd, const void *buf, size_t count);
-extern void xwrite(int fd, const void *buf, size_t count);
-extern void xwrite_str(int fd, const char *str);
-
-void xpipe(int filedes[2]);
-void xdup(int from);
-void xdup2(int from, int to);
-off_t xlseek(int fd, off_t offset, int whence);
-void xsetenv(const char *key, const char *value);
-int xsocket(int domain, int type, int protocol);
-void xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen);
-void xlisten(int s, int backlog);
-ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to, socklen_t tolen);
-void xchdir(const char *path);
-void xstat(const char *name, struct stat *stat_buf);
-/* Just testing dent->d_type == DT_REG is wrong: some filesystems
- * do not report the type, they report DT_UNKNOWN for every dirent
- * (and this is not a bug in filesystem, this is allowed by standards).
- * This function handles this case. Note: it returns 0 on symlinks
- * even if they point to regular files.
- */
-int is_regular_file(struct dirent *dent, const char *dirname);
-
-void xmove_fd(int from, int to);
-int ndelay_on(int fd);
-int ndelay_off(int fd);
-int close_on_exec_on(int fd);
-char* xasprintf(const char *format, ...);
-char* xvasprintf(const char *format, va_list p);
-
-int xopen(const char *pathname, int flags);
-int xopen3(const char *pathname, int flags, int mode);
-void xunlink(const char *pathname);
/* copyfd_XX print read/write errors and return -1 if they occur */
off_t copyfd_eof(int src_fd, int dst_fd);
@@ -162,9 +124,6 @@ off_t copyfd_size(int src_fd, int dst_fd, off_t size);
void copyfd_exact_size(int src_fd, int dst_fd, off_t size);
off_t copy_file(const char *src_name, const char *dst_name, int mode);
-
-void xsetreuid(uid_t ruid, uid_t euid);
-void xsetregid(gid_t rgid, gid_t egid);
enum {
EXECFLG_INPUT = 1 << 0,
EXECFLG_OUTPUT = 1 << 1,
@@ -249,15 +208,8 @@ int daemon_is_ok();
/* Returns malloc'ed block */
char *encode_base64(const void *src, int length);
-bool dot_or_dotdot(const char *filename);
-char *last_char_is(const char *s, int c);
-bool string_to_bool(const char *s);
/* C++ style stuff */
-
-std::string ssprintf(const char *format, ...);
-std::string get_home_dir(uid_t uid);
-std::string concat_path_file(const char *path, const char *filename);
double get_dirsize(const char *pPath);
double get_dirsize_find_largest_dir(
const char *pPath,