[dovecot-cvs] dovecot/src/lib failures.c,1.16,1.17 failures.h,1.6,1.7 file-lock.c,1.4,1.5 file-lock.h,1.3,1.4 hash.c,1.12,1.13 hash.h,1.8,1.9 ioloop-internal.h,1.3,1.4 ioloop-poll.c,1.8,1.9 ioloop-select.c,1.9,1.10 ioloop.c,1.9,1.10 ioloop.h,1.5,1.6 Message-Id: <20030111195559.01A1A238C5@danu.procontrol.fi>

cras at procontrol.fi cras at procontrol.fi
Sat Jan 11 21:55:59 EET 2003


Update of /home/cvs/dovecot/src/lib
In directory danu:/tmp/cvs-serv27659/lib

Modified Files:
	failures.c failures.h file-lock.c file-lock.h hash.c hash.h 
	ioloop-internal.h ioloop-poll.c ioloop-select.c ioloop.c 
	ioloop.h iostream-internal.h iostream.c istream-data.c 
	istream-file.c istream-mmap.c istream.c istream.h 
	ostream-file.c ostream.c ostream.h 
Log Message:
Naming change for function typedefs.



Index: failures.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/failures.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- failures.c	28 Dec 2002 08:06:34 -0000	1.16
+++ failures.c	11 Jan 2003 19:55:56 -0000	1.17
@@ -44,11 +44,13 @@
 static void default_info_handler(const char *format, va_list args);
 
 /* Initialize working defaults */
-static FailureFunc panic_handler __attr_noreturn__ = default_panic_handler;
-static FatalFailureFunc fatal_handler __attr_noreturn__ = default_fatal_handler;
-static FailureFunc error_handler = default_error_handler;
-static FailureFunc warning_handler = default_warning_handler;
-static FailureFunc info_handler = default_info_handler;
+static failure_callback_t panic_handler __attr_noreturn__ =
+	default_panic_handler;
+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 FILE *log_fd = NULL, *log_info_fd = NULL;
 static char *log_prefix = NULL, *log_stamp_format = NULL;
@@ -241,39 +243,39 @@
 	va_end(args);
 }
 
-void i_set_panic_handler(FailureFunc func __attr_noreturn__)
+void i_set_panic_handler(failure_callback_t callback __attr_noreturn__)
 {
-	if (func == NULL)
-		func = default_panic_handler;
-        panic_handler = func;
+	if (callback == NULL)
+		callback = default_panic_handler;
+        panic_handler = callback;
 }
 
-void i_set_fatal_handler(FatalFailureFunc func __attr_noreturn__)
+void i_set_fatal_handler(fatal_failure_callback_t callback __attr_noreturn__)
 {
-	if (func == NULL)
-		func = default_fatal_handler;
-        fatal_handler = func;
+	if (callback == NULL)
+		callback = default_fatal_handler;
+        fatal_handler = callback;
 }
 
-void i_set_error_handler(FailureFunc func)
+void i_set_error_handler(failure_callback_t callback)
 {
-	if (func == NULL)
-		func = default_error_handler;
-        error_handler = func;
+	if (callback == NULL)
+		callback = default_error_handler;
+        error_handler = callback;
 }
 
-void i_set_warning_handler(FailureFunc func)
+void i_set_warning_handler(failure_callback_t callback)
 {
-	if (func == NULL)
-		func = default_warning_handler;
-        warning_handler = func;
+	if (callback == NULL)
+		callback = default_warning_handler;
+        warning_handler = callback;
 }
 
-void i_set_info_handler(FailureFunc func)
+void i_set_info_handler(failure_callback_t callback)
 {
-	if (func == NULL)
-		func = default_info_handler;
-        info_handler = func;
+	if (callback == NULL)
+		callback = default_info_handler;
+        info_handler = callback;
 }
 
 static int syslog_handler(int level, const char *format, va_list args)

Index: failures.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/failures.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- failures.h	5 Jan 2003 13:09:51 -0000	1.6
+++ failures.h	11 Jan 2003 19:55:56 -0000	1.7
@@ -14,8 +14,8 @@
 
 #define DEFAULT_FAILURE_STAMP_FORMAT "%b %d %H:%M:%S "
 
-typedef void (*FailureFunc) (const char *, va_list);
-typedef void (*FatalFailureFunc) (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(FailureFunc func __attr_noreturn__);
-void i_set_fatal_handler(FatalFailureFunc func __attr_noreturn__);
-void i_set_error_handler(FailureFunc func);
-void i_set_warning_handler(FailureFunc func);
-void i_set_info_handler(FailureFunc func);
+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: file-lock.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/file-lock.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- file-lock.c	25 Nov 2002 19:02:49 -0000	1.4
+++ file-lock.c	11 Jan 2003 19:55:56 -0000	1.5
@@ -31,7 +31,7 @@
 #include <signal.h>
 
 static int file_lock(int fd, int wait_lock, int lock_type, unsigned int timeout,
-		     void (*func)(unsigned int secs_left, void *context),
+		     void (*callback)(unsigned int secs_left, void *context),
 		     void *context)
 {
 	struct flock fl;
@@ -62,8 +62,8 @@
 			return 0;
 		}
 
-		if (func != NULL)
-			func(timeout_time - now, context);
+		if (callback != NULL)
+			callback(timeout_time - now, context);
 	}
 
 	return 1;
@@ -81,8 +81,8 @@
 }
 
 int file_wait_lock_full(int fd, int lock_type, unsigned int timeout,
-			void (*func)(unsigned int secs_left, void *context),
+			void (*callback)(unsigned int secs_left, void *context),
 			void *context)
 {
-	return file_lock(fd, TRUE, lock_type, timeout, func, context);
+	return file_lock(fd, TRUE, lock_type, timeout, callback, context);
 }

Index: file-lock.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/file-lock.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- file-lock.h	25 Nov 2002 19:02:49 -0000	1.3
+++ file-lock.h	11 Jan 2003 19:55:56 -0000	1.4
@@ -15,10 +15,10 @@
    DEFAULT_LOCK_TIMEOUT. */
 int file_wait_lock(int fd, int lock_type);
 
-/* Like file_wait_lock(), but you can specify the timout and a function which
+/* Like file_wait_lock(), but you can specify the timout and a callback which
    is called once in a while if waiting takes longer. */
 int file_wait_lock_full(int fd, int lock_type, unsigned int timeout,
-			void (*func)(unsigned int secs_left, void *context),
+			void (*callback)(unsigned int secs_left, void *context),
 			void *context);
 
 #endif

Index: hash.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/hash.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- hash.c	11 Jan 2003 17:42:55 -0000	1.12
+++ hash.c	11 Jan 2003 19:55:56 -0000	1.13
@@ -63,8 +63,8 @@
 
 	struct collision_node *free_cnodes;
 
-	HashFunc hash_func;
-	HashCompareFunc key_compare_func;
+	hash_callback_t hash_cb;
+	hash_cmp_callback_t key_compare_cb;
 };
 
 static int hash_resize(struct hash_table *table);
@@ -82,9 +82,9 @@
 	return POINTER_CAST_TO(p, unsigned int);
 }
 
-struct hash_table *hash_create(pool_t table_pool, pool_t node_pool,
-			       size_t initial_size, HashFunc hash_func,
-			       HashCompareFunc key_compare_func)
+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)
 {
 	struct hash_table *table;
 
@@ -94,9 +94,9 @@
 	table->size = I_MAX(primes_closest(initial_size),
 			    HASH_TABLE_MIN_SIZE);
 
-	table->hash_func = hash_func != NULL ? hash_func : direct_hash;
-	table->key_compare_func = key_compare_func == NULL ?
-		direct_cmp : key_compare_func;
+	table->hash_cb = hash_cb != NULL ? hash_cb : direct_hash;
+	table->key_compare_cb = key_compare_cb == NULL ?
+		direct_cmp : key_compare_cb;
 	table->nodes = p_new(table_pool, struct hash_node, table->size);
 	table->collisions_size = I_MAX(table->size / 10, COLLISIONS_MIN_SIZE);
 	table->collisions = p_new(table_pool, struct collision_node,
@@ -180,7 +180,7 @@
 	cnode = &table->collisions[hash % table->collisions_size];
 	do {
 		if (cnode->node.key != NULL) {
-			if (table->key_compare_func(cnode->node.key, key) == 0)
+			if (table->key_compare_cb(cnode->node.key, key) == 0)
 				return &cnode->node;
 		}
 		cnode = cnode->next;
@@ -200,7 +200,7 @@
 		if (table->removed_count == 0)
 			return NULL;
 	} else {
-		if (table->key_compare_func(node->key, key) == 0)
+		if (table->key_compare_cb(node->key, key) == 0)
 			return node;
 	}
 
@@ -211,7 +211,7 @@
 {
 	struct hash_node *node;
 
-	node = hash_lookup_node(table, key, table->hash_func(key));
+	node = hash_lookup_node(table, key, table->hash_cb(key));
 	return node != NULL ? node->value : NULL;
 }
 
@@ -221,7 +221,7 @@
 	struct hash_node *node;
 
 	node = hash_lookup_node(table, lookup_key,
-				table->hash_func(lookup_key));
+				table->hash_cb(lookup_key));
 	if (node == NULL)
 		return FALSE;
 
@@ -242,7 +242,7 @@
 
 	i_assert(key != NULL);
 
-	hash = table->hash_func(key);
+	hash = table->hash_cb(key);
 
 	if (check_existing && table->removed_count > 0) {
 		/* there may be holes, have to check everything */
@@ -264,7 +264,7 @@
 	}
 
 	if (check_existing) {
-		if (table->key_compare_func(node->key, key) == 0)
+		if (table->key_compare_cb(node->key, key) == 0)
 			return node;
 	}
 
@@ -277,7 +277,7 @@
 			break;
 
 		if (check_existing) {
-			if (table->key_compare_func(cnode->node.key, key) == 0)
+			if (table->key_compare_cb(cnode->node.key, key) == 0)
 				return node;
 		}
 
@@ -366,7 +366,7 @@
 
 		/* see if node in primary table was deleted */
 		if (hash == 0)
-			hash = table->hash_func(croot->node.key);
+			hash = table->hash_cb(croot->node.key);
 		node = &table->nodes[hash % table->size];
 		if (node->key == NULL) {
 			memcpy(node, &croot->node, sizeof(*node));
@@ -398,7 +398,7 @@
 	struct hash_node *node;
 	unsigned int hash;
 
-	hash = table->hash_func(key);
+	hash = table->hash_cb(key);
 
 	node = hash_lookup_node(table, key, hash);
 	node->key = NULL;
@@ -414,7 +414,8 @@
 	return table->nodes_count;
 }
 
-void hash_foreach(struct hash_table *table, HashForeachFunc func, void *context)
+void hash_foreach(struct hash_table *table, hash_foreach_callback_t callback,
+		  void *context)
 {
 	struct hash_node *node;
 	struct collision_node *cnode;
@@ -428,7 +429,7 @@
 		node = &table->nodes[i];
 
 		if (node->key != NULL) {
-			func(node->key, node->value, context);
+			callback(node->key, node->value, context);
 			if (foreach_stop) {
 				table->frozen--;
 				return;
@@ -442,8 +443,8 @@
 
 			do {
 				if (cnode->node.key != NULL) {
-					func(cnode->node.key, cnode->node.value,
-					     context);
+					callback(cnode->node.key,
+						 cnode->node.value, context);
 					if (foreach_stop) {
 						table->frozen--;
 						return;

Index: hash.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/hash.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- hash.h	11 Jan 2003 17:42:55 -0000	1.8
+++ hash.h	11 Jan 2003 19:55:56 -0000	1.9
@@ -2,21 +2,20 @@
 #define __HASH_H
 
 /* Returns hash code. */
-typedef unsigned int (*HashFunc) (const void *p);
+typedef unsigned int (*hash_callback_t)(const void *p);
 /* Returns 0 if the pointers are equal. */
-typedef int (*HashCompareFunc) (const void *p1, const void *p2);
-typedef void (*HashForeachFunc) (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_func or key_compare_func is NULL, direct hashing/comparing
-   is used.
+   If hash_cb or key_compare_cb is NULL, direct hashing/comparing is used.
 
    table_pool is used to allocate/free large hash tables, node_pool is used
    for smaller allocations and can also be alloconly pool. The pools must not
    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, HashFunc hash_func,
-			       HashCompareFunc key_compare_func);
+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);
 void hash_destroy(struct hash_table *table);
 
 /* Remove all nodes from hash table. If free_collisions is TRUE, the
@@ -40,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,
-		  HashForeachFunc func, void *context);
+		  hash_foreach_callback_t callback, void *context);
 /* Stop the active hash_foreach() loop */
 void hash_foreach_stop(void);
 

Index: ioloop-internal.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/ioloop-internal.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ioloop-internal.h	5 Jan 2003 13:09:51 -0000	1.3
+++ ioloop-internal.h	11 Jan 2003 19:55:56 -0000	1.4
@@ -29,7 +29,7 @@
 	unsigned int destroyed:1;
 	unsigned int invalid:1;
 
-	IOFunc func;
+	io_callback_t callback;
         void *context;
 };
 
@@ -41,7 +41,7 @@
 	int run_now;
         int destroyed;
 
-	TimeoutFunc func;
+	timeout_callback_t callback;
         void *context;
 };
 

Index: ioloop-poll.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/ioloop-poll.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- ioloop-poll.c	10 Jan 2003 20:58:28 -0000	1.8
+++ ioloop-poll.c	11 Jan 2003 19:55:56 -0000	1.9
@@ -188,8 +188,8 @@
 		if (pollfd->revents & POLLNVAL) {
 			if (!io->invalid) {
 				io->invalid = TRUE;
-				i_warning("invalid I/O fd %d, func %p",
-					  io->fd, (void *) io->func);
+				i_warning("invalid I/O fd %d, callback %p",
+					  io->fd, (void *) io->callback);
 			}
 
                         continue;
@@ -209,7 +209,7 @@
 		}
 
 		t_id = t_push();
-		io->func(io->context, io->fd, io);
+		io->callback(io->context, io->fd, io);
 		if (t_pop() != t_id)
 			i_panic("Leaked a t_pop() call!");
 

Index: ioloop-select.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/ioloop-select.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ioloop-select.c	5 Jan 2003 13:09:51 -0000	1.9
+++ ioloop-select.c	11 Jan 2003 19:55:56 -0000	1.10
@@ -126,7 +126,7 @@
                         continue;
 
 		t_id = t_push();
-		io->func(io->context, io->fd, io);
+		io->callback(io->context, io->fd, io);
 		if (t_pop() != t_id)
 			i_panic("Leaked a t_pop() call!");
 

Index: ioloop.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/ioloop.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ioloop.c	5 Jan 2003 13:09:51 -0000	1.9
+++ ioloop.c	11 Jan 2003 19:55:56 -0000	1.10
@@ -83,26 +83,26 @@
 	}
 }
 
-struct io *io_add(int fd, int condition, IOFunc func, void *data)
+struct io *io_add(int fd, int condition, io_callback_t callback, void *data)
 {
 	return io_add_priority(fd, IO_PRIORITY_DEFAULT,
-			       condition, func, data);
+			       condition, callback, data);
 }
 
 struct io *io_add_priority(int fd, int priority, int condition,
-			   IOFunc func, void *context)
+			   io_callback_t callback, void *context)
 {
 	struct io *io;
 
 	i_assert(fd >= 0);
-	i_assert(func != NULL);
+	i_assert(callback != NULL);
 
 	io = p_new(current_ioloop->pool, struct io, 1);
 	io->fd = fd;
 	io->priority = priority;
         io->condition = condition;
 
-	io->func = func;
+	io->callback = callback;
         io->context = context;
 
 	if (io->fd > current_ioloop->highest_fd)
@@ -184,14 +184,15 @@
 	}
 }
 
-struct timeout *timeout_add(int msecs, TimeoutFunc func, void *context)
+struct timeout *timeout_add(int msecs, timeout_callback_t callback,
+			    void *context)
 {
 	struct timeout *timeout;
 
 	timeout = p_new(current_ioloop->pool, struct timeout, 1);
         timeout->msecs = msecs;
 
-	timeout->func = func;
+	timeout->callback = callback;
 	timeout->context = context;
 
 	timeout_update_next(timeout, current_ioloop->running ?
@@ -280,7 +281,7 @@
                 timeout_update_next(t, &ioloop_timeval);
 
                 t_id = t_push();
-		t->func(t->context, t);
+		t->callback(t->context, t);
 		if (t_pop() != t_id)
                         i_panic("Leaked a t_pop() call!");
 	}
@@ -331,7 +332,7 @@
 
 		if (!io->destroyed) {
 			i_warning("I/O leak: %p (%d)",
-				  (void *) io->func, io->fd);
+				  (void *) io->callback, io->fd);
 			io_remove(io);
 		}
 		io_destroy(ioloop, io);
@@ -341,7 +342,7 @@
 		struct timeout *to = ioloop->timeouts;
 
 		if (!to->destroyed) {
-			i_warning("Timeout leak: %p", (void *) to->func);
+			i_warning("Timeout leak: %p", (void *) to->callback);
 			timeout_remove(to);
 		}
                 timeout_destroy(ioloop, to);

Index: ioloop.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/ioloop.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ioloop.h	5 Jan 2003 13:09:51 -0000	1.5
+++ ioloop.h	11 Jan 2003 19:55:56 -0000	1.6
@@ -14,8 +14,8 @@
 struct timeout;
 struct ioloop;
 
-typedef void (*IOFunc) (void *context, int fd, struct io *io);
-typedef void (*TimeoutFunc) (void *context, struct timeout *timeout);
+typedef void (*io_callback_t) (void *context, int fd, struct io *io);
+typedef void (*timeout_callback_t) (void *context, struct timeout *timeout);
 
 /* Time when the I/O loop started calling handlers.
    Can be used instead of time(NULL). */
@@ -26,13 +26,14 @@
 /* I/O listeners - you can create different handlers for IO_READ and IO_WRITE,
    but make sure you don't create multiple handlers of same type, it's not
    checked and removing one will stop the other from working as well. */
-struct io *io_add(int fd, int condition, IOFunc func, void *context);
+struct io *io_add(int fd, int condition, io_callback_t callback, void *context);
 struct io *io_add_priority(int fd, int priority, int condition,
-			   IOFunc func, void *context);
+			   io_callback_t callback, void *context);
 void io_remove(struct io *io);
 
 /* Timeout handlers */
-struct timeout *timeout_add(int msecs, TimeoutFunc func, void *context);
+struct timeout *timeout_add(int msecs, timeout_callback_t callback,
+			    void *context);
 void timeout_remove(struct timeout *timeout);
 
 void io_loop_run(struct ioloop *ioloop);

Index: iostream-internal.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/iostream-internal.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- iostream-internal.h	5 Jan 2003 13:09:51 -0000	1.2
+++ iostream-internal.h	11 Jan 2003 19:55:56 -0000	1.3
@@ -11,7 +11,7 @@
 	void (*destroy)(struct _iostream *stream);
 	void (*set_max_buffer_size)(struct _iostream *stream, size_t max_size);
 	void (*set_blocking)(struct _iostream *stream, int timeout_msecs,
-			     void (*timeout_func)(void *), void *context);
+			     void (*timeout_cb)(void *), void *context);
 };
 
 void _io_stream_init(pool_t pool, struct _iostream *stream);
@@ -20,7 +20,7 @@
 void _io_stream_close(struct _iostream *stream);
 void _io_stream_set_max_buffer_size(struct _iostream *stream, size_t max_size);
 void _io_stream_set_blocking(struct _iostream *stream, int timeout_msecs,
-			     void (*timeout_func)(void *), void *context);
+			     void (*timeout_cb)(void *), void *context);
 
 #define GET_TIMEOUT_TIME(fstream) \
         ((fstream)->timeout_msecs == 0 ? 0 : \

Index: iostream.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/iostream.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- iostream.c	5 Jan 2003 13:09:51 -0000	1.2
+++ iostream.c	11 Jan 2003 19:55:56 -0000	1.3
@@ -64,7 +64,7 @@
 }
 
 void _io_stream_set_blocking(struct _iostream *stream, int timeout_msecs,
-			     void (*timeout_func)(void *), void *context)
+			     void (*timeout_cb)(void *), void *context)
 {
-	stream->set_blocking(stream, timeout_msecs, timeout_func, context);
+	stream->set_blocking(stream, timeout_msecs, timeout_cb, context);
 }

Index: istream-data.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/istream-data.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- istream-data.c	5 Jan 2003 13:09:51 -0000	1.3
+++ istream-data.c	11 Jan 2003 19:55:56 -0000	1.4
@@ -41,7 +41,7 @@
 
 static void _set_blocking(struct _iostream *stream __attr_unused__,
 			  int timeout_msecs __attr_unused__,
-			  void (*timeout_func)(void *) __attr_unused__,
+			  void (*timeout_cb)(void *) __attr_unused__,
 			  void *context __attr_unused__)
 {
 }

Index: istream-file.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/istream-file.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- istream-file.c	10 Jan 2003 20:58:28 -0000	1.6
+++ istream-file.c	11 Jan 2003 19:55:56 -0000	1.7
@@ -46,7 +46,7 @@
 	uoff_t skip_left;
 
 	int timeout_msecs;
-	void (*timeout_func)(void *);
+	void (*timeout_cb)(void *);
 	void *timeout_context;
 
 	unsigned int file:1;
@@ -80,12 +80,12 @@
 }
 
 static void _set_blocking(struct _iostream *stream, int timeout_msecs,
-			  void (*timeout_func)(void *), void *context)
+			  void (*timeout_cb)(void *), void *context)
 {
 	struct file_istream *fstream = (struct file_istream *) stream;
 
 	fstream->timeout_msecs = timeout_msecs;
-	fstream->timeout_func = timeout_func;
+	fstream->timeout_cb = timeout_cb;
 	fstream->timeout_context = context;
 
 	net_set_nonblock(fstream->istream.fd, timeout_msecs == 0);
@@ -186,8 +186,8 @@
 	do {
 		if (ret == 0 && timeout_time > 0 && time(NULL) > timeout_time) {
 			/* timeouted */
-			if (fstream->timeout_func != NULL)
-				fstream->timeout_func(fstream->timeout_context);
+			if (fstream->timeout_cb != NULL)
+				fstream->timeout_cb(fstream->timeout_context);
 			stream->istream.stream_errno = EAGAIN;
 			return -1;
 		}

Index: istream-mmap.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/istream-mmap.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- istream-mmap.c	5 Jan 2003 13:09:51 -0000	1.2
+++ istream-mmap.c	11 Jan 2003 19:55:56 -0000	1.3
@@ -85,7 +85,7 @@
 
 static void _set_blocking(struct _iostream *stream __attr_unused__,
 			  int timeout_msecs __attr_unused__,
-			  void (*timeout_func)(void *) __attr_unused__,
+			  void (*timeout_cb)(void *) __attr_unused__,
 			  void *context __attr_unused__)
 {
 	/* we never block */

Index: istream.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/istream.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- istream.c	7 Jan 2003 17:44:23 -0000	1.4
+++ istream.c	11 Jan 2003 19:55:56 -0000	1.5
@@ -55,10 +55,10 @@
 }
 
 void i_stream_set_blocking(struct istream *stream, int timeout_msecs,
-			   void (*timeout_func)(void *), void *context)
+			   void (*timeout_cb)(void *), void *context)
 {
 	_io_stream_set_blocking(stream->real_stream, timeout_msecs,
-				timeout_func, context);
+				timeout_cb, context);
 }
 
 void i_stream_set_start_offset(struct istream *stream, uoff_t offset)

Index: istream.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/istream.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- istream.h	5 Jan 2003 13:09:51 -0000	1.3
+++ istream.h	11 Jan 2003 19:55:56 -0000	1.4
@@ -40,12 +40,12 @@
 /* Stream won't be read past specified offset. Giving 0 as offset
    removes the limit. */
 void i_stream_set_read_limit(struct istream *stream, uoff_t v_offset);
-/* Makes reads blocking until at least one byte is read. timeout_func is
+/* Makes reads blocking until at least one byte is read. timeout_cb is
    called if nothing is read in specified time. Setting timeout_msecs to 0
    makes it non-blocking. This call changes non-blocking state of file
    descriptor. */
 void i_stream_set_blocking(struct istream *stream, int timeout_msecs,
-			   void (*timeout_func)(void *), void *context);
+			   void (*timeout_cb)(void *), void *context);
 
 /* Returns number of bytes read if read was ok, -1 if EOF or error, -2 if the
    input buffer is full. */

Index: ostream-file.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/ostream-file.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ostream-file.c	10 Jan 2003 20:58:28 -0000	1.5
+++ ostream-file.c	11 Jan 2003 19:55:56 -0000	1.6
@@ -58,7 +58,7 @@
 	size_t head, tail; /* first unsent/unused byte */
 
 	int timeout_msecs;
-	void (*timeout_func)(void *);
+	void (*timeout_cb)(void *);
 	void *timeout_context;
 
 	unsigned int full:1; /* if head == tail, is buffer empty or full? */
@@ -108,12 +108,12 @@
 }
 
 static void _set_blocking(struct _iostream *stream, int timeout_msecs,
-			  void (*timeout_func)(void *), void *context)
+			  void (*timeout_cb)(void *), void *context)
 {
 	struct file_ostream *fstream = (struct file_ostream *) stream;
 
 	fstream->timeout_msecs = timeout_msecs;
-	fstream->timeout_func = timeout_func;
+	fstream->timeout_cb = timeout_cb;
 	fstream->timeout_context = context;
 
 	net_set_nonblock(fstream->fd, timeout_msecs == 0);
@@ -263,8 +263,8 @@
 			first = FALSE;
 		else if (timeout_time > 0 && time(NULL) > timeout_time) {
 			/* timeouted */
-			if (fstream->timeout_func != NULL)
-				fstream->timeout_func(fstream->timeout_context);
+			if (fstream->timeout_cb != NULL)
+				fstream->timeout_cb(fstream->timeout_context);
 			fstream->ostream.ostream.stream_errno = EAGAIN;
 			return -1;
 		}
@@ -531,8 +531,8 @@
 			first = FALSE;
 		else if (timeout_time > 0 && time(NULL) > timeout_time) {
 			/* timeouted */
-			if (foutstream->timeout_func != NULL) {
-				foutstream->timeout_func(
+			if (foutstream->timeout_cb != NULL) {
+				foutstream->timeout_cb(
 					foutstream->timeout_context);
 			}
 			outstream->ostream.stream_errno = EAGAIN;
@@ -617,8 +617,8 @@
 
 		if (timeout_time > 0 && time(NULL) > timeout_time) {
 			/* timeouted */
-			if (foutstream->timeout_func != NULL) {
-				foutstream->timeout_func(
+			if (foutstream->timeout_cb != NULL) {
+				foutstream->timeout_cb(
 					foutstream->timeout_context);
 			}
 			outstream->ostream.stream_errno = EAGAIN;

Index: ostream.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/ostream.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ostream.c	8 Jan 2003 23:35:09 -0000	1.5
+++ ostream.c	11 Jan 2003 19:55:56 -0000	1.6
@@ -49,10 +49,10 @@
 }
 
 void o_stream_set_blocking(struct ostream *stream, int timeout_msecs,
-			   void (*timeout_func)(void *), void *context)
+			   void (*timeout_cb)(void *), void *context)
 {
 	_io_stream_set_blocking(stream->real_stream, timeout_msecs,
-				timeout_func, context);
+				timeout_cb, context);
 }
 
 void o_stream_cork(struct ostream *stream)

Index: ostream.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/ostream.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ostream.h	5 Jan 2003 13:09:51 -0000	1.3
+++ ostream.h	11 Jan 2003 19:55:56 -0000	1.4
@@ -26,10 +26,10 @@
 void o_stream_set_max_buffer_size(struct ostream *stream, size_t max_size);
 /* Stream is made to be flushed out whenever it gets full (assumes max_size
    is already set), ie. writes will never be partial. Also makes any blocking
-   writes to fail after specified timeout, calling timeout_func if it's
+   writes to fail after specified timeout, calling timeout_cb if it's
    set. This call changes non-blocking state of file descriptor. */
 void o_stream_set_blocking(struct ostream *stream, int timeout_msecs,
-			   void (*timeout_func)(void *), void *context);
+			   void (*timeout_cb)(void *), void *context);
 
 /* Delays sending as far as possible, writing only full buffers. Also sets
    TCP_CORK on if supported. o_stream_flush() removes the cork. */




More information about the dovecot-cvs mailing list