Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

emcargs.cc File Reference

#include <string.h>
#include <stdio.h>
#include "rcs.hh"
#include "emcglb.h"
#include "emccfg.h"

Include dependency graph for emcargs.cc:

Include dependency graph

Go to the source code of this file.

Defines

#define __attribute__(x)

Functions

char __attribute__ ((unused)) ident[]="$Id


Define Documentation

#define __attribute__  
 

Definition at line 27 of file emcargs.cc.


Function Documentation

char __attribute__ (unused)    [static]
 

Definition at line 31 of file emcargs.cc.

00031                                                   : emcargs.cc,v 1.6 2001/06/29 20:27:29 wshackle Exp $";
00032 
00033 int emcGetArgs(int argc, char *argv[])
00034 {
00035   int t;
00036 
00037   /* process command line args, indexing argv[] from [1] */
00038   for (t = 1; t < argc; t++) {
00039     if (!strcmp(argv[t], "-ini")) {
00040       if (t == argc - 1) {
00041         return -1;
00042       }
00043       else {
00044         strcpy(EMC_INIFILE, argv[t+1]);
00045         t++;
00046       }
00047       continue;
00048     }
00049     if (!strcmp(argv[t], "-rcsdebug")) {
00050       set_rcs_print_flag(PRINT_EVERYTHING);
00051       max_rcs_errors_to_print=-1;
00052       continue;
00053     }
00054 #ifndef linux_2_0_36
00055     if (!strcmp(argv[t], "-queryhost")) {
00056       char qhost[80];
00057       printf("EMC Host?");
00058       fgets(qhost,80,stdin);
00059       for (int i = 0; i < 80; i++) {
00060         if (qhost[i] == '\r' || qhost[i] == '\n' || qhost[i] == ' ') {
00061           qhost[i]=0;
00062           break;
00063         }
00064       }
00065       nmlSetHostAlias(qhost,"localhost"); /* If localhost appears in .nml file it will overriden by this argument. */
00066       nmlForceRemoteConnection();
00067       /* The only good reason for aliasing the host that I know of is to
00068          connect to a remote server so we will ignore the LOCAL/REMOTE
00069          field in the .nml file and always connect remotely. */
00070       continue;
00071     }
00072     if (!strcmp(argv[t], "-host")) {
00073       if (t == argc - 1) {
00074         return -1;
00075       }
00076       else {
00077         nmlSetHostAlias(argv[t+1],"localhost"); /* If localhost appears in .nml file it will overriden by this argument. */
00078         nmlForceRemoteConnection();
00079         /* The only good reason for aliasing the host that I know of is to
00080            connect to a remote server so we will ignore the LOCAL/REMOTE
00081            field in the .nml file and always connect remotely. */
00082         t++;
00083       }
00084       continue;
00085     }
00086 #endif
00087   }
00088   /* else not recognized-- ignore */
00089 
00090   return 0;
00091 }


Generated on Sun Dec 2 15:27:52 2001 for EMC by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001