2
0
Эх сурвалжийг харах

fix indentation; 4 spaces -> tab

Alfred E. Heggestad 17 жил өмнө
parent
commit
5979d55f8b
6 өөрчлөгдсөн 35 нэмэгдсэн , 35 устгасан
  1. 2 2
      db/db_cmd.h
  2. 1 1
      db/db_con.h
  3. 13 13
      db/db_fld.h
  4. 1 1
      db/db_res.h
  5. 15 15
      db/db_uri.c
  6. 3 3
      db/db_uri.h

+ 2 - 2
db/db_cmd.h

@@ -71,8 +71,8 @@ enum db_cmd_type {
 typedef struct db_cmd {
 	db_gen_t gen;          /**< Generic part of the structure, must be the 1st attribute */
 	enum db_cmd_type type; /**< Type of the command to be executed */
-    struct db_ctx* ctx;    /**< Context containing database connections to be used */
-    str table;             /**< Name of the table to perform the command on */
+	struct db_ctx* ctx;    /**< Context containing database connections to be used */
+	str table;             /**< Name of the table to perform the command on */
 	db_exec_func_t exec[DB_PAYLOAD_MAX]; /**< Array of exec functions provided by modules */
 	db_first_func_t first[DB_PAYLOAD_MAX];
 	db_next_func_t next[DB_PAYLOAD_MAX];

+ 1 - 1
db/db_con.h

@@ -54,7 +54,7 @@ typedef struct db_con {
 	db_con_disconnect_t* disconnect;
 
 	struct db_ctx* ctx;
-    db_uri_t* uri;
+	db_uri_t* uri;
 } db_con_t;
 
 struct db_con* db_con(struct db_ctx* ctx, db_uri_t* uri);

+ 13 - 13
db/db_fld.h

@@ -43,15 +43,15 @@ extern "C" {
 
 
 enum db_fld_type {
-    DB_NONE = 0,   /* Bumper */
-    DB_INT,        /* 32-bit integer */
-    DB_FLOAT,      /* 32-bit fixed-precision number */
-    DB_DOUBLE,     /* double data type */
-    DB_CSTR,       /* Zero-terminated string */
-    DB_STR,        /* str structure */
-    DB_DATETIME,   /* Date and time in number of seconds since 1-Jan-1970 */
-    DB_BLOB,       /* Generic binary object*/
-    DB_BITMAP      /* Bitmap of flags */
+	DB_NONE = 0,   /* Bumper */
+	DB_INT,        /* 32-bit integer */
+	DB_FLOAT,      /* 32-bit fixed-precision number */
+	DB_DOUBLE,     /* double data type */
+	DB_CSTR,       /* Zero-terminated string */
+	DB_STR,        /* str structure */
+	DB_DATETIME,   /* Date and time in number of seconds since 1-Jan-1970 */
+	DB_BLOB,       /* Generic binary object*/
+	DB_BITMAP      /* Bitmap of flags */
 };
 
 extern char* db_fld_str[];
@@ -66,7 +66,7 @@ enum db_fld_op {
 };
 
 enum db_flags {
-    DB_NULL = (1 << 0),  /**< The field is NULL, i.e. no value was provided */
+	DB_NULL = (1 << 0),  /**< The field is NULL, i.e. no value was provided */
 	DB_NO_TZ = (1 << 1), /**< Inhibit time-zone shifts for timestamp fields */
 };
 
@@ -85,9 +85,9 @@ typedef union db_fld_val {
 
 typedef struct db_fld {
 	db_gen_t gen;  /* Generic part of the structure */
-    char* name;
-    enum db_fld_type type;
-    unsigned int flags;
+	char* name;
+	enum db_fld_type type;
+	unsigned int flags;
 	db_fld_val_t v;
 	enum db_fld_op op;
 } db_fld_t;

+ 1 - 1
db/db_res.h

@@ -45,7 +45,7 @@ typedef struct db_res {
 	db_gen_t gen;           /* Generic part of the structure */
 	unsigned int field_count;    /* Number of fields in the result */
 	struct db_rec* cur_rec; /* Currently active record in the result */
-    struct db_cmd* cmd;     /* Command that produced the result */
+	struct db_cmd* cmd;     /* Command that produced the result */
 } db_res_t;
 
 struct db_res* db_res(struct db_cmd* cmd);

+ 15 - 15
db/db_uri.c

@@ -68,23 +68,23 @@ unsigned char db_uri_cmp(db_uri_t* uri1, db_uri_t* uri2)
  */
 db_uri_t* db_uri(const char* uri)
 {
-    char* colon;
-    int len;
-    db_uri_t* newp;
+	char* colon;
+	int len;
+	db_uri_t* newp;
     
-    newp = (db_uri_t*)pkg_malloc(sizeof(db_uri_t));
-    if (newp == NULL) goto error;
-    memset(newp, '\0', sizeof(db_uri_t));
+	newp = (db_uri_t*)pkg_malloc(sizeof(db_uri_t));
+	if (newp == NULL) goto error;
+	memset(newp, '\0', sizeof(db_uri_t));
 	if (db_gen_init(&newp->gen) < 0) goto error;	
 
-    len = strlen(uri);
-    colon = q_memchr((char*)uri, ':', len);
-    if (colon == NULL) {
+	len = strlen(uri);
+	colon = q_memchr((char *)uri, ':', len);
+	if (colon == NULL) {
 		newp->scheme.s = pkg_malloc(len + 1);
 		if (newp->scheme.s == NULL) goto error;
 		memcpy(newp->scheme.s, uri, len);
 		newp->scheme.len = len;
-    } else {
+	} else {
 		newp->scheme.len = colon - uri;
 		newp->scheme.s = pkg_malloc(newp->scheme.len + 1);
 		if (newp->scheme.s == NULL) goto error;
@@ -95,22 +95,22 @@ db_uri_t* db_uri(const char* uri)
 		if (newp->body.s == NULL) goto error;
 		memcpy(newp->body.s, colon + 1, newp->body.len);
 		newp->body.s[newp->body.len] = '\0';
-    }
-    newp->scheme.s[newp->scheme.len] = '\0';
+	}
+	newp->scheme.s[newp->scheme.len] = '\0';
 
 	/* Call db_uri function if the driver has it */
 	if (db_drv_call(&newp->scheme, "db_uri", newp, 0) < 0) goto error;
-    return newp;
+	return newp;
     
  error:
-    ERR("db_uri: Error while creating db_uri structure\n");
+	ERR("db_uri: Error while creating db_uri structure\n");
 	if (newp) {
 		db_gen_free(&newp->gen);
 		if (newp->body.s) pkg_free(newp->body.s);
 		if (newp->scheme.s) pkg_free(newp->scheme.s);
 		pkg_free(newp);
 	}
-    return 0;
+	return 0;
 }
 
 

+ 3 - 3
db/db_uri.h

@@ -47,9 +47,9 @@ typedef unsigned char (db_uri_cmp_t)(struct db_uri* uri1, struct db_uri* uri2);
 
 typedef struct db_uri {
 	db_gen_t gen;      /* Generic part of the structure */
-    str scheme;        /* URI scheme */
-    str body;          /* Entire URI body */
-    db_uri_cmp_t* cmp; /* Comparison function */
+	str scheme;        /* URI scheme */
+	str body;          /* Entire URI body */
+	db_uri_cmp_t* cmp; /* Comparison function */
 } db_uri_t;