Back to index

wims  3.65+svn20090927
Classes | Defines | Functions | Variables
wims.h File Reference
#include "config.h"
#include "includes.h"
#include "wimsdef.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FOR_STACK
struct  LINE_STRUCT
struct  WORKING_FILE

Defines

#define QUERY_STRING_LIMIT   204799
#define MAX_DEPOSITLEN   (8*1024*1024)
#define MAX_VAR_NUM   512
#define MAX_EXEC_NAME   31
#define MAX_FOR_LEVEL   12
#define MAX_READNEST   20
#define MAX_MCACHE   32
#define MAX_LANGUAGES   32
#define MAX_SORT_ITEM   5000
#define MAX_RANDPERM   2000
#define MAX_SESRANDOM   64
#define OUTPUT_LENGTH_LIMIT   600000
#define MAX_VALUE_LIST   2048
#define lastout   "last.html"
#define TEMP_LOG_FILE   "../log/temp.log"
#define ACCESS_CONF   "../log/wims.conf.access"
#define SESSION_BASE   "sessions"
#define S2_BASE   "s2"
#define exec_prefix_char   '!'
#define calc_prefix_char   '!'
#define label_prefix_char   ':'
#define tag_prefix_char   ':'
#define tag_string   "\n:"
#define comment_prefix_char   '#'
#define var_prefix   "w_"
#define mathfont_prefix   "m_"
#define wims_prefix   "wims_"
#define wpflen   strlen(wims_prefix)
#define default_var_def   "var.def"
#define error_data_string   "wims_error_data"
#define user_error_msg_file   "msg/user_error.phtml"
#define module_error_msg_file   "msg/module_error.msg"
#define log_dir   "../log"
#define class_base   "../log/classes"
#define parent_dir_string   ".."
#define PARENT_DIR_STRING   "/../"
#define ksockfile   "../tmp/log/.wimslogd"
#define sysmask_trigger_dir   "sysmask/stat/trigger"
#define charname_no   (sizeof(charname)/sizeof(charname[0]))

Functions

char * getvar (char *name)
int setvar (char *vname, char *vval)
void debug_output (void)
void exportall (void)
void setsesdir (char *p)
void var_proc (char *fname, int cache)
void phtml_put (char *fname, int cache)
void phtml_put_base (char *fname, int cache)
double evalue (char *p)
char * substit (char *p)
void calc_tolower (char *p)
void calc_toupper (char *p)
void user_log (char *p)
void write_logs (void)
void mail_log (char *p)
void flushlog (void)
void insmath (char *p)
void fix_tex_size (void)
void calc_examdep (char *p)
void exec_test (char *p)
int force_setvar (char *vname, char *vvalue)
int var_def_check (char *name)
int setenv (const char *name, const char *value, int overwrite)
void unsetenv (const char *name)

Variables

struct {
char * name
char * font
charname []

Class Documentation

struct FOR_STACK

Definition at line 102 of file wims.h.

Class Members
char * bufpt
int from
int lineno
char * list_pt
double step
double varend
char varname
double varval
struct LINE_STRUCT

Definition at line 113 of file wims.h.

Class Members
char * address
short int execcode
int isstart
unsigned int llen
short int varcode
struct WORKING_FILE

Definition at line 120 of file wims.h.

Collaboration diagram for WORKING_FILE:
Class Members
short int for_idx
FOR_STACK * for_stack
int l
int linecnt
int linepointer
LINE_STRUCT * lines
char name
short int nocache
char * textbuf

Define Documentation

#define ACCESS_CONF   "../log/wims.conf.access"

Definition at line 56 of file wims.h.

Definition at line 64 of file wims.h.

#define charname_no   (sizeof(charname)/sizeof(charname[0]))

Definition at line 150 of file wims.h.

#define class_base   "../log/classes"

Definition at line 89 of file wims.h.

Definition at line 72 of file wims.h.

#define default_var_def   "var.def"

Definition at line 81 of file wims.h.

#define error_data_string   "wims_error_data"

Definition at line 83 of file wims.h.

Definition at line 62 of file wims.h.

#define ksockfile   "../tmp/log/.wimslogd"

Definition at line 98 of file wims.h.

Definition at line 66 of file wims.h.

#define lastout   "last.html"

Definition at line 52 of file wims.h.

#define log_dir   "../log"

Definition at line 88 of file wims.h.

#define mathfont_prefix   "m_"

Definition at line 76 of file wims.h.

#define MAX_DEPOSITLEN   (8*1024*1024)

Definition at line 28 of file wims.h.

Definition at line 32 of file wims.h.

Definition at line 34 of file wims.h.

Definition at line 40 of file wims.h.

#define MAX_MCACHE   32

Definition at line 38 of file wims.h.

#define MAX_RANDPERM   2000

Definition at line 44 of file wims.h.

#define MAX_READNEST   20

Definition at line 36 of file wims.h.

Definition at line 46 of file wims.h.

#define MAX_SORT_ITEM   5000

Definition at line 42 of file wims.h.

#define MAX_VALUE_LIST   2048

Definition at line 50 of file wims.h.

#define MAX_VAR_NUM   512

Definition at line 30 of file wims.h.

#define module_error_msg_file   "msg/module_error.msg"

Definition at line 86 of file wims.h.

Definition at line 48 of file wims.h.

Definition at line 94 of file wims.h.

#define PARENT_DIR_STRING   "/../"

Definition at line 96 of file wims.h.

#define QUERY_STRING_LIMIT   204799

Definition at line 26 of file wims.h.

#define S2_BASE   "s2"

Definition at line 59 of file wims.h.

#define SESSION_BASE   "sessions"

Definition at line 58 of file wims.h.

#define sysmask_trigger_dir   "sysmask/stat/trigger"

Definition at line 100 of file wims.h.

Definition at line 68 of file wims.h.

#define tag_string   "\n:"

Definition at line 70 of file wims.h.

#define TEMP_LOG_FILE   "../log/temp.log"

Definition at line 54 of file wims.h.

#define user_error_msg_file   "msg/user_error.phtml"

Definition at line 85 of file wims.h.

#define var_prefix   "w_"

Definition at line 74 of file wims.h.

#define wims_prefix   "wims_"

Definition at line 78 of file wims.h.

#define wpflen   strlen(wims_prefix)

Definition at line 79 of file wims.h.


Function Documentation

void calc_examdep ( char *  p)

Definition at line 227 of file exam.c.

{
    char *p1, *p2;
    int t;
    if(!trusted_module()) {abt: *p=0; return;}
    p1=find_word_start(p); p2=find_word_end(p1);
    if(*p2==0) goto abt;
    *p2++=0; p2=find_word_start(p2);
    t=atoi(p1);
    if(exam_depcheck(p2,t)) p1="yes";
    else p1="no";
    snprintf(p,MAX_LINELEN,p1);
}

Here is the call graph for this function:

void calc_tolower ( char *  p)

Definition at line 1015 of file calc.c.

{
    char *pp;
    for(pp=p;*pp;pp++) *pp=tolower(*pp);
}

Here is the caller graph for this function:

void calc_toupper ( char *  p)

Definition at line 1021 of file calc.c.

{
    char *pp;
    for(pp=p;*pp;pp++) *pp=toupper(*pp);
}
void debug_output ( void  )

Definition at line 390 of file var.c.

{
    long int endmtime2, time1;
    struct timeval tv;
    struct rusage us;

    if(noout || robot_access || strcasecmp(tmp_debug,"yes")!=0 ||
       checkhost(manager_site)<1) return;
    if(instex_cnt>0) instex_flush();
    if(gettimeofday(&tv,NULL)) endmtime2=0;
    else endmtime2=((tv.tv_sec%1000)*1000000+tv.tv_usec);
    endmtime2=(endmtime2-startmtime2)/100;
    time1=0;
    if(getrusage(RUSAGE_SELF,&us)==0) {
       time1+=us.ru_utime.tv_sec*1000+us.ru_utime.tv_usec/1000;
       time1+=us.ru_stime.tv_sec*1000+us.ru_stime.tv_usec/1000;
    }
    if(getrusage(RUSAGE_CHILDREN,&us)==0) {
       time1+=us.ru_utime.tv_sec*1000+us.ru_utime.tv_usec/1000;
       time1+=us.ru_stime.tv_sec*1000+us.ru_stime.tv_usec/1000;
    }
    snprintf(tmplbuf,sizeof(tmplbuf),"%d,%d,%d,%.4f,%.2f,%d,%d,%d",
            _varptr-_varbuf[_varbufcurr]+_varbufcurr*VARBUF_LEN,
            bufvcnt-freevcnt,freevcnt,
            (double) endmtime2/10000, (double) time1/1000,
            mcachecnt,mfilecnt,execnt);
    setvar("wims_debug_info",tmplbuf);
    lastout_file=-1; phtml_put_base("debug.phtml",0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

double evalue ( char *  p)

Definition at line 59 of file evalue.c.

{
    return strevalue(p);
}

Here is the call graph for this function:

void exec_test ( char *  p)

Definition at line 25 of file test.c.

{
    if(!trusted_module()) module_error("not_trusted");
}

Here is the call graph for this function:

void exportall ( void  )

Definition at line 111 of file var.c.

{
    int i, j, tag; char buf[MAX_NAMELEN+17];
    char *p, *p1, *p2;
    char *noexpword[1024];
    int noexplen[1024];
    int noexpcnt;
    
    noexpcnt=0;
    p=getvar("wims_noexport"); if(p==NULL) p="";
    for(p1=find_word_start(p),noexpcnt=0;
       *p1 && noexpcnt<1024;
       p1=find_word_start(p2)) {
       p2=find_word_end(p1);
       noexpword[noexpcnt]=p1; noexplen[noexpcnt]=p2-p1;
       noexpcnt++;
    }
    for(i=0;i<mainvarcnt;i++) {
       tag=mainvartab[i].tag;
       if((tag&vb_dirty)==0 || (tag&vb_noexport)!=0) continue;
       p=mainvartab[i].name;
       for(j=0;j<noexpcnt;j++) if(strncmp(p,noexpword[j],noexplen[j])==0) {
           mainvartab[i].tag|=vb_noexport;
           goto lend;
       }
       if(mainvartab[i].tag&vb_hacked) {
           add_hack(p); mainvartab[i].tag&=~vb_hacked;
       }
       snprintf(buf,sizeof(buf),"%s%s",var_prefix,p);
       setenv(buf,mainvartab[i].val,1);
       mainvartab[i].tag&=~vb_dirty;
lend:  ;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void fix_tex_size ( void  )

Definition at line 45 of file mathfonts.c.

{
    char buf[64],*p; int i,ts;
    ts=texbasesize;
    if(usertexsize>=0) ts=usertexsize+1;
    if(getwimstexsize) p=getvar("wims_texsize"); else p=NULL;
    if(p!=NULL && *p!=0) {
       i=evalue(p);
       if(i>=-5 && i<=5) ts+=i;
    }
    if(ts<0) ts=0;
    if(ts>=texsize_no) ts=texsize_no-1;    
    current_tex_size=texsize_list[ts];
    snprintf(buf,sizeof(buf),"%d",current_tex_size);
    setenv("texgif_density",buf,1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void flushlog ( void  )

Definition at line 30 of file log.c.

{
    int n, fd;
    n=logp-logbuf; logp=logbuf;
    if(n<=0) return;
    fd=open(temp_log,O_WRONLY|O_APPEND|O_CREAT,S_IRUSR|S_IWUSR);
    if(fd==-1) return;
    write(fd,logbuf,n); close(fd);
}

Here is the caller graph for this function:

int force_setvar ( char *  vname,
char *  vvalue 
)

Definition at line 315 of file var.c.

{
    int i;
    setvar_force=1; i=setvar(vname,vvalue); setvar_force=0; return i;
}

Here is the call graph for this function:

char* getvar ( char *  name)

Definition at line 40 of file lines.c.

{
    int i;
    for(i=0;i<varcnt && strcmp(p,vartab[i].name)!=0;i++);
    if(i<varcnt) return vartab[i].value;
    else return 0;
}

Here is the call graph for this function:

void insmath ( char *  p)

Definition at line 216 of file insmath.c.

{
    char *pt;
    if(!outputing) goto end;
    pt=getvar("insmath_logic");
    if(pt==NULL || strstr(pt,"yes")==NULL) {
       __insmath(p); 
       end: *p=0; return;
    }
    _mathlogic(p,__insmath);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void mail_log ( char *  p)

Definition at line 285 of file log.c.

{
    int i;
    char *ip, *p, *sess, *s, *cl;
    
    ip=remote_addr; 
    if(*ip==0) ip="????????";
    if(mode==mode_default) sess=getvar("wims_session");
    else sess="popup";
    if(sess==NULL) sess="----------";
    p=getvar(ro_name[ro_module]);
    if(p==NULL || *p==0) p="-";
      /* limit module name to 40 chars */
    i=strlen(p); if(i>40) p+=i-40;
    s=strchr(sess,'_'); if(s==NULL) s=sess+strlen(sess);
    if(s<sess+4) s=sess; else s=s-4;
    cl=getvar("wims_class"); if(cl==NULL) cl="";
    snprintf(tmplbuf,sizeof(tmplbuf),"%s %.6s %s\11%s\11%s\11%s",
            nowstr, s, ip, c, cl, p);
    write_logfile("mail.log",tmplbuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void phtml_put ( char *  fname,
int  cache 
)

Definition at line 1090 of file variables.c.

{
    int t;
    char tbuf[MAX_LINELEN+1];

    outputing=1;
     /* File not found; we give empty output, but no error message. */
    if(fname!=NULL && read_module_file(fname)!=0) return;
    if(untrust&6) get_var_privileges();
    while(m_file.linepointer<m_file.linecnt) {
       t=m_file.lines[m_file.linepointer].isstart;
       if((t&~18)!=1) {m_file.linepointer++; continue;}
       wgetline(tbuf,MAX_LINELEN,&m_file); substnest=0;
       if((t&2)!=0) {exec_main(tbuf+1); continue;}
       substit(tbuf); output0(tbuf); _output_("\n");
    }
    close_working_file(&m_file,cache);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void phtml_put_base ( char *  fname,
int  cache 
)

Definition at line 1110 of file variables.c.

{
    WORKING_FILE save;
    char modsave[MAX_FNAME+1];
    memmove(&save,&m_file,sizeof(WORKING_FILE));
    mystrncpy(modsave,module_prefix,sizeof(modsave));
    strcpy(module_prefix,"html");
    phtml_put(fname,cache);
    mystrncpy(module_prefix,modsave,sizeof(module_prefix));
    memmove(&m_file,&save,sizeof(WORKING_FILE));
}

Here is the call graph for this function:

int setenv ( const char *  name,
const char *  value,
int  overwrite 
)

Definition at line 7 of file setenv.c.

{
  char *s;
  if (!overwrite && getenv(name)) return 0;
  s = xmalloc(2 + strlen(name) + strlen(value));
  sprintf(s, "%s=%s", name,value);
  return putenv(s);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void setsesdir ( char *  p)

Definition at line 754 of file config.c.

{
    char buf[MAX_FNAME+1];
    if(strstr(d,parent_dir_string)!=NULL) {
       force_setvar("wims_session",robot_session);
       mystrncpy(buf,robot_session,sizeof(buf));
       mkfname(session_dir,"../tmp");
       mkfname(s2_dir,"../tmp");
    }
    else {
       force_setvar("wims_session",d);
       snprintf(buf,sizeof(buf),"%s/%s",SESSION_BASE,d);
       mkfname(session_dir,"../%s",SESSION_BASE);
       /* mkfname(s2_dir,"../%s",S2_BASE); */
    }
    force_setvar("wims_sesdir",buf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int setvar ( char *  vname,
char *  vval 
)

Definition at line 24 of file lines.c.

{return;}

Here is the call graph for this function:

char* substit ( char *  p)

Definition at line 53 of file evalue.c.

{
    char *pp, *p2, *ev;
    char *oldlast, *oldnext, *oldend, *newend;
    char buf[MAX_LINELEN+1], oldbuf[MAX_LINELEN+1];
    int ln;

    if((p2=strchr(p,'$'))==NULL) return p;
    if(substnest>SUBST_LIMIT) module_error("subst_exceeded");
    ln=strlen(p); if(ln>=MAX_LINELEN) goto too_long;
    memmove(oldbuf,p,ln); oldbuf[ln]=0; oldend=oldbuf+ln;
    newend=p; oldlast=oldnext=oldbuf;
    for(pp=oldbuf+(p2-p); pp!=NULL; pp=strchr(pp,'$')) {
       if(*(pp+1)=='$') {   /* escaped dollar sign */
           pp++; if(newend-p+(pp-oldlast)>=MAX_LINELEN) goto too_long;
           memmove(newend,oldlast,pp-oldlast); newend+=pp-oldlast;
           pp++; oldlast=pp; continue;
       }
       switch(*(pp+1)) {
           case 0: {
              *pp=0; oldend--; goto end;
           }
           case '(': {
              p2=find_matching(pp+2,')');
              if(p2==NULL) {
                  module_error("unmatched_parentheses");
                  *p=0; return p;
              }
              *p2++=0; oldnext=p2; memmove(buf,pp+2,p2-pp-2);
              substnest++; substit(buf); substnest--;
              break;
           }

           case '[': {
              double d;
              p2=find_matching(pp+2,']');
              if(p2==NULL) {
                  module_error("unmatched_parentheses");
                  *p=0; return p;
              }
              *p2=0; strcpy(buf,pp+2); oldnext=p2+1;
              substnest++; substit(buf); substnest--;
              d=evalue(buf); float2str(d,buf);
              goto replace;
           }
              
           default: {
              for(p2=pp+1; myisalnum(*p2) || *p2=='_'; p2++);
              oldnext=p2; memmove(buf,pp+1,p2-(pp+1)); buf[p2-(pp+1)]=0;
              goto noarray;
           }
       }
       if((p2=strchr(buf,'['))!=NULL) {
           char *pt1, tbuf[MAX_LINELEN+1];
           *p2++=0; pt1=find_matching(p2,']');
           if(pt1==NULL) {buf[0]=0; goto replace;}
           *pt1=0; pt1=strchr(p2,';');
           if(pt1==NULL) {
              if(*find_word_start(p2)==0) {*p2=0; goto noarray;}
              snprintf(tbuf,sizeof(tbuf),"%s of $%s",p2,buf);
              calc_itemof(tbuf); strcpy(buf,tbuf); goto replace;
           }
           else {
              *pt1++=0; p2=find_word_start(p2);
              if(*p2) {
                  snprintf(tbuf,sizeof(tbuf),"%s of $%s",p2,buf);
                  calc_rowof(tbuf);
              }
              else {
                  snprintf(tbuf,sizeof(tbuf),"$%s",buf); substit(tbuf);
              }
              if(*find_word_start(pt1)) {
                  snprintf(buf,sizeof(buf),"%s of %s",pt1,tbuf);
                  calc_columnof(buf); goto replace;
              }
              else strcpy(buf,tbuf);
              goto replace;
           }
       }
       noarray: ev=getvar(buf); ln=getvar_len;
       if(ev==NULL) ev=""; if(strchr(ev,'$')==NULL) goto rep2;
       memmove(buf,ev,ln); buf[ln]=0;
       substnest++; substit(buf); substnest--;
       replace: ev=buf; ln=strlen(ev);
       rep2:
       if(pp>oldlast) {
           if(newend-p+(pp-oldlast)>=MAX_LINELEN) goto too_long;
           memmove(newend,oldlast,pp-oldlast); newend+=pp-oldlast;
       }
       if(ln>0) {
           if((newend-p)+ln>=MAX_LINELEN) goto too_long;
           memmove(newend,ev,ln); newend+=ln;
       }
       pp=oldlast=oldnext;
       continue;
    }
    end: 
    if(oldlast<oldend) {
       if(newend-p+(oldend-oldlast)>=MAX_LINELEN) goto too_long;
       memmove(newend,oldlast,oldend-oldlast); newend+=oldend-oldlast;
    }
    *newend=0; return p;
    too_long: user_error("cmd_output_too_long"); return NULL;
}

Here is the call graph for this function:

void unsetenv ( const char *  name)

Definition at line 17 of file setenv.c.

{ setenv(name,"",1); }

Here is the call graph for this function:

Here is the caller graph for this function:

void user_log ( char *  p)

Definition at line 128 of file log.c.

{
    char fname[MAX_FNAME+1], logbuf[MAX_LINELEN+1], cbuf[256], sbuf[32], shbuf[32];
    char *user, *classe, *sh, *sess, *exo, *cc, *ip, *allow, *pend;
    char *ex;
    double sc,Sc;
    int i, scorelog;
    
    if(robot_access || strstr("session_prefix","_check")!=NULL) return;
    user=getvar("wims_user"); classe=getvar("wims_class");
    sc=0;
    if(isexam) {
       if(user==NULL || classe==NULL || *user==0 || *classe==0) return;
       sh=getvar("worksheet"); if(sh==NULL) return;
       mystrncpy(shbuf,sh,sizeof(shbuf));
       exo=strchr(shbuf,'.'); if(exo==NULL) return;
       *exo++=0; sh=shbuf;
       if(mode==mode_default) sess=getvar("wims_session");
       else sess="popup";
       if(sess==NULL) return;
       mystrncpy(sbuf,sess,sizeof(sbuf));
       sess=strchr(sbuf,'_'); if(sess==NULL) return;
       *sess=0; sess=sbuf; ex="E";
       accessfile(logbuf,"r","%s/.E%s",class_dir,sh);
       if(strchr(logbuf,'#')!=NULL || strcmp(user,"supervisor")==0) simuxam=1;
       else {
           accessfile(logbuf,"r","%s/%s/examsimu.%d", session_dir,sess,sh);
           if(strstr(logbuf,"yes")!=NULL) user_error("expired_exam");
       }
       mkfname(examlogd,"%s/examlog/%s/%s",class_dir,user,sess);
       mkfname(examlogf,"%s/%s.%s",examlogd,sh,exo);
    }
    else {
       sh=getvar("wims_sheet");
       if(sh==NULL || *sh==0) return;
       exo=getvar("wims_exo"); if(exo==NULL) return;
       sess=getvar("wims_session");
       if(sess==NULL) return;
       ex="";
    
    }
    if(strcmp(c,"new")!=0 && strcmp(c,"renew")!=0
       && strcmp(c,"rafale")!=0
       && strcmp(c,"hint")!=0 && parm_restore==0) {
       char *s;
       s=getvar("module_score");
       if(s==NULL || *s==0) return;
       sc=atof(s); if(!finite(sc)) {sc=0; return;}
       snprintf(cbuf,sizeof(cbuf),"score %s",s);
       cc=cbuf;
    }
    else cc=c;
    if(classe==NULL || *classe==0) i=1;
    else i=getscorestatus(classe,atoi(sh));
    pend=getvar("wims_scoring"); if(pend==NULL) pend="";
    if((i==0 || !exodepOK || strcmp(pend,"pending")!=0) && strcmp(cc,"rafale")!=0)
      allow=" noscore";
    else allow="";
    ip=remote_addr; if(*ip==0) ip="-"; scorelog=0;
    if(user==NULL || *user==0) {
       classe="0"; allow="";
       mkfname(fname,"../sessions/%s/.score",sess);
    }
    else {
       char *pp;
       if(classe==NULL || *classe==0) return;
       pp=getvar("wims_scorereg");
       if((allow[0]==0 || (pp!=NULL && strcmp(pp,"suspend")==0)) && *ex!='E') 
         scorelog=1;
       else
         mkfname(fname,"classes/%s/noscore/%s",classe,user);
    }
    if(isexam && user!=NULL && *user!=0) {
       allow=exam_sheetexo;
       snprintf(logbuf,sizeof(logbuf),":%s %2s %s       %s%s\n",
               nowstr,exo,cc,ip,allow);
       accessfile(logbuf,"a","%s/%s/examscore.%s", session_dir,sess,sh);
       Sc=currexamscore(atoi(sh));
       accessfile(logbuf,"r","%s/.E%s",class_dir,sh);
       if(simuxam==0) {            /* not simulation */
           if(sc>0) {
              snprintf(logbuf,sizeof(logbuf),
                      "%s %.2f -1 %u %s %s\n",
                      sh,Sc,(unsigned int) nowtime,ip,sess);
              accessfile(logbuf,"a","%s/score/%s.exam",
                        class_dir,user);
           }
       }
       else snprintf(exam_sheetexo+strlen(exam_sheetexo),
                    sizeof(exam_sheetexo)-strlen(exam_sheetexo),
                    "       S");
    }
    snprintf(logbuf,sizeof(logbuf),"%s%s %s %2s %2s %s         %s%s",
            ex,nowstr,sess,sh,exo,cc,ip,allow);
    if(scorelog) {
       snprintf(tmplbuf,sizeof(tmplbuf),"-c%s -u%s scorelog %s",
               classe,user,logbuf);
       _daemoncmd(tmplbuf);
    }
    else write_logfile(fname,logbuf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int var_def_check ( char *  name)

Definition at line 608 of file variables.c.

{
    char *p, nbuf[MAX_NAMELEN+1];
    int i,tt;
    
    tt=-1;
    for(p=name+strlen(name);p>name && myisdigit(*(p-1));p--);
    if(*p && *p!='0' && p>name) tt=atoi(p);
    else p=name+strlen(name);
    if(p>name+MAX_NAMELEN) p=name+MAX_NAMELEN;
    memmove(nbuf,name,p-name); nbuf[p-name]=0;
    i=search_list(var_def,defined_var_total,sizeof(var_def[0]),nbuf);
    if(i<0) return -1;
    while(i>0 && tt<var_def[i].beg && strcmp(nbuf,var_def[i-1].name)==0) i--;
    while(i<defined_var_total-1 && tt>var_def[i].end &&
             strcmp(nbuf,var_def[i+1].name)==0) i++;
    if(tt<var_def[i].beg || tt>var_def[i].end) return -1;
    return i;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void var_proc ( char *  fname,
int  cache 
)

Definition at line 802 of file variables.c.

{
    int  t;
    char *p, tbuf[MAX_LINELEN+1];

    if(fname!=NULL && read_module_file(fname)) return;
    if(untrust&6) get_var_privileges();
    while(m_file.linepointer<m_file.linecnt) {
       t=m_file.lines[m_file.linepointer].isstart;
       if((t&~2)!=1 || m_file.lines[m_file.linepointer].llen==0) {
           m_file.linepointer++; continue;
       }
       wgetline(tbuf,MAX_LINELEN,&m_file); substnest=0;
       p=find_word_start(tbuf); if(*p==0) continue;
       if((t&2)!=0) exec_main(p+1);
       else exec_set(p);
    }
    close_working_file(&m_file,cache);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void write_logs ( void  )

Definition at line 320 of file log.c.

{
    char *p;
    p=getvar(ro_name[ro_cmd]); if(p==NULL || *p==0) p="no_cmd";
    access_log(p); if(strstr(session_prefix,"_check")!=NULL) return;
    module_log(); referer_log();
    if(new_session) session_log(p);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

struct { ... } charname[]