Explorar o código

lib/srdb1: removed trailing spaces

Daniel-Constantin Mierla hai 1 ano
pai
achega
fd9ccb4284

+ 4 - 4
src/lib/srdb1/db.c

@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2001-2003 FhG Fokus
  * Copyright (C) 2007-2008 1&1 Internet AG
- * 
+ *
  * This file is part of Kamailio, a free SIP server.
  *
  * Kamailio is free software; you can redistribute it and/or modify
@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
@@ -294,7 +294,7 @@ db1_con_t* db_do_init2(const str* url, void* (*new_connection)(), db_pooling_t p
 		LM_ERR("The configured db_url is too long\n");
 		return 0;
 	}
-	
+
 	/* this is the root memory for this database connection. */
 	res = (db1_con_t*)pkg_malloc(con_size);
 	if (!res) {

+ 23 - 23
src/lib/srdb1/db.h

@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
@@ -53,7 +53,7 @@
 
 /**
  * \brief Specify table name that will be used for subsequent operations.
- * 
+ *
  * The function db_use_table takes a table name and stores it db1_con_t structure.
  * All subsequent operations (insert, delete, update, query) are performed on
  * that table.
@@ -69,11 +69,11 @@ typedef int (*db_use_table_f)(db1_con_t* _h, const str * _t);
  * This function initializes the database API and opens a new database
  * connection. This function must be called after bind_dbmod but before any
  * other database API function is called.
- * 
+ *
  * The function takes one parameter, the parameter must contain the database
- * connection URL. The URL is of the form 
+ * connection URL. The URL is of the form
  * mysql://username:password\@host:port/database where:
- * 
+ *
  * username: Username to use when logging into database (optional).
  * password: password if it was set (optional)
  * host:     Hosname or IP address of the host where database server lives (mandatory)
@@ -93,11 +93,11 @@ typedef db1_con_t* (*db_init_f) (const str* _sqlurl);
  * This function initializes the database API and opens a new database
  * connection. This function must be called after bind_dbmod but before any
  * other database API function is called.
- * 
+ *
  * The function takes one parameter, the parameter must contain the database
- * connection URL. The URL is of the form 
+ * connection URL. The URL is of the form
  * mysql://username:password\@host:port/database where:
- * 
+ *
  * username: Username to use when logging into database (optional).
  * password: password if it was set (optional)
  * host:     Hosname or IP address of the host where database server lives (mandatory)
@@ -115,11 +115,11 @@ typedef db1_con_t* (*db_init2_f) (const str* _sqlurl, db_pooling_t _pooling);
 /**
  * \brief Close a database connection and free all memory used.
  *
- * The function closes previously open connection and frees all previously 
+ * The function closes previously open connection and frees all previously
  * allocated memory. The function db_close must be the very last function called.
  * \param _h db1_con_t structure representing the database connection
  */
-typedef void (*db_close_f) (db1_con_t* _h); 
+typedef void (*db_close_f) (db1_con_t* _h);
 
 
 /**
@@ -223,11 +223,11 @@ typedef int (*db_free_result_f) (db1_con_t* _h, db1_res_t* _r);
 
 /**
  * \brief Insert a row into the specified table.
- * 
+ *
  * This function implements INSERT SQL directive, you can insert one or more
  * rows in a table using this function.
  * \param _h database connection handle
- * \param _k array of keys (column names) 
+ * \param _k array of keys (column names)
  * \param _v array of values for keys specified in _k parameter
  * \param _n number of keys-value pairs int _k and _v parameters
  * \return returns 0 if everything is OK, otherwise returns value < 0
@@ -244,7 +244,7 @@ typedef int (*db_insert_f) (const db1_con_t* _h, const db_key_t* _k,
  * If _k is NULL and _v is NULL and _n is zero, all rows are deleted, the
  * resulting table will be empty.
  * If _o is NULL, the equal operator "=" will be used for the comparison.
- * 
+ *
  * \param _h database connection handle
  * \param _k array of keys (column names) that will be matched
  * \param _o array of operators to be used with key-value pairs
@@ -301,7 +301,7 @@ typedef int (*db_replace_f) (const db1_con_t* handle, const db_key_t* keys,
  * \brief Retrieve the last inserted ID in a table.
  *
  * The function returns the value generated for an AUTO_INCREMENT column by the
- * previous INSERT or UPDATE  statement. Use this function after you have 
+ * previous INSERT or UPDATE  statement. Use this function after you have
  * performed an INSERT statement into a table that contains an AUTO_INCREMENT
  * field.
  * \param _h structure representing database connection
@@ -313,7 +313,7 @@ typedef int (*db_last_inserted_id_f) (const db1_con_t* _h);
 
 /**
  * \brief Insert a row into specified table, update on duplicate key.
- * 
+ *
  * The function implements the INSERT ON DUPLICATE KEY UPDATE SQL directive.
  * It is possible to insert a row and update if one already exists.
  * The old row will not deleted before the insertion of the new data.
@@ -368,7 +368,7 @@ typedef int (*db_insert_async_f) (const db1_con_t* _h, const db_key_t* _k,
 typedef int (*db_affected_rows_f) (const db1_con_t* _h);
 
 /**
- * \brief Start a single transaction that will consist of one or more queries. 
+ * \brief Start a single transaction that will consist of one or more queries.
  *
  * \param _h structure representing database connection
  * \return 0 if everything is OK, otherwise returns < 0
@@ -376,7 +376,7 @@ typedef int (*db_affected_rows_f) (const db1_con_t* _h);
 typedef int (*db_start_transaction_f) (db1_con_t* _h, db_locking_t _l);
 
 /**
- * \brief End a transaction. 
+ * \brief End a transaction.
  *
  * \param _h structure representing database connection
  * \return 0 if everything is OK, otherwise returns < 0
@@ -395,7 +395,7 @@ typedef int (*db_abort_transaction_f) (db1_con_t* _h);
 
 /**
  * \brief Database module callbacks
- * 
+ *
  * This structure holds function pointer to all database functions. Before this
  * structure can be used it must be initialized with bind_dbmod.
  * \see bind_dbmod
@@ -411,12 +411,12 @@ typedef struct db_func {
 	db_raw_query_f    raw_query;     /* Raw query - SQL */
 	db_free_result_f  free_result;   /* Free a query result */
 	db_insert_f       insert;        /* Insert into table */
-	db_delete_f       delete;        /* Delete from table */ 
+	db_delete_f       delete;        /* Delete from table */
 	db_update_f       update;        /* Update table */
 	db_replace_f      replace;       /* Replace row in a table */
 	db_last_inserted_id_f  last_inserted_id;  /* Retrieve the last inserted ID
 	                                            in a table */
-	db_insert_update_f insert_update; /* Insert into table, update on duplicate key */ 
+	db_insert_update_f insert_update; /* Insert into table, update on duplicate key */
 	db_insert_delayed_f insert_delayed;           /* Insert delayed into table */
 	db_insert_async_f insert_async;               /* Insert async into table */
 	db_affected_rows_f affected_rows; /* Number of affected rows for last query */
@@ -432,7 +432,7 @@ typedef struct db_func {
  * \brief Bind database module functions
  *
  * This function is special, it's only purpose is to call find_export function in
- * the core and find the addresses of all other database related functions. The 
+ * the core and find the addresses of all other database related functions. The
  * db_func_t callback given as parameter is updated with the found addresses.
  *
  * This function must be called before any other database API call!
@@ -479,7 +479,7 @@ db1_con_t* db_do_init2(const str* url, void* (*new_connection)(), db_pooling_t p
 /**
  * \brief Helper for db_close function.
  *
- * This helper method does some work for the closing of a database 
+ * This helper method does some work for the closing of a database
  * connection. No function should be called after this
  * \param _h database connection handle
  * \param (*free_connection) Pointer to the db specific free_connection method

+ 3 - 3
src/lib/srdb1/db_cap.h

@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
@@ -52,7 +52,7 @@ typedef enum db_cap {
 
 
 /*! \brief
- * All database capabilities except raw_query, replace, insert_update and 
+ * All database capabilities except raw_query, replace, insert_update and
  * last_inserted_id which should be checked separately when needed
  */
 #define DB_CAP_ALL (DB_CAP_QUERY | DB_CAP_INSERT | DB_CAP_DELETE | DB_CAP_UPDATE)

+ 3 - 3
src/lib/srdb1/db_con.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2001-2003 FhG Fokus
  * Copyright (C) 2007-2008 1&1 Internet AG
  *
@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 4 - 4
src/lib/srdb1/db_id.c

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2001-2005 iptel.org
  * Copyright (C) 2007-2008 1&1 Internet AG
  *
@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
@@ -84,7 +84,7 @@ static int dupl_string_name(char** dst, const char* begin, const char* end)
 
 
 /**
- * Parse a database URL of form 
+ * Parse a database URL of form
  * scheme://[username[:password]@]hostname[:port]/database
  *
  * \param id filled id struct

+ 4 - 4
src/lib/srdb1/db_id.h

@@ -1,7 +1,7 @@
-/* 
+/*
  * Copyright (C) 2001-2005 iptel.org
  * Copyright (C) 2007-2008 1&1 Internet AG
- * 
+ *
  * This file is part of Kamailio, a free SIP server.
  *
  * Kamailio is free software; you can redistribute it and/or modify
@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 3 - 3
src/lib/srdb1/db_key.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2001-2003 FhG Fokus
  * Copyright (C) 2007-2008 1&1 Internet AG
  *
@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 2 - 2
src/lib/srdb1/db_locking.h

@@ -11,8 +11,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 3 - 3
src/lib/srdb1/db_op.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2001-2003 FhG Fokus
  * Copyright (C) 2007-2008 1&1 Internet AG
  *
@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 3 - 3
src/lib/srdb1/db_pool.c

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2001-2005 iptel.org
  * Copyright (C) 2007-2008 1&1 Internet AG
  *
@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 4 - 4
src/lib/srdb1/db_pool.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2001-2005 iptel.org
  * Copyright (C) 2007-2008 1&1 Internet AG
  *
@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
@@ -58,7 +58,7 @@ struct pool_con* pool_get(const struct db_id* id);
 
 /**
  * Insert a new connection into the pool.
- * \param con the inserted connection 
+ * \param con the inserted connection
  */
 void pool_insert(struct pool_con* con);
 

+ 2 - 2
src/lib/srdb1/db_pooling.h

@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 4 - 4
src/lib/srdb1/db_query.h

@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
@@ -129,7 +129,7 @@ int db_do_raw_query(const db1_con_t* _h, const str* _s, db1_res_t** _r,
  * \param _h structure representing database connection
  * \param _k key names
  * \param _v values of the keys
- * \param _n number of key/value pairs 
+ * \param _n number of key/value pairs
  * \param (*val2str) function pointer to the db specific val conversion function
  * \param (*submit_query) function pointer to the db specific query submit function
  * \return zero on success, negative on errors
@@ -238,5 +238,5 @@ int db_do_insert_delayed(const db1_con_t* _h, const db_key_t* _k, const db_val_t
  * \return zero on success, negative on errors
  */
 int db_query_init(void);
-    
+
 #endif

+ 4 - 4
src/lib/srdb1/db_res.c

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2001-2003 FhG Fokus
  * Copyright (C) 2007-2008 1&1 Internet AG
  *
@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
@@ -187,7 +187,7 @@ int db_allocate_rows(db1_res_t* _res)
 	}
 	LM_DBG("allocate %d bytes for rows at %p\n", len, RES_ROWS(_res));
 	memset(RES_ROWS(_res), 0, len);
-	
+
 	return 0;
 }
 

+ 3 - 3
src/lib/srdb1/db_res.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2001-2003 FhG Fokus
  * Copyright (C) 2007-2008 1&1 Internet AG
  *
@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 3 - 3
src/lib/srdb1/db_row.c

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2001-2003 FhG Fokus
  * Copyright (C) 2007-2008 1&1 Internet AG
  *
@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 3 - 3
src/lib/srdb1/db_row.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2001-2003 FhG Fokus
  * Copyright (C) 2007-2008 1&1 Internet AG
  *
@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 5 - 5
src/lib/srdb1/db_val.c

@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
@@ -45,7 +45,7 @@ int db_str2val(const db_type_t _t, db_val_t* _v, const char* _s, const int _l,
 {
 	static str dummy_string = {"", 0};
 	static char dummy_string_buf[2];
-	
+
 	if (!_v) {
 		LM_ERR("invalid parameter value\n");
 		return -1;
@@ -124,7 +124,7 @@ int db_str2val(const db_type_t _t, db_val_t* _v, const char* _s, const int _l,
 			return 0;
 		}
 		break;
-	
+
 	case DB1_DOUBLE:
 		LM_DBG("converting DOUBLE [%s]\n", _s);
 		if (db_str2double(_s, &VAL_DOUBLE(_v)) < 0) {
@@ -240,7 +240,7 @@ int db_val2str(const db1_con_t* _c, const db_val_t* _v, char* _s, int* _len)
 		*_len = snprintf(_s, *_len, "NULL");
 		return 0;
 	}
-	
+
 	switch(VAL_TYPE(_v)) {
 	case DB1_INT:
 		if (db_int2str(VAL_INT(_v), _s, _len) < 0) {

+ 3 - 3
src/lib/srdb1/db_val.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2001-2003 FhG Fokus
  * Copyright (C) 2007-2008 1&1 Internet AG
  *
@@ -14,8 +14,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */