/*************************************************************************\ * 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: readexample.c * purpose: simple example of reading an SDDS file * * Michael Borland, 1994 $Log: readexample.c,v $ Revision 1.4 2002/08/14 17:12:38 soliday Added Open License Revision 1.3 1995/09/06 14:55:58 saunders First test release of SDDS1.5 */ #include "SDDS.h" char *USAGE = "readexample \n\ This program is a simple example that illustrates the use of\n\ SDDS input routines.\n\ Program by Michael Borland. (This is version 1, August 1994.)\n"; #define COLUMNS 2 main(int argc, char **argv) { SDDS_DATASET SDDS_dataset; char *input; char *column_name[COLUMNS] = {"f", "FFT"}; char *column_units[COLUMNS] = {"MHz", ""}; double *f; float *FFT; long i, rows, *fl; if (argc!=2) { fprintf(stderr, "error: no input file given\nusage: %s\n", USAGE); exit(1); } input = argv[1]; if (!SDDS_InitializeInput(&SDDS_dataset, input)) { SDDS_PrintErrors(stderr, SDDS_VERBOSE_PrintErrors); exit(1); } for (i=0; i