serverspy/src/serverspy.cxx
//------------------------------------------------------------------------------
// Each time Developer Express client connect to the model server it 
// sources its server-side script.
//------------------------------------------------------------------------------
Each time Developer Express client connect to the model server it
sources its server-side script.
Each time Developer Express client connect to the model server it sources its server - side script .
void SourceDisliteStartupScript(int socket) {
    char ScriptFile[1024];
    char *p;
    p=getenv("PSETHOME");
    if(p!=NULL) {
        sprintf(ScriptFile,"%s/lib//dislite.dis",p);
    } else {
        sprintf(ScriptFile,"c:/discover/lib/dislite.dis");
    } 
    FILE *file = fopen(ScriptFile, "r");
    if(!file){
        return;
    }
    struct stat st;
    stat(ScriptFile, &st);
    int size  = st.st_size;
    char *buf = new char[size+1];
    int sz    = fread(buf, 1, size, file);
    if(sz == 0){
        return;
    }
    buf[sz] = '\0';
    sendBuffer(socket,buf);
    char * fr =  "set_printformat 0";
    sendBuffer(socket,fr);
    delete [] buf;
    fclose(file);
}
void SourceDisliteStartupScript ( int socket ) { char ScriptFile [ 1024 ] ; char * p ; p = getenv ( " " ) ; if ( p != NULL ) { sprintf ( ScriptFile , " " , p ) ; } else { sprintf ( ScriptFile , " " ) ; } FILE * file = fopen ( ScriptFile , " " ) ; if ( ! file ) { return ; } struct stat st ; stat ( ScriptFile , & st ) ; int size = st . st_size ; char * buf = new char [ size + 1 ] ; int sz = fread ( buf , 1 , size , file ) ; if ( sz == 0 ) { return ; } buf [ sz ] = ' \0 ' ; sendBuffer ( socket , buf ) ; char * fr = " " ; sendBuffer ( socket , fr ) ; delete [ ] buf ; fclose ( file ) ; }
Each time Developer Express client connect to the model server it
sources its server-side script.
Each time Developer Express client connect to the model server it sources its server - side script .