/*************************************************************************\ * 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: raw2sdds * purpose: converts a raw data stream of binary data * to SDDS format * M. Borland, 1994 $Log: raw2sdds.c,v $ Revision 1.5 2002/08/14 17:12:38 soliday Added Open License Revision 1.4 2001/01/23 19:14:57 soliday Standardized usage message. Revision 1.3 1999/05/25 19:04:18 soliday Removed compiler warning on linux. Revision 1.2 1995/09/06 14:55:56 saunders First test release of SDDS1.5 */ #include "mdb.h" #include "SDDS.h" #include "scan.h" #include "match_string.h" #define DEFAULT_HSIZE 484 #define DEFAULT_VSIZE 512 #define SET_DEFINITION 0 #define SET_SIZE 1 #define N_OPTIONS 2 char *option[N_OPTIONS] = { "definition", "size" }; char *USAGE = "raw2sdds \n\ -definition=,\n\ [-size=,]\n\n\ raw2sdds converts a binary data stream 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 1, February 1994.)\n"; char *process_column_definition(char **argv, long argc); int main(int argc, char **argv) { SDDS_TABLE SDDS_table; SCANNED_ARG *scanned; long i_arg; char *input, *output, *definition; long hsize, vsize; char *data, *data_name; char ts1[100], ts2[100]; FILE *fpi; argc = scanargs(&scanned, argc, argv); if (argc<4) bomb(NULL, USAGE); input = output = data_name = NULL; hsize = DEFAULT_HSIZE; vsize = DEFAULT_VSIZE; definition = NULL; for (i_arg=1; i_arg