[dovecot-cvs] dovecot/src/lib failures.c,1.17,1.18 failures.h,1.7,1.8 hash.c,1.16,1.17 hash.h,1.9,1.10
cras at procontrol.fi
cras at procontrol.fi
Mon Jan 27 04:00:02 EET 2003
- Previous message: [dovecot-cvs] dovecot/src/lib-storage mail-storage.h,1.32,1.33
- Next message: [dovecot-cvs] dovecot/src/lib-mail message-content-parser.c,1.8,1.9 message-content-parser.h,1.6,1.7 message-header-decode.c,1.3,1.4 message-header-decode.h,1.2,1.3 message-parser.c,1.33,1.34 message-parser.h,1.17,1.18 message-tokenize.c,1.3,1.4 Message-Id: <20030127020002.6D7F423995@danu.procontrol.fi>
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/lib
In directory danu:/tmp/cvs-serv24859/src/lib
Modified Files:
failures.c failures.h hash.c hash.h
Log Message:
Function typedefs now define them as functions, not function pointers.
Index: failures.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/failures.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- failures.c 11 Jan 2003 19:55:56 -0000 1.17
+++ failures.c 27 Jan 2003 01:59:59 -0000 1.18
@@ -44,13 +44,13 @@
static void default_info_handler(const char *format, va_list args);
/* Initialize working defaults */
-static failure_callback_t panic_handler __attr_noreturn__ =
+static failure_callback_t *panic_handler __attr_noreturn__ =
default_panic_handler;
-static fatal_failure_callback_t fatal_handler __attr_noreturn__ =
+static fatal_failure_callback_t *fatal_handler __attr_noreturn__ =
default_fatal_handler;
-static failure_callback_t error_handler = default_error_handler;
-static failure_callback_t warning_handler = default_warning_handler;
-static failure_callback_t info_handler = default_info_handler;
+static failure_callback_t *error_handler = default_error_handler;
+static failure_callback_t *warning_handler = default_warning_handler;
+static failure_callback_t *info_handler = default_info_handler;
static FILE *log_fd = NULL, *log_info_fd = NULL;
static char *log_prefix = NULL, *log_stamp_format = NULL;
@@ -243,35 +243,35 @@
va_end(args);
}
-void i_set_panic_handler(failure_callback_t callback __attr_noreturn__)
+void i_set_panic_handler(failure_callback_t *callback __attr_noreturn__)
{
if (callback == NULL)
callback = default_panic_handler;
panic_handler = callback;
}
-void i_set_fatal_handler(fatal_failure_callback_t callback __attr_noreturn__)
+void i_set_fatal_handler(fatal_failure_callback_t *callback __attr_noreturn__)
{
if (callback == NULL)
callback = default_fatal_handler;
fatal_handler = callback;
}
-void i_set_error_handler(failure_callback_t callback)
+void i_set_error_handler(failure_callback_t *callback)
{
if (callback == NULL)
callback = default_error_handler;
error_handler = callback;
}
-void i_set_warning_handler(failure_callback_t callback)
+void i_set_warning_handler(failure_callback_t *callback)
{
if (callback == NULL)
callback = default_warning_handler;
warning_handler = callback;
}
-void i_set_info_handler(failure_callback_t callback)
+void i_set_info_handler(failure_callback_t *callback)
{
if (callback == NULL)
callback = default_info_handler;
Index: failures.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/failures.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- failures.h 11 Jan 2003 19:55:56 -0000 1.7
+++ failures.h 27 Jan 2003 01:59:59 -0000 1.8
@@ -14,8 +14,8 @@
#define DEFAULT_FAILURE_STAMP_FORMAT "%b %d %H:%M:%S "
-typedef void (*failure_callback_t)(const char *, va_list);
-typedef void (*fatal_failure_callback_t)(int status, const char *, va_list);
+typedef void failure_callback_t(const char *, va_list);
+typedef void fatal_failure_callback_t(int status, const char *, va_list);
void i_panic(const char *format, ...) __attr_format__(1, 2) __attr_noreturn__;
void i_fatal(const char *format, ...) __attr_format__(1, 2) __attr_noreturn__;
@@ -27,11 +27,11 @@
__attr_format__(2, 3) __attr_noreturn__;
/* Change failure handlers. Make sure they don't modify errno. */
-void i_set_panic_handler(failure_callback_t callback __attr_noreturn__);
-void i_set_fatal_handler(fatal_failure_callback_t callback __attr_noreturn__);
-void i_set_error_handler(failure_callback_t callback);
-void i_set_warning_handler(failure_callback_t callback);
-void i_set_info_handler(failure_callback_t callback);
+void i_set_panic_handler(failure_callback_t *callback __attr_noreturn__);
+void i_set_fatal_handler(fatal_failure_callback_t *callback __attr_noreturn__);
+void i_set_error_handler(failure_callback_t *callback);
+void i_set_warning_handler(failure_callback_t *callback);
+void i_set_info_handler(failure_callback_t *callback);
/* Send failures to syslog() */
void i_syslog_panic_handler(const char *fmt, va_list args) __attr_noreturn__;
Index: hash.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/hash.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- hash.c 14 Jan 2003 12:09:33 -0000 1.16
+++ hash.c 27 Jan 2003 01:59:59 -0000 1.17
@@ -47,8 +47,8 @@
struct hash_node *nodes;
struct hash_node *free_nodes;
- hash_callback_t hash_cb;
- hash_cmp_callback_t key_compare_cb;
+ hash_callback_t *hash_cb;
+ hash_cmp_callback_t *key_compare_cb;
};
static int hash_resize(struct hash_table *table, int grow);
@@ -68,7 +68,7 @@
struct hash_table *
hash_create(pool_t table_pool, pool_t node_pool, size_t initial_size,
- hash_callback_t hash_cb, hash_cmp_callback_t key_compare_cb)
+ hash_callback_t *hash_cb, hash_cmp_callback_t *key_compare_cb)
{
struct hash_table *table;
@@ -342,7 +342,7 @@
return table->nodes_count;
}
-void hash_foreach(struct hash_table *table, hash_foreach_callback_t callback,
+void hash_foreach(struct hash_table *table, hash_foreach_callback_t *callback,
void *context)
{
struct hash_node *node;
Index: hash.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/hash.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- hash.h 11 Jan 2003 19:55:56 -0000 1.9
+++ hash.h 27 Jan 2003 01:59:59 -0000 1.10
@@ -2,10 +2,10 @@
#define __HASH_H
/* Returns hash code. */
-typedef unsigned int (*hash_callback_t)(const void *p);
+typedef unsigned int hash_callback_t(const void *p);
/* Returns 0 if the pointers are equal. */
-typedef int (*hash_cmp_callback_t)(const void *p1, const void *p2);
-typedef void (*hash_foreach_callback_t)(void *key, void *value, void *context);
+typedef int hash_cmp_callback_t(const void *p1, const void *p2);
+typedef void hash_foreach_callback_t(void *key, void *value, void *context);
/* Create a new hash table. If initial_size is 0, the default value is used.
If hash_cb or key_compare_cb is NULL, direct hashing/comparing is used.
@@ -15,7 +15,7 @@
be free'd before hash_destroy() is called. */
struct hash_table *
hash_create(pool_t table_pool, pool_t node_pool, size_t initial_size,
- hash_callback_t hash_cb, hash_cmp_callback_t key_compare_cb);
+ hash_callback_t *hash_cb, hash_cmp_callback_t *key_compare_cb);
void hash_destroy(struct hash_table *table);
/* Remove all nodes from hash table. If free_collisions is TRUE, the
@@ -39,7 +39,7 @@
call hash_*() functions inside your function, but if you add any
new nodes, they may or may not be called for in this foreach loop. */
void hash_foreach(struct hash_table *table,
- hash_foreach_callback_t callback, void *context);
+ hash_foreach_callback_t *callback, void *context);
/* Stop the active hash_foreach() loop */
void hash_foreach_stop(void);
- Previous message: [dovecot-cvs] dovecot/src/lib-storage mail-storage.h,1.32,1.33
- Next message: [dovecot-cvs] dovecot/src/lib-mail message-content-parser.c,1.8,1.9 message-content-parser.h,1.6,1.7 message-header-decode.c,1.3,1.4 message-header-decode.h,1.2,1.3 message-parser.c,1.33,1.34 message-parser.h,1.17,1.18 message-tokenize.c,1.3,1.4 Message-Id: <20030127020002.6D7F423995@danu.procontrol.fi>
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list