Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
move the type_t enum directly to the format_sql_condition function, which is the only place it should ever be used, and rename it to state_t.
Rolf Grossmann committed 13 years ago
commit 2d4801e6013d56ca2eb53a87302dfbb730de0005
parent f2c1e5b5fa20738c8da5bba2ae15744170948442
2 files changed +13 -13
modified pkg/pkgcli.h
@@ -175,18 +175,6 @@ struct query_flags {
	const int dbflags;
};

-
typedef enum {
-
	NONE,
-
	NEXT_IS_INT,
-
	OPERATOR_INT,
-
	INT,
-
	NEXT_IS_STRING,
-
	OPERATOR_STRING,
-
	STRING,
-
	QUOTEDSTRING,
-
	SQUOTEDSTRING
-
} type_t;
-

void print_query(struct pkg *pkg, char *qstr, char multiline);
int format_sql_condition(const char *str, struct sbuf *sqlcond);
int analyse_query_string(char *qstr, struct query_flags *q_flags, const unsigned int q_flags_len, int *flags, char *multiline);
modified pkg/query.c
@@ -381,10 +381,22 @@ print_query(struct pkg *pkg, char *qstr, char multiline)
	sbuf_delete(output);
}

+
typedef enum {
+
	NONE,
+
	NEXT_IS_INT,
+
	OPERATOR_INT,
+
	INT,
+
	NEXT_IS_STRING,
+
	OPERATOR_STRING,
+
	STRING,
+
	QUOTEDSTRING,
+
	SQUOTEDSTRING
+
} state_t;
+

int
format_sql_condition(const char *str, struct sbuf *sqlcond)
{
-
	type_t state = NONE;
+
	state_t state = NONE;
	sbuf_cat(sqlcond, " WHERE ");
	while (str[0] != '\0') {
		if (state == NONE) {