contrib/dsgrid/Src/dsuser.c
void c_dssetc(char *pnam, char *vnam)
{
   int i;
   char *s;
   if (!strncmp(pnam,"xxx",3) || !strncmp(pnam,"XXX",3)) {
      for ( ;  *vnam != '\0'; ++s, ++vnam) {
         *s = *vnam;
      }
         *s = '\0';
   }
   else if (!strncmp(pnam,"erf",3) || !strncmp(pnam,"ERF",3)) {
      if (!strncmp(vnam,"stderr",6)) {
         ds_filee = stderr;
         strcpy(ds_error_file,"stderr");
      }
      else if (!strncmp(vnam,"stdout",6)) {
         ds_filee = stdout;
         strcpy(ds_error_file,"stdout");
      }
      else {
         if ((ds_filee = fopen(vnam,"w")) == (FILE *) NULL)
         {
            DSErrorHnd(5, "c_dssetc", stderr, "\n");
            return;
         }
         strcpy(ds_error_file,vnam);
      }
   }
   else {
      sprintf(ds_emsg,"\n  Parameter name supplied is: %s\n",pnam);
      DSErrorHnd(4, "c_dssetc", ds_filee, ds_emsg);
   }
}
/*
 *  Set values for character parameters.
 */
Set values for character parameters.
Set values for character parameters .
void c_dssetc(char *pnam, char *vnam)
{
   int i;
   char *s;
   if (!strncmp(pnam,"xxx",3) || !strncmp(pnam,"XXX",3)) {
      for ( ;  *vnam != '\0'; ++s, ++vnam) {
         *s = *vnam;
      }
         *s = '\0';
   }
   else if (!strncmp(pnam,"erf",3) || !strncmp(pnam,"ERF",3)) {
      if (!strncmp(vnam,"stderr",6)) {
         ds_filee = stderr;
         strcpy(ds_error_file,"stderr");
      }
      else if (!strncmp(vnam,"stdout",6)) {
         ds_filee = stdout;
         strcpy(ds_error_file,"stdout");
      }
      else {
         if ((ds_filee = fopen(vnam,"w")) == (FILE *) NULL)
         {
            DSErrorHnd(5, "c_dssetc", stderr, "\n");
            return;
         }
         strcpy(ds_error_file,vnam);
      }
   }
   else {
      sprintf(ds_emsg,"\n  Parameter name supplied is: %s\n",pnam);
      DSErrorHnd(4, "c_dssetc", ds_filee, ds_emsg);
   }
}
void c_dssetc ( char * pnam , char * vnam ) { int i ; char * s ; if ( ! strncmp ( pnam , " " , 3 ) || ! strncmp ( pnam , " " , 3 ) ) { for ( ; * vnam != ' \0 ' ; ++ s , ++ vnam ) { * s = * vnam ; } * s = ' \0 ' ; } else if ( ! strncmp ( pnam , " " , 3 ) || ! strncmp ( pnam , " " , 3 ) ) { if ( ! strncmp ( vnam , " " , 6 ) ) { ds_filee = stderr ; strcpy ( ds_error_file , " " ) ; } else if ( ! strncmp ( vnam , " " , 6 ) ) { ds_filee = stdout ; strcpy ( ds_error_file , " " ) ; } else { if ( ( ds_filee = fopen ( vnam , " " ) ) == ( FILE * ) NULL ) { DSErrorHnd ( 5 , " " , stderr , " \n " ) ; return ; } strcpy ( ds_error_file , vnam ) ; } } else { sprintf ( ds_emsg , " \n \n " , pnam ) ; DSErrorHnd ( 4 , " " , ds_filee , ds_emsg ) ; } }
Set values for character parameters.
Set values for character parameters .