updated host list M.Z.

This commit is contained in:
cvs
2003-08-27 12:18:10 +00:00
parent a14b5bda46
commit a31fdc1846
3 changed files with 50 additions and 13 deletions

View File

@@ -2,6 +2,7 @@
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include "myc_str.h"
#include "myc_fortran.h"
@@ -16,15 +17,15 @@ static Instrument list[]={
{ "FOCUS", "lnsa16.psi.ch", 9753, "FOCUS" , 1},
{ "TASP", "lnsa12.psi.ch", 9753, "TASP", 1},
{ "TASP0", "lnsa09.psi.ch", 9753, NULL , 0},
{ "RITA", "rita2.psi.ch", 9753, NULL , 0},
{ "PREP", "lnsa01.psi.ch", 9753, NULL , 0},
{ "AREA", "lnsa01.psi.ch", 9751, NULL , 0},
{ "TEST", "lnsa15.psi.ch", 9753, "lnslib", 2}
{ "RITA", "pc4345.psi.ch", 9753, NULL , 0},
{ "PREP", "lnsa15.psi.ch", 9753, "lnslib", 2},
{ "AREA", "lnsa15.psi.ch", 9751, "lnslib", 2},
{ "TEST", "lnsa15.psi.ch", 9755, "lnslib", 2}
};
int InstrHost(char *input, char *instr, char *host, char *user, char *pcod
, int instr_len, int host_len, int user_len, int pcod_len) {
char buf[256];
char buf[256], *lnscode;
int i, j;
struct tm tim;
time_t t;
@@ -56,7 +57,12 @@ int InstrHost(char *input, char *instr, char *host, char *user, char *pcod
} else if (list[j].cod == 2) {
time(&t);
tim=*localtime(&t);
sprintf(pcod, "%02dlns%d", tim.tm_year % 100, tim.tm_mon/6+1);
lnscode=getenv("LNSCODE");
if (lnscode == NULL) {
sprintf(pcod, "%02dlns%d", tim.tm_year % 100, tim.tm_mon/6+1);
} else {
sprintf(pcod, "%02dlns%s", tim.tm_year % 100, lnscode);
}
} else {
str_ncpy(pcod, " ", pcod_len);
}