/*************************************************************************\ * Copyright (c) 2002 The University of Chicago, as Operator of Argonne * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. * This file is distributed subject to a Software License Agreement found * in the file LICENSE that is included with this distribution. \*************************************************************************/ /* program: lba2sdds.c * purpose: converts a LBA file from the spiricon * laser-beam analyser to SDDS format * * M. Borland, 1994 $Log: lba2sdds.c,v $ Revision 1.6 2002/08/14 17:12:37 soliday Added Open License Revision 1.5 2001/01/23 19:14:56 soliday Standardized usage message. Revision 1.4 1999/05/25 19:03:14 soliday Removed compiler warning on linux. Revision 1.3 1995/11/13 15:54:23 borland Removed non-ANSI use of char * return value from sprintf(). * Revision 1.2 1995/09/06 14:55:51 saunders * First test release of SDDS1.5 * */ #include "mdb.h" #include "SDDS.h" #include "scan.h" #include "match_string.h" #define SET_DEFINITION 0 #define SET_PIPE 1 #define N_OPTIONS 2 char *option[N_OPTIONS] = { "definition", "pipe", }; char *USAGE = "lba2sdds [] []\n\ [-pipe[=input][,output]]\n\ -definition=,\n\n\ lba2sdds converts a Spiricon LBA file to SDDS format. The definition entries\ are of the form =, where the keyword is any valid field name for\ a SDDS column.\n\n\ Program by Michael Borland (This is Version 2, May 1995.)\n"; char *process_column_definition(char **argv, long argc); int main(int argc, char **argv) { SDDS_DATASET SDDS_dataset; SCANNED_ARG *scanned; long i_arg; char *input, *output, *definition; long hsize, vsize; char *data, *data_name; char header[200]; char ts1[100], ts2[100]; FILE *fpi; unsigned long pipeFlags; SDDS_RegisterProgramName(argv[0]); argc = scanargs(&scanned, argc, argv); if (argc<4) bomb(NULL, USAGE); input = output = data_name = NULL; definition = NULL; pipeFlags = 0; hsize = vsize = 0; for (i_arg=1; i_arg