Main Page | Compound List | File List | Compound Members | File Members

bytestream_usr.cc

Go to the documentation of this file.
00001 /*--------------------------------------------------------------------
00002  *
00003  * (C) Copyright Koninklijke Philips Electronics NV 2006. 
00004  * All rights reserved. This software is licensed under the terms of
00005  * version 2.1 of the GNU Lesser General Public License as published 
00006  * by the Free Software Foundation. For licensing and warranty
00007  * information, see the file COPYING in the main directory.
00008  *
00009  *------------------------------------------------------------------*/
00010 
00011 #include "bytestream_usr.h"
00012 #include "parse_options.h"
00013 
00014 byteStreamUsr::byteStreamUsr
00015 (
00016   const Id&               n,
00017   Out<byteStream_args_t>& arguments,
00018   char*                   filename
00019 )
00020 : //member initialisation
00021   Process(n),
00022   argumentsP(id("argumentsP"), arguments),
00023   cfg_filename(filename)
00024 {
00025 }
00026 
00027 void byteStreamUsr::main()
00028 {
00029   byteStream_args_t arguments;
00030 
00031   option_t options[] =
00032   {
00033     { "-path",  "str",  "srcdir", &arguments.path,        "env. variable containing path of filename"},
00034     { "file",   "str",  NULL,     &arguments.filename,  "filename"},
00035     { "-bytes", "int",  "1",      &arguments.nrofbytes, "#bytes to process"},
00036     { NULL, NULL, NULL, NULL, NULL}
00037   };
00038 
00039   #ifdef VERBOSE
00040     printf("%s: parsing cfg-file %s\n",
00041       fullName(),
00042       cfg_filename
00043     );
00044   #endif
00045   char *febeArgs[] = {"", "-ini", cfg_filename};  
00046   if (parse_options((char*)fullName(), 3, febeArgs, options))
00047   {
00048     exit(1);
00049   }
00050 
00051   #ifdef VERBOSE
00052     print_option_values(cfg_filename, options);
00053     printf("\n");
00054   #endif
00055 
00056   write(argumentsP, arguments);
00057 }

Generated on Wed Feb 15 14:52:43 2006 for bytestreamfebe by doxygen 1.3.2