/* * Copyright (c) 1995, 1996 Gunther Schadow. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include "exception.h" #include "logfile.h" #if YYDEBUG extern int yydebug; extern int yy_flex_debug; #endif extern FILE *yyin; int yyparse(); #ifndef APPLICATION # define APPLICATION "ABL" #endif #ifndef FACILITY # define FACILITY NULL #endif #ifndef REC_APP # define REC_APP "CLI" #endif #ifndef REC_FAC # define REC_FAC "060_IOP" #endif const char *App = APPLICATION; const char *Fac = FACILITY; const char *RecApp = REC_APP; const char *RecFac = REC_FAC; const char *device = NULL; const char *service = NULL; const char *host = NULL; main(int argc, char *argv[]) { if(argc < 4) { cerr << "usage: " << argv[0] << " [-d] device service host" << endl; exit(1); } log_init(argv[0], "/tmp/abl300.log", (char *)App); if(strcmp(argv[1],"-d") == 0) { #if YYDEBUG yydebug = 1; yy_flex_debug = 1; #endif log_level(L_JUNK); argv++; } else { #if YYDEBUG yydebug = 0; yy_flex_debug = 0; #endif log_level(L_MESG); } device = argv[1]; service = argv[2]; host = argv[3]; // FIXME!! fstream radio_file(device, ios:.in); if(strcmp(device,"-") == 0) yyin = stdin; else { yyin = fopen(device, "r"); if(yyin == NULL) ERROS("fopen: `%s'", device); } LOGINFO("ABL-HL7 interface started on %s", device); while(yyparse() == 0); return SUCCESS; }