Laelaps  2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
utXmlCfg.cxx File Reference

Unit test liblaelaps robot descriptions. More...

#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <iostream>
#include <fstream>
#include <string>
#include "rnr/rnrconfig.h"
#include "rnr/log.h"
#include "rnr/opts.h"
#include "rnr/pkg.h"
#include "Laelaps/laelaps.h"
#include "Laelaps/laeDesc.h"
#include "Laelaps/laeXmlCfg.h"
#include "version.h"

Go to the source code of this file.

Macros

#define APP_EC_OK   0
 success exit code
 
#define APP_EC_ARGS   2
 command-line options/arguments error exit code
 
#define APP_EC_EXEC   4
 execution exit code
 

Functions

static void mainInit (int argc, char *argv[])
 Main initialization. More...
 
int main (int argc, char *argv[])
 Main. More...
 

Variables

static char * Argv0
 the command
 
static char * ArgFileName
 XML file name.
 
static OptsPgmInfo_T PgmInfo
 Program information. More...
 
static OptsInfo_T OptsInfo []
 Command line options information. More...
 

Detailed Description

Unit test liblaelaps robot descriptions.

LastChangedDate
2016-02-01 15:14:45 -0700 (Mon, 01 Feb 2016)
Rev
4289
Author
Robin Knight (robin.nosp@m..kni.nosp@m.ght@r.nosp@m.oadn.nosp@m.arrow.nosp@m.s.co.nosp@m.m)
Copyright
© 2015-2017. RoadNarrows LLC.
http://www.roadnarrows.com
All Rights Reserved

Definition in file utXmlCfg.cxx.

Function Documentation

static void mainInit ( int  argc,
char *  argv[] 
)
static

Main initialization.

Parameters
argcCommand-line argument count.
argvCommand-line argument list.
Exits:
Program terminates on conversion error.

Definition at line 123 of file utXmlCfg.cxx.

References APP_EC_ARGS, APP_EC_EXEC, APP_EC_OK, ArgFileName, Argv0, laelaps::LaeXmlCfg::loadFile(), main(), laelaps::LaeDesc::markAsDescribed(), OptsInfo, PgmInfo, PkgInfo, and laelaps::LaeDesc::print().

124 {
125  // name of this process
126  Argv0 = basename(argv[0]);
127 
128  // parse input options
129  argv = OptsGet(Argv0, &PkgInfo, &PgmInfo, OptsInfo, true, &argc, argv);
130 
131  if( argc < 1 )
132  {
133  fprintf(stderr, "Error: No Laelaps XMl configuration file specified.\n");
134  exit(APP_EC_ARGS);
135  }
136  else
137  {
138  ArgFileName = argv[0];
139  }
140 }
static char * Argv0
the command
Definition: utXmlCfg.cxx:84
static char * ArgFileName
XML file name.
Definition: utXmlCfg.cxx:85
static OptsInfo_T OptsInfo[]
Command line options information.
Definition: utXmlCfg.cxx:109
static const PkgInfo_T PkgInfo
Definition: version.h:45
#define APP_EC_ARGS
command-line options/arguments error exit code
Definition: utXmlCfg.cxx:81
static OptsPgmInfo_T PgmInfo
Program information.
Definition: utXmlCfg.cxx:90