aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2010-11-30 16:30:02 -0600
committerPeter Seebach <peter.seebach@windriver.com>2010-12-02 12:21:07 -0600
commit7b36402ecfb7dffdcbc24f36119099cfb8c4dccf (patch)
tree4ddcb2ef2728a24a21c216720457ea3f4f163d76
parent00d0ce665b4b25ba60f67317c4840b357f84ed15 (diff)
downloadpseudo-7b36402ecfb7dffdcbc24f36119099cfb8c4dccf.tar.gz
pseudo-7b36402ecfb7dffdcbc24f36119099cfb8c4dccf.tar.bz2
pseudo-7b36402ecfb7dffdcbc24f36119099cfb8c4dccf.zip
The pseudo_db.c file created tables (operations, etc.) in the logs
database to preserve the meaning of log messages in old databases in case of renumbering... but these tables were never used, and the tables used to create them were, in fact, out of date and inconsistent with the range of operations now supported. Remove the vestigial remains of the never-implemented feature. Also, update .gitignore to stop git from complaining about some more generated files.
-rw-r--r--.gitignore4
-rw-r--r--pseudo_db.c73
2 files changed, 3 insertions, 74 deletions
diff --git a/.gitignore b/.gitignore
index d2253c7..fdaf147 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,6 @@ pseudo_wrapper_table.c
pseudo
pseudodb
pseudolog
-
+pseudo_tables.c
+pseudo_tables.h
+templatefile.pyc
diff --git a/pseudo_db.c b/pseudo_db.c
index 27891aa..1a1b1a3 100644
--- a/pseudo_db.c
+++ b/pseudo_db.c
@@ -51,67 +51,6 @@ static sqlite3 *log_db = 0;
*/
typedef struct { char *fmt; int arg; } id_row;
-/* op_columns and op_rows are used to initialize the table of operations,
- * which exists so that the databases are self-consistent even if somehow
- * someone else's version of pseudo is out of sync.
- * The same applies to other tables like this.
- */
-#define OP_ROW(id, name) { "%d, '" name "'", id }
-char *op_columns = "id, name";
-id_row op_rows[] = {
- OP_ROW(OP_UNKNOWN, "unknown"),
- OP_ROW(OP_NONE, "none"),
- OP_ROW(OP_CHDIR, "chdir"),
- OP_ROW(OP_CHMOD, "chmod"),
- OP_ROW(OP_CHOWN, "chown"),
- OP_ROW(OP_CHROOT, "chroot"),
- OP_ROW(OP_CLOSE, "close"),
- OP_ROW(OP_CREAT, "creat"),
- OP_ROW(OP_DUP, "dup"),
- OP_ROW(OP_EXEC, "exec"),
- OP_ROW(OP_FCHMOD, "fchmod"),
- OP_ROW(OP_FCHOWN, "fchown"),
- OP_ROW(OP_FSTAT, "fstat"),
- OP_ROW(OP_LINK, "link"),
- OP_ROW(OP_MKDIR, "mkdir"),
- OP_ROW(OP_MKNOD, "mknod"),
- OP_ROW(OP_OPEN, "open"),
- OP_ROW(OP_RENAME, "rename"),
- OP_ROW(OP_STAT, "stat"),
- OP_ROW(OP_UNLINK, "unlink"),
- OP_ROW(OP_SYMLINK, "symlink"),
- OP_ROW(OP_MAX, "max"),
- { NULL, 0 }
-};
-
-/* same as for ops; defined so the values in the database are consistent */
-#define SEV_ROW(id, name) { "%d, '" name "'", id }
-char *sev_columns = "id, name";
-id_row sev_rows[] = {
- SEV_ROW(SEVERITY_UNKNOWN, "unknown"),
- SEV_ROW(SEVERITY_NONE, "none"),
- SEV_ROW(SEVERITY_DEBUG, "debug"),
- SEV_ROW(SEVERITY_INFO, "info"),
- SEV_ROW(SEVERITY_WARN, "warn"),
- SEV_ROW(SEVERITY_ERROR, "error"),
- SEV_ROW(SEVERITY_CRITICAL, "critical"),
- SEV_ROW(SEVERITY_MAX, "max"),
- { NULL, 0 }
-};
-
-/* same as for ops; defined so the values in the database are consistent */
-#define RES_ROW(id, name, ok) { "%d, '" name "' , " #ok, id }
-char *res_columns = "id, name, ok";
-id_row res_rows[] = {
- RES_ROW(RESULT_UNKNOWN, "unknown", 0),
- RES_ROW(RESULT_NONE, "none", 0),
- RES_ROW(RESULT_SUCCEED, "succeed", 1),
- RES_ROW(RESULT_FAIL, "fail", 1),
- RES_ROW(RESULT_ERROR, "error", 0),
- RES_ROW(RESULT_MAX, "max", 0),
- { NULL, 0 }
-};
-
/* This seemed like a really good idea at the time. The idea is that these
* structures let me write semi-abstract code to "create a database" without
* duplicating as much of the code.
@@ -135,18 +74,6 @@ static struct sql_table {
NULL },
{ NULL, NULL, NULL, NULL },
}, log_tables[] = {
- { "operations",
- "id INTEGER PRIMARY KEY, name VARCHAR",
- &op_columns,
- op_rows },
- { "results",
- "id INTEGER PRIMARY KEY, name VARCHAR, ok INTEGER",
- &res_columns,
- res_rows },
- { "severities",
- "id INTEGER PRIMARY KEY, name VARCHAR",
- &sev_columns,
- sev_rows },
{ "logs",
"id INTEGER PRIMARY KEY, "
"stamp INTEGER, "