Browse Source

cds: removed trailing spaces

Daniel-Constantin Mierla 1 năm trước cách đây
mục cha
commit
8e08fa2c9d

+ 6 - 6
src/lib/cds/cds.c

@@ -14,12 +14,12 @@ static init_data_t *init = NULL;
 /* these functions are internal and thus are not presented in headers !*/
 int reference_counter_initialize();
 void reference_counter_cleanup();
-	
+
 int cds_initialize()
 {
 	int res = 0;
 
-	/* initialization should be called from one process/thread 
+	/* initialization should be called from one process/thread
 	 * it is not synchronized because it is impossible ! */
 	if (!init) {
 		init = (init_data_t*)cds_malloc(sizeof(init_data_t));
@@ -33,11 +33,11 @@ int cds_initialize()
 	}
 	else {
 		DEBUG_LOG("init the content\n");
-		
+
 		/* !!! put the real initialization here !!! */
 		res = reference_counter_initialize();
 	}
-			
+
 	if (res == 0) init->init_cnt++;
 	return res;
 }
@@ -47,10 +47,10 @@ void cds_cleanup()
 	if (init) {
 		if (--init->init_cnt == 0) {
 			DEBUG_LOG("cleaning the content\n");
-			
+
 			/* !!! put the real destruction here !!! */
 			reference_counter_cleanup();
-		
+
 			cds_free(init);
 			init = NULL;
 		}

+ 7 - 7
src/lib/cds/cds.h

@@ -1,7 +1,7 @@
 #ifndef __CDS_H
 #define __CDS_H
 
-/** \defgroup cds CDS library - Common Data Structures 
+/** \defgroup cds CDS library - Common Data Structures
  *
  * This library contains many useful functions and data structures. It is
  possible to use it with Sip Express Router (SER) or without it. In the first
@@ -21,7 +21,7 @@
  * \section cds_ser_usage Usage with SER
  * There can be problems with using shared libraries on different platforms.
  * Currently supported solution is that user must supply LD_LIBRARY_PATH
- * (or something similar on his OS) with the path to the library before 
+ * (or something similar on his OS) with the path to the library before
  * starting SER with modules needed the library.
  *
  * \section cds_nonser_usage Usage without SER
@@ -35,7 +35,7 @@
  * There were following reasons to introduce this library:
  *  - many duplicated functions in modules (copy&pasted between modules)
  *  without touching SER's core
- *  - possibility to debug programs outside of SER due to its simplicity 
+ *  - possibility to debug programs outside of SER due to its simplicity
  *  and many useful tools
  *
  * @{ */
@@ -50,14 +50,14 @@ extern "C"
 
 /** \defgroup cds_init Initialization/destruction
  * Library needs to be initialized before using it and
- * un-initialized after it is not used more. Use \ref cds_initialize and 
+ * un-initialized after it is not used more. Use \ref cds_initialize and
  * \ref cds_cleanup for this purpose.
  * @{ */
 
-/** Initializes CDS library. 
+/** Initializes CDS library.
  *
- * Currently initializes reference counter which is experimental and 
- * probably will be removed in the future because seems to be rather 
+ * Currently initializes reference counter which is experimental and
+ * probably will be removed in the future because seems to be rather
  * useless here. */
 int cds_initialize();
 

+ 1 - 1
src/lib/cds/dbid.h

@@ -22,7 +22,7 @@ extern "C"
 #endif
 
 /* macros for conversion to string representation of DBID
- * (if dbid becomes structure with binary information 
+ * (if dbid becomes structure with binary information
  * these should be removed and replaced by functions) */
 #define dbid_strlen(id) strlen(id)
 #define dbid_strptr(id) ((char *)(id))

+ 1 - 1
src/lib/cds/dstring.c

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.

+ 8 - 8
src/lib/cds/dstring.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.
@@ -40,20 +40,20 @@ extern "C"
  * Dynamic strings were introduced to satisfy needs of presence
  * modules when building presence documents.
  *
- * Dynamic string uses a list of buffers holding data. 
+ * Dynamic string uses a list of buffers holding data.
  * Buffers are allocated when needed - when there is not enough
  * space in the last buffer. The whole result can be copied into one
  * destination buffer with \ref dstr_get_data, \ref dstr_get_str
  * or \ref dstr_get_str_pkg function.
  *
- * \todo Function with sprintf syntax which will help with 
+ * \todo Function with sprintf syntax which will help with
  * readibility of code using dynamic strings.
  * @{
  * */
 
-	/** Buffer used by dynamic string. 
+	/** Buffer used by dynamic string.
  *
- * \todo 'len' and 'used' can be replaced by 'unused' member 
+ * \todo 'len' and 'used' can be replaced by 'unused' member
  * but it doesn't save too much */
 	typedef struct _dstr_buff_t
 	{
@@ -103,13 +103,13 @@ extern "C"
 	/* int dstr_get_data_length(dstring_t *dstr); */
 
 	/** Returns data stored in dynamic string. It does NOT allocate
- * space for them - it expects that the buffer is already allocated. 
+ * space for them - it expects that the buffer is already allocated.
  * \retval 0 if successful
  * \retval negative on error */
 	int dstr_get_data(dstring_t *dstr, char *dst);
 
 	/** Returns data stored in dynamic string. It allocates space for
- * them with cds_malloc (SER's shared memory). 
+ * them with cds_malloc (SER's shared memory).
  * \retval 0 if successful
  * \retval negative on error */
 	int dstr_get_str(dstring_t *dstr, str_t *dst);
@@ -121,7 +121,7 @@ extern "C"
 	int dstr_get_str_pkg(dstring_t *dstr, str_t *dst);
 	/** Initializes dynamic string.
  * \param dstr dynamic string to be initialized
- * \param buff_size size of buffer used with this dynamic string 
+ * \param buff_size size of buffer used with this dynamic string
  * \retval 0 if successful
  * \retval negative on error */
 	int dstr_init(dstring_t *dstr, int buff_size);

+ 1 - 1
src/lib/cds/hash_table.c

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.

+ 1 - 1
src/lib/cds/hash_table.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.

+ 1 - 1
src/lib/cds/list.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.

+ 1 - 1
src/lib/cds/logger.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.

+ 1 - 1
src/lib/cds/memory.c

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.

+ 10 - 10
src/lib/cds/memory.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.
@@ -34,14 +34,14 @@ extern "C"
 #endif
 
 	/** \ingroup cds
- * @{ 
+ * @{
  *
  * \defgroup cds_memory Memory management
  *
  * Memory operations are common for whole CDS library. Because it must work
  together with SER's memory management and must work without it too, there are
  wrapper macros for memory allocation/deallocation.
- * 
+ *
  * @{ */
 
 	/* typedef void*(*cds_malloc_func)(unsigned int size);
@@ -54,37 +54,37 @@ void cds_set_memory_functions(cds_malloc_func _malloc, cds_free_func _free); */
 
 	/** \def cds_malloc(s)
  * Function/macro for memory allocation. Which function is choosen depends on
- * SER and TRACE_CDS_MEMORY defines. 
+ * SER and TRACE_CDS_MEMORY defines.
  *
  * When SER is defined shm_malloc is choosen, standard malloc otherwise. */
 
 	/** \def cds_free(p)
  * Function/macro for memory deallocation. Which function is choosen depends
- * on SER and TRACE_CDS_MEMORY defines. 
+ * on SER and TRACE_CDS_MEMORY defines.
  *
  * If SER is defined shm_free is choosen, standard free otherwise. */
 
 	/** \def cds_malloc_ptr
  * Function/macro for memory allocation when pointer to function needed. Which
- * function is choosen depends on SER and TRACE_CDS_MEMORY defines. 
+ * function is choosen depends on SER and TRACE_CDS_MEMORY defines.
  *
  * If SER is defined shm_malloc is choosen, standard malloc otherwise.  */
 
 	/** \def cds_free_ptr
  * Function/macro for memory deallocation when pointer to function needed.
- * Which function is choosen depends on SER and TRACE_CDS_MEMORY defines. 
+ * Which function is choosen depends on SER and TRACE_CDS_MEMORY defines.
  *
  * If SER is defined shm_free is choosen, standard free otherwise.  */
 
 	/** \def cds_malloc_pkg(s)
  * Function/macro for 'local' memory allocation. Which function is choosen
- * depends on SER and TRACE_CDS_MEMORY defines. 
+ * depends on SER and TRACE_CDS_MEMORY defines.
  *
  * When SER is defined pkg_malloc is choosen, standard malloc otherwise. */
 
 	/** \def cds_free_pkg(p)
  * Function/macro for 'local' memory deallocation. Which function is choosen
- * depends on SER and TRACE_CDS_MEMORY defines. 
+ * depends on SER and TRACE_CDS_MEMORY defines.
  *
  * When SER is defined pkg_free is choosen, standard free otherwise. */
 
@@ -155,7 +155,7 @@ void shm_free_x(void *ptr);
 }
 #endif
 
-/** @} 
+/** @}
  * @} */
 
 #endif

+ 2 - 2
src/lib/cds/msg_queue.c

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.
@@ -185,7 +185,7 @@ int msg_queue_init_ex(msg_queue_t *q, int synchronize)
 	return 0;
 }
 
-/** \internal Destroys all internal data of message queue and 
+/** \internal Destroys all internal data of message queue and
  * optionally frees it if no more references exist. */
 static inline void msg_queue_destroy_and_free(msg_queue_t *q, int do_free)
 {

+ 10 - 10
src/lib/cds/msg_queue.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.
@@ -34,8 +34,8 @@ extern "C"
 {
 #endif
 
-	/** 
- * \ingroup cds 
+	/**
+ * \ingroup cds
  * \defgroup cds_msg_queue Message Queue
  *
  * Message queue is a structure useful for sending data between processes.
@@ -88,12 +88,12 @@ extern "C"
  * msg_queue_init or \ref msg_queue_init_ex. */
 #define MQ_USE_MUTEX 1
 
-/** Message queue flag meaning that reference counters are used. 
+/** Message queue flag meaning that reference counters are used.
  * To set this flag is needed to call \ref msg_queue_init_ref_cnt with
  * non-NULL group parameter. */
 #define MQ_USE_REF_CNTR 2
 
-	/** Message queue structure. 
+	/** Message queue structure.
  * Never access its members directly (they may change), always
  * use interface functions!
 */
@@ -117,11 +117,11 @@ extern "C"
 		unsigned int flags;
 	} msg_queue_t;
 
-/** Macro for accessing message data. 
+/** Macro for accessing message data.
  * It is better to use this macro than accessing internal members of
  * the structure. */
 #define get_message_data(msg) (msg ? msg->data : NULL)
-/** Macro for determining message data length. 
+/** Macro for determining message data length.
  * It is better to use this macro than accessing internal members of
  * the structure. */
 #define get_message_data_len(msg) (msg ? msg->data_len : 0)
@@ -137,7 +137,7 @@ extern "C"
  * because they are automatically freed by free_message! */
 	mq_message_t *create_message(void *data, int data_len);
 
-	/** Sets function which will be called by free_message to destroy data. 
+	/** Sets function which will be called by free_message to destroy data.
  *
  * This function may be useful when a complex structure with pointers is added
  * as data parameter.  */
@@ -173,11 +173,11 @@ extern "C"
 
 	/** Initializes reference counter for given message queue
  * \param grp specifies group of reference counters to use. The message
- * queue will stop using the reference counter if NULL. 
+ * queue will stop using the reference counter if NULL.
  * \param q specifies the message queue */
 	void msg_queue_init_ref_cnt(msg_queue_t *q, reference_counter_group_t *grp);
 
-	/** Destroys message queue if no more references exist. 
+	/** Destroys message queue if no more references exist.
  * This function destroys all message queue internal data but doesn't free
  * the message queue itself. It can be useful for statically allocated queues
  * or when allocated not using cds_malloc. */

+ 1 - 1
src/lib/cds/ptr_vector.c

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.

+ 1 - 1
src/lib/cds/ptr_vector.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.

+ 21 - 21
src/lib/cds/ref_cntr.h

@@ -7,13 +7,13 @@ extern "C"
 #endif
 
 	/** \ingroup cds
- * @{ 
+ * @{
  *
  * \defgroup cds_ref_cnt Reference counting
  *
  * Experimental functions for reference counting (to simplify
  * this code elsewhere).
- * 
+ *
  * Reference counter (\ref reference_counter_data_t) holds integer number which
  * should be changed using functions \ref add_reference and \ref
  * remove_reference. Using these functions is the number read/changed from
@@ -21,7 +21,7 @@ extern "C"
  *
  * Often used scenario:
  * - list of structures, change in the list (adding, removing) is guarded by
- *   one mutex, 
+ *   one mutex,
  * - each structure has reference counter, when the count is zero, the
  *   structure can be removed from the list and freed
  *
@@ -37,7 +37,7 @@ extern "C"
  * };
  *
  * reference_counter_group_t *some_grp;
- * 
+ *
  * void init()
  * {
  *     some_grp = init_reference_counter_group(16);
@@ -47,7 +47,7 @@ extern "C"
  * {
  *     free_reference_counter_group(some_grp);
  * }
- * 
+ *
  * ...
  *
  * // adding a member:
@@ -72,17 +72,17 @@ extern "C"
  *     free(ss);
  *     unlock(list);
  * }
- *  
- * // or 
- * // releasing a member when not needed for caller and it is possible 
- * // to 'search' in the list (reference to released member can be somehow 
+ *
+ * // or
+ * // releasing a member when not needed for caller and it is possible
+ * // to 'search' in the list (reference to released member can be somehow
  * // obtained by inspecting the list):
  * lock(list);
  * if (remove_reference(&ss->ref)) {
  *     // last reference removed
  *     remove_from_list(ss);
  *     free(ss);
- * } 
+ * }
  * unlock(list);
  * \endcode
  *
@@ -98,15 +98,15 @@ extern "C"
 		cds_mutex_t *mutex; /**< mutex assigned to this reference counter */
 	} reference_counter_data_t;
 
-	/** Structure holding information about group of reference counters.  
- * It holds array of mutexes which are assigned to single reference 
- * counters in this group. The assignment is done using an operation 
+	/** Structure holding information about group of reference counters.
+ * It holds array of mutexes which are assigned to single reference
+ * counters in this group. The assignment is done using an operation
  * on pointer to reference_counter_data_t. */
 	typedef struct
 	{
 		int mutex_cnt; /**< number of mutexes for this group */
 
-		/** number of next mutex to be assigned - this member is NOT 
+		/** number of next mutex to be assigned - this member is NOT
 	 * read/changed from critical section but it doesn't matter
 	 * if it will be rewritten between processes because it is used
 	 * for load distributing only (the worst thing that can happen
@@ -116,13 +116,13 @@ extern "C"
 				[1]; /**< array of mutexes (allocated together with the structure)*/
 	} reference_counter_group_t;
 
-	/** Initializes reference counter - sets its value to 1. 
- * After call to this function, the caller is owner of first 
+	/** Initializes reference counter - sets its value to 1.
+ * After call to this function, the caller is owner of first
  * reference. From now it can call other functions like
- * \ref add_reference or \ref remove_reference. 
+ * \ref add_reference or \ref remove_reference.
  *
- * This function initializes the mutex - it chooses one from 
- * group mutexes. The mutex can not be changed after this 
+ * This function initializes the mutex - it chooses one from
+ * group mutexes. The mutex can not be changed after this
  * call (it is only for reading). */
 	void init_reference_counter(
 			reference_counter_group_t *grp, reference_counter_data_t *ref);
@@ -143,7 +143,7 @@ extern "C"
  *  */
 	int remove_reference(reference_counter_data_t *ref);
 
-	/** Creates and initializes group of reference counters. All reference 
+	/** Creates and initializes group of reference counters. All reference
  * counters 'belonging' to this group are using the same set of mutexes. */
 	reference_counter_group_t *create_reference_counter_group(int mutex_cnt);
 
@@ -152,7 +152,7 @@ extern "C"
  * by this group can be used. */
 	void free_reference_counter_group(reference_counter_group_t *grp);
 
-	/** @} 
+	/** @}
  * @} */
 
 #ifdef __cplusplus

+ 1 - 1
src/lib/cds/serialize.c

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.

+ 1 - 1
src/lib/cds/serialize.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.

+ 3 - 3
src/lib/cds/sip_utils.h

@@ -5,18 +5,18 @@
 
 #include <parser/msg_parser.h>
 
-/* returns negative value on error, positive when message contains 
+/* returns negative value on error, positive when message contains
  * no Expires header and 0 if everything ok */
 int get_expiration_value(struct sip_msg *m, int *value);
 
 /* returns 1 if the message has Subscription-Status: terminated (hack!) */
 int is_terminating_notify(struct sip_msg *m);
 
-/* returns 1 if given extension is in Supported headers, 
+/* returns 1 if given extension is in Supported headers,
  * 0 if not or an error occurred while parsing */
 int supports_extension(struct sip_msg *m, str *extension);
 
-/* returns 1 if given extension is in Require headers, 
+/* returns 1 if given extension is in Require headers,
  * 0 if not or an error occurred while parsing */
 int requires_extension(struct sip_msg *m, str *extension);
 

+ 3 - 3
src/lib/cds/sstr.c

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.
@@ -231,7 +231,7 @@ int str_case_equals(const str_t *a, const str_t *b)
 	if ((s->len > 0) && (s->s)) cds_free(s->s);
 	s->len = 0;
 	s->s = NULL;
-} 
+}
 
 void str_free(str_t *s)
 {
@@ -333,7 +333,7 @@ int replace_str(
 	/* if (!dst) return -1;
 	 if (!src) {
 		str_clear(dst);
-		return -1; 
+		return -1;
 	} */
 
 	if(is_str_empty(sample)) {

+ 2 - 2
src/lib/cds/sstr.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.
@@ -140,7 +140,7 @@ typedef struct
 	int replace_str(const str_t *src, str_t *dst, const str_t *sample,
 			const str_t *value);
 
-/** Copies string into another one. The destination string buffer 
+/** Copies string into another one. The destination string buffer
  * MUST be allocated in needed size! */
 #define str_cpy(dst, src)                       \
 	do {                                        \

+ 1 - 1
src/lib/cds/sync.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.

+ 1 - 1
src/lib/cds/vector.c

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.

+ 2 - 2
src/lib/cds/vector.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2005 iptelorg GmbH
  *
  * This file is part of ser, a free SIP server.
@@ -40,7 +40,7 @@ extern "C"
 		int element_count;
 		/** the number of allocated elements */
 		int allocated_count;
-		/** number of elements allocated together (better than allocation 
+		/** number of elements allocated together (better than allocation
 	 * for each element separately) */
 		int allocation_count;
 		void *data;