-/*
- * $Source$
- * $Author$
- * $Header$
+/* $Id$
*
- * Copyright (C) 1987 by the Massachusetts Institute of Technology
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
+ * Argument validation routines
*
+ * Copyright (C) 1987-1998 by the Massachusetts Institute of Technology
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
*/
-#ifndef lint
-static char *rcsid_qsupport_dc = "$Header$";
-#endif lint
-
#include <mit-copyright.h>
-#include <unistd.h>
#include "mr_server.h"
#include "query.h"
+#include "qrtn.h"
+
#include <ctype.h>
+#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
+
EXEC SQL INCLUDE sqlca;
EXEC SQL INCLUDE sqlda;
-#include "qrtn.h"
+
+RCSID("$Header$");
extern char *whoami, *table_name[], *sqlbuffer[QMAXARGS];
extern int dbms_errno, mr_errcode;
int convert_wildcards_uppercase(char *arg);
extern SQLDA *sqlald(int, int, int);
+SQLDA *mr_alloc_sqlda(void);
EXEC SQL WHENEVER SQLERROR DO dbmserr();
int validate_chars(char *argv[], struct valobj *vo)
{
char *s = argv[vo->index];
- int arg;
EXEC SQL BEGIN DECLARE SECTION;
int len;
char *tname, *cname;
/* check for bad characters */
while (*s)
{
- if (illegalchars[*s++])
+ if (illegalchars[(int)*s++])
return MR_BAD_CHAR;
}
c = val = argv[vo->index];
while (*c)
{
- if (illegalchars[*c++])
+ if (illegalchars[(int)*c++])
return MR_BAD_CHAR;
}
char *sqlbuffer[QMAXARGS];
/* Dynamic SQL support routines */
-SQLDA *mr_alloc_sqlda()
+SQLDA *mr_alloc_sqlda(void)
{
SQLDA *it;
int j;
int add_string(char *nm)
{
EXEC SQL BEGIN DECLARE SECTION;
- char buf[256], *name = nm;
+ char *name = nm;
int id;
EXEC SQL END DECLARE SECTION;
id++;
EXEC SQL UPDATE numvalues SET value = :id WHERE name = 'strings_id';
- EXEC SQL INSERT INTO strings (string_id, string) VALUES (:id, :nm);
+ EXEC SQL INSERT INTO strings (string_id, string) VALUES (:id, :name);
return id;
}