-/* $Header$
+/* $Id$
*
* User interface routines for dbck (Moira database consistency checker)
*
- * (c) Copyright 1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
+ * (c) Copyright 1988-1998 by the Massachusetts Institute of Technology.
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
*/
#include <mit-copyright.h>
#include <moira.h>
-#include <stdio.h>
#include "dbck.h"
+#include <stdio.h>
+
EXEC SQL INCLUDE sqlca; /* SQL Communications Area */
EXEC SQL INCLUDE sqlda; /* SQL Descriptor Area */
-static char fix_qc_rcsid[] = "$Header$";
+RCSID("$Header$");
EXEC SQL BEGIN DECLARE SECTION;
char *_table;
EXEC SQL END DECLARE SECTION;
extern SQLDA *mr_sqlda;
+void generic_ffunc(void *id);
-int generic_ffunc(int id)
+void generic_ffunc(void *id)
{
int rowcount;
sprintf(stmt_buf, "DELETE FROM %s WHERE %s.%s = %d",
- _table, _table, _idfield, id);
+ _table, _table, _idfield, (int)id);
EXEC SQL EXECUTE IMMEDIATE :stmt_buf;
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
}
-int generic_delete(struct save_queue *sq, void (*pfunc)(), char *table,
- char *idfield, int preen)
+void generic_delete(struct save_queue *sq, int (*pfunc)(void *), char *table,
+ char *idfield, int preen)
{
_table = table;
_idfield = idfield;
}
-int single_delete(char *table, char *idfield, int id)
+void single_delete(char *table, char *idfield, int id)
{
_table = table;
_idfield = idfield;
- generic_ffunc(id);
+ generic_ffunc((void *)id);
}
-int zero_fix(char *tbl, char *zrfield, char *idfield, int id)
+void zero_fix(char *tbl, char *zrfield, char *idfield, int id)
{
int rowcount;
}
-int generic_fix(struct save_queue *sq, int (*pfunc)(), char *msg,
- int (*ffunc)(), int preen)
+void generic_fix(struct save_queue *sq, int (*pfunc)(void *), char *msg,
+ void (*ffunc)(void *), int preen)
{
int id;
while (sq_get_data(sq, &id))
{
- if ((*pfunc)(id) == 0 && single_fix(msg, preen))
- (*ffunc)(id);
+ if ((*pfunc)((void *)id) == 0 && single_fix(msg, preen))
+ (*ffunc)((void *)id);
}
sq_destroy(sq);
}