]> git.tuebingen.mpg.de Git - adu.git/commitdiff
Replace para_ prefix by adu_.
authorAndre Noll <maan@systemlinux.org>
Sun, 1 Jun 2008 12:20:02 +0000 (14:20 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 1 Jun 2008 12:20:02 +0000 (14:20 +0200)
adu.c
adu.h
fd.c
fd.h
string.c
string.h

diff --git a/adu.c b/adu.c
index 54af136ad789314b88392658077fa88c926d766f..97d55e115774a1373791b5a4fa0f7c1e89df8510 100644 (file)
--- a/adu.c
+++ b/adu.c
@@ -75,7 +75,7 @@ static inline int check_uid_arg(const char *arg, uint32_t *uid)
         * returns a signed value.
         */
        int64_t val;
-       int ret = para_atoi64(arg, &val);
+       int ret = atoi64(arg, &val);
 
        if (ret < 0)
                return ret;
@@ -88,7 +88,7 @@ static inline int check_uid_arg(const char *arg, uint32_t *uid)
 static int parse_uid_range(const char *orig_arg, struct uid_range *ur)
 {
        int ret;
-       char *arg = para_strdup(orig_arg), *p = strchr(arg, '-');
+       char *arg = adu_strdup(orig_arg), *p = strchr(arg, '-');
 
        if (!p || p == arg) { /* -42 or 42 */
                ret = check_uid_arg(p? p + 1 : arg, &ur->high);
@@ -320,11 +320,11 @@ static int open_user_table(struct user_info *ui, int create)
 {
        int ret;
 
-       ui->desc = para_malloc(sizeof(*ui->desc));
+       ui->desc = adu_malloc(sizeof(*ui->desc));
        ui->desc->num_columns = NUM_UT_COLUMNS;
        ui->desc->flags = 0;
        ui->desc->column_descriptions = user_table_cols;
-       ui->desc->dir = para_strdup(conf.database_dir_arg);
+       ui->desc->dir = adu_strdup(conf.database_dir_arg);
        ui->desc->name = make_message("%u", (unsigned)ui->uid);
        INFO_LOG(".............................uid #%u: %u\n",
                (unsigned)num_uids, (unsigned)ui->uid);
@@ -357,7 +357,7 @@ static uint32_t uid_hash_table_size = 1 << uid_hash_bits;
 
 static void create_hash_table(void)
 {
-       uid_hash_table = para_calloc(uid_hash_table_size
+       uid_hash_table = adu_calloc(uid_hash_table_size
                * sizeof(struct user_info));
 }
 
@@ -371,7 +371,7 @@ static int create_tables(void)
 {
        int ret;
 
-       dir_table_desc.dir = para_strdup(conf.database_dir_arg);
+       dir_table_desc.dir = adu_strdup(conf.database_dir_arg);
        ret = osl(osl_create_table(&dir_table_desc));
        if (ret < 0)
                return ret;
@@ -576,7 +576,7 @@ static uint64_t num_dirs;
 static uint64_t num_files;
 static uint64_t num_bytes;
 
-int scan_dir(char *dirname, uint64_t *parent_dir_num)
+static int scan_dir(char *dirname, uint64_t *parent_dir_num)
 {
        DIR *dir;
        struct dirent *entry;
@@ -586,7 +586,7 @@ int scan_dir(char *dirname, uint64_t *parent_dir_num)
 
        check_signals();
        DEBUG_LOG("----------------- %llu: %s\n", (long long unsigned)num_dirs, dirname);
-       ret = para_opendir(dirname, &dir, &cwd_fd);
+       ret = adu_opendir(dirname, &dir, &cwd_fd);
        if (ret < 0) {
                if (ret != -ERRNO_TO_ERROR(EACCES))
                        return ret;
@@ -638,7 +638,7 @@ int scan_dir(char *dirname, uint64_t *parent_dir_num)
                        &dir_size, &dir_files);
 out:
        closedir(dir);
-       ret2 = para_fchdir(cwd_fd);
+       ret2 = adu_fchdir(cwd_fd);
        if (ret2 < 0 && ret >= 0)
                ret = ret2;
        close(cwd_fd);
@@ -665,7 +665,7 @@ again:
                free(result);
                result = tmp;
        } else
-               result = para_strdup((char *)obj.data);
+               result = adu_strdup((char *)obj.data);
        ret = osl(osl_get_object(dir_table, row, DT_PARENT_NUM, &obj));
        if (ret < 0)
                goto out;
@@ -691,7 +691,7 @@ static int get_dir_name_of_row(struct osl_row *dir_table_row, char **name)
        ret = osl(osl_get_object(dir_table, dir_table_row, DT_NAME, &obj));
        if (ret < 0)
                return ret;
-       this_dir = para_strdup((char *)obj.data);
+       this_dir = adu_strdup((char *)obj.data);
        ret = osl(osl_get_object(dir_table, dir_table_row, DT_PARENT_NUM, &obj));
        if (ret < 0)
                goto out;
@@ -1090,7 +1090,7 @@ static int write_uid_list(void)
 
        if (!num_uids)
                return 0;
-       buf = para_malloc(size);
+       buf = adu_malloc(size);
        FOR_EACH_USER(ui) {
                if (!ui_used(ui) || !ui_admissible(ui))
                        continue;
@@ -1098,7 +1098,7 @@ static int write_uid_list(void)
                write_u32(buf + count++ * sizeof(uint32_t), ui->uid);
        }
        filename = get_uid_list_name();
-       ret = para_write_file(filename, buf, size);
+       ret = adu_write_file(filename, buf, size);
        free(filename);
        free(buf);
        return ret;
@@ -1107,7 +1107,7 @@ static int write_uid_list(void)
 static int open_dir_table(void)
 {
        if (!dir_table_desc.dir) /* we did not create the table */
-               dir_table_desc.dir = para_strdup(conf.database_dir_arg);
+               dir_table_desc.dir = adu_strdup(conf.database_dir_arg);
        return osl(osl_open_table(&dir_table_desc, &dir_table));
 }
 static int com_create()
@@ -1158,7 +1158,7 @@ static int read_uid_file(void)
                        goto out;
        }
 out:
-       para_munmap(map, size);
+       adu_munmap(map, size);
        return ret;
 }
 
@@ -1207,7 +1207,7 @@ static int check_args(void)
        }
        if (!conf.uid_given)
                return 0;
-       admissible_uids = para_malloc(conf.uid_given * sizeof(*admissible_uids));
+       admissible_uids = adu_malloc(conf.uid_given * sizeof(*admissible_uids));
        for (i = 0; i < conf.uid_given; i++) {
                ret = parse_uid_range(conf.uid_arg[i], admissible_uids + i);
                if (ret < 0)
diff --git a/adu.h b/adu.h
index 1e6519bc91c12fb6a03307042de9c56f97c1c92b..775af7faef3c85bfc3890e87426b044f161a552b 100644 (file)
--- a/adu.h
+++ b/adu.h
@@ -107,7 +107,7 @@ __printf_2_3 void __log(int, const char*, ...);
 { \
        int n; \
        size_t size = 100; \
-       p = para_malloc(size); \
+       p = adu_malloc(size); \
        while (1) { \
                va_list ap; \
                /* Try to print in the allocated space. */ \
@@ -122,6 +122,6 @@ __printf_2_3 void __log(int, const char*, ...);
                        size = n + 1; /* precisely what is needed */ \
                else /* glibc 2.0 */ \
                        size *= 2; /* twice the old size */ \
-               p = para_realloc(p, size); \
+               p = adu_realloc(p, size); \
        } \
 }
diff --git a/fd.c b/fd.c
index 40eb2fa1e6c3d1562d444a35f682a580c3327626..5c125faaf90e9cdd5e7d725a933c30eddc6d7e32 100644 (file)
--- a/fd.c
+++ b/fd.c
@@ -98,7 +98,7 @@ static int __open(const char *path, int flags, mode_t mode)
  *
  * \return Standard.
  */
-int para_write_file(const char *filename, const void *buf, size_t size)
+int adu_write_file(const char *filename, const void *buf, size_t size)
 {
        int ret, fd;
 
@@ -155,7 +155,7 @@ int __chdir(const char *path)
  * \sa getcwd(3).
  *
  */
-int para_opendir(const char *dirname, DIR **dir, int *cwd)
+int adu_opendir(const char *dirname, DIR **dir, int *cwd)
 {
        int ret;
 
@@ -188,7 +188,7 @@ close_cwd:
  *
  * \return Standard.
  */
-int para_fchdir(int fd)
+int adu_fchdir(int fd)
 {
        if (fchdir(fd) < 0)
                return -ERRNO_TO_ERROR(errno);
@@ -263,7 +263,7 @@ out:
  *
  * \sa munmap(2), mmap_full_file().
  */
-int para_munmap(void *start, size_t length)
+int adu_munmap(void *start, size_t length)
 {
        int err;
        if (munmap(start, length) >= 0)
diff --git a/fd.h b/fd.h
index ad8194206580b07008311a64e0360ca09aca81e4..87083c2dcc81292499b417cd7c7366e205ad6295 100644 (file)
--- a/fd.h
+++ b/fd.h
@@ -6,9 +6,9 @@
 
 /** \file fd.h exported symbols from fd.c */
 
-int para_opendir(const char *dirname, DIR **dir, int *cwd);
-int para_fchdir(int fd);
+int adu_opendir(const char *dirname, DIR **dir, int *cwd);
+int adu_fchdir(int fd);
 int mmap_full_file(const char *filename, int open_mode, void **map,
        size_t *size, int *fd_ptr);
-int para_munmap(void *start, size_t length);
-int para_write_file(const char *filename, const void *buf, size_t size);
+int adu_munmap(void *start, size_t length);
+int adu_write_file(const char *filename, const void *buf, size_t size);
index 8bd34460877a389a40a85bccb67dfed49ead9871..a0666d35bde5d038bb0df48c954618f1041af16a 100644 (file)
--- a/string.c
+++ b/string.c
@@ -25,7 +25,7 @@
  *
  * \sa realloc(3).
  */
-__must_check __malloc void *para_realloc(void *p, size_t size)
+__must_check __malloc void *adu_realloc(void *p, size_t size)
 {
        /*
         * No need to check for NULL pointers: If p is NULL, the  call
@@ -52,7 +52,7 @@ __must_check __malloc void *para_realloc(void *p, size_t size)
  *
  * \sa malloc(3).
  */
-__must_check __malloc void *para_malloc(size_t size)
+__must_check __malloc void *adu_malloc(size_t size)
 {
        assert(size);
        void *p = malloc(size);
@@ -77,9 +77,9 @@ __must_check __malloc void *para_malloc(size_t size)
  *
  * \sa calloc(3)
  */
-__must_check __malloc void *para_calloc(size_t size)
+__must_check __malloc void *adu_calloc(size_t size)
 {
-       void *ret = para_malloc(size);
+       void *ret = adu_malloc(size);
 
        memset(ret, 0, size);
        return ret;
@@ -98,7 +98,7 @@ __must_check __malloc void *para_calloc(size_t size)
  *
  * \sa strdup(3)
  */
-__must_check __malloc char *para_strdup(const char *s)
+__must_check __malloc char *adu_strdup(const char *s)
 {
        char *ret;
 
@@ -148,7 +148,7 @@ __must_check __printf_1_2 __malloc char *make_message(const char *fmt, ...)
  *
  * \sa strtol(3), atoi(3).
  */
-int para_atoi64(const char *str, int64_t *value)
+__must_check int atoi64(const char *str, int64_t *result)
 {
        char *endptr;
        long long tmp;
@@ -163,6 +163,6 @@ int para_atoi64(const char *str, int64_t *value)
                return -E_ATOI_NO_DIGITS;
        if (*endptr != '\0') /* Further characters after number */
                return -E_ATOI_JUNK_AT_END;
-       *value = tmp;
+       *result = tmp;
        return 1;
 }
index c98ed89e1769265052b92dd794f9b1457c9d8ac6..ebf3b17903565dfeff7742fba9a0ef0f0f50b364 100644 (file)
--- a/string.h
+++ b/string.h
@@ -6,9 +6,9 @@
 
 /** \file string.h exported sybmols from string.c */
 
-__must_check __malloc void *para_realloc(void *p, size_t size);
-__must_check __malloc void *para_malloc(size_t size);
-__must_check __malloc void *para_calloc(size_t size);
-__must_check __malloc char *para_strdup(const char *s);
+__must_check __malloc void *adu_realloc(void *p, size_t size);
+__must_check __malloc void *adu_malloc(size_t size);
+__must_check __malloc void *adu_calloc(size_t size);
+__must_check __malloc char *adu_strdup(const char *s);
 __must_check __malloc __printf_1_2 char *make_message(const char *fmt, ...);
-int para_atoi64(const char *str, int64_t *result);
+__must_check int atoi64(const char *str, int64_t *result);