data-sorter/
data-sorter2/
*.swp
-bin/
+bin
shared/
lib/numver.h
break;
case 3 : //check entries
for (int i=0;rmtip[i]!=(char *)0;i++) {
+ (void) rou_alert(0,"%s JMPDBG need to scan <%s>",OPEP,rmtip[i]);
if ((hangup==true)||((reload==true)))
break; //No need to check other remote
}
/* string (data-base compatible). */
/* */
/********************************************************/
-PUBLIC time_t sql_tounixtime(SQLPTR *sqlptr,char *date)
+PUBLIC time_t sql_tounixtime(SQLPTR *sqlptr,const char *date)
{
#define OPEP "devsql.c:sql_tounixtime,"
/* in a specific tuple + name in sqlresult. */
/* */
/********************************************************/
-PUBLIC char *sql_getvalue(SQLPTR *sqlptr,SQLRES *rs,int row,const char *name)
+PUBLIC const char *sql_getvalue(SQLPTR *sqlptr,SQLRES *rs,int row,const char *name)
{
#define OPEP "devsql.c:sql_getvalue,"
-char *value;
+const char *value;
SQLTYP *sql;
-value=(char *)0;
+value=(const char *)0;
sql=(SQLTYP *)sqlptr;
switch(sql->sqldb) {
case db_postgres :
extern const char *sql_fromunixtime(SQLPTR *sqlptr,time_t timestamp);
//converting a database time representation to unix time
-extern time_t sql_tounixtime(SQLPTR *sqlptr,char *date);
+extern time_t sql_tounixtime(SQLPTR *sqlptr,const char *date);
//procedure to LOCK access to a database table
extern _Bool sql_lock(SQLPTR *sqlPTR,char *tablename);
extern int sql_request(SQLPTR *sqlptr,const char *fmt,...);
//to extract data from database
-extern char *sql_getvalue(SQLPTR *sqlptr,SQLRES *rs,int row,const char *name);
+extern const char *sql_getvalue(SQLPTR *sqlptr,SQLRES *rs,int row,const char *name);
//to extract data from database
extern SQLRES *sql_gettupple(SQLPTR *sqlptr,const char *fmt,...);
isok=true;
locusr=(USRTYP *)calloc(1,sizeof(USRTYP));
for (int i=0;(usrfield[i].name!=(char *)0)&&(isok==true);i++) {
- char *locval;
+ const char *locval;
- if ((locval=sql_getvalue(sqlptr,rs,0,usrfield[i].name))==(char *)0)
+ if ((locval=sql_getvalue(sqlptr,rs,0,usrfield[i].name))==(const char *)0)
continue;
switch (usrfield[i].num) {
case 1 : //user email
isok=true;
locsrv=(SRVTYP *)calloc(1,sizeof(SRVTYP));
for (int i=0;(usrfield[i].name!=(char *)0)&&(isok==true);i++) {
- char *locval;
+ const char *locval;
- if ((locval=sql_getvalue(sqlptr,rs,0,usrfield[i].name))==(char *)0)
+ if ((locval=sql_getvalue(sqlptr,rs,0,usrfield[i].name))==(const char *)0)
continue;
switch (usrfield[i].num) {
case 1 : //user remoteip
break;
case 2 : //extracting list
(void) rou_alert(0,"JMPDG NUM='%d'",num);
+ for (int i=0;i<num;i++) {
+ const char *ip;
+
+ ip=sql_getvalue(sqlptr,rs,i,"remoteip");
+ if (ip!=(const char *)0)
+ rmtip=(char **)rou_addlist((void **)rmtip,(void *)strdup(ip));
+ }
break;
case 3 : //clearing result
rs=sql_droptupple(sqlptr,rs);
/* string (data-base compatible). */
/* */
/********************************************************/
-PUBLIC time_t mar_tounixtime(char *date)
+PUBLIC time_t mar_tounixtime(const char *date)
{
#define OPEP "unimar.c:mar_tounixtime,"
/* tupple under fieldname. */
/* */
/********************************************************/
-PUBLIC char *mar_getvalue(MARRES *rs,int tuple,const char *fieldname)
+PUBLIC const char *mar_getvalue(MARRES *rs,int tuple,const char *fieldname)
{
#define OPEP "unimar.c:pos_getfield,"
extern const char *mar_fromunixtime(time_t timestamp);
//converting a database time representation to unix time
-extern time_t mar_tounixtime(char *date);
+extern time_t mar_tounixtime(const char *date);
//locking database one table access
extern _Bool mar_lock(MARPTR *marptr,char *tablename);
extern char *mar_getfield(MARRES *rs,int tuple,int position);
//procedure to extract specific field value within database
-extern char *mar_getvalue(MARRES *rs,int tuple,const char *fieldname);
+extern const char *mar_getvalue(MARRES *rs,int tuple,const char *fieldname);
//procedure to extract data from database
extern MARRES *mar_gettupple(MARPTR *marptr,char *command);
/* string (data-base compatible). */
/* */
/********************************************************/
-PUBLIC time_t pos_tounixtime(char *date)
+PUBLIC time_t pos_tounixtime(const char *date)
{
#define OPEP "unipos.c:pos_tounixtime,"
/* tupple under fieldname. */
/* */
/********************************************************/
-PUBLIC char *pos_getvalue(POSRES *rs,int tuple,const char *fieldname)
+PUBLIC const char *pos_getvalue(POSRES *rs,int tuple,const char *fieldname)
{
#define OPEP "unipos.c:pos_getfield,"
extern const char *pos_fromunixtime(time_t timestamp);
//converting a database time representation to unix time
-extern time_t pos_tounixtime(char *date);
+extern time_t pos_tounixtime(const char *date);
//locking database one table access
extern _Bool pos_lock(POSPTR *posptr,char *tablename);
extern char *pos_getfield(POSRES *rs,int tuple,int position);
//procedure to extract specific field value within database
-extern char *pos_getvalue(POSRES *rs,int tuple,const char *fieldname);
+extern const char *pos_getvalue(POSRES *rs,int tuple,const char *fieldname);
//procedure to extract data from postgresql database
extern POSRES *pos_gettupple(POSPTR *posptr,char *command);