/disk4/html/www/moses/doxygen/irstlm/trunk/src/cmd.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdarg.h>
#include <unistd.h>
#include "cmd.h"

Go to the source code of this file.

Defines

#define FALSE   0
#define TRUE   1
#define LINSIZ   10240

Functions

static char *** str2array (char *s, char *sep)
static int SetParam (Cmd_T *cmd, char *s)
static int SetEnum (Cmd_T *cmd, char *s)
static int SetFlag (Cmd_T *cmd, char *s)
static int SetSubrange (Cmd_T *cmd, char *s)
static int SetStrArray (Cmd_T *cmd, char *s)
static int SetNumArray (Cmd_T *cmd, char *s)
static int SetGte (Cmd_T *cmd, char *s)
static int SetLte (Cmd_T *cmd, char *s)
static int CmdError (char *opt)
static int EnumError (Cmd_T *cmd, char *s)
static int SubrangeError (Cmd_T *cmd, int n)
static int GteError (Cmd_T *cmd, int n)
static int LteError (Cmd_T *cmd, int n)
static int PrintParam (Cmd_T *cmd, int TypeFlag, int ValFlag, FILE *fp)
static int PrintParams4 (int TypeFlag, int ValFlag, int MsgFlag, FILE *fp)
static int FreeParam (Cmd_T *cmd)
static int PrintEnum (Cmd_T *cmd, int TypeFlag, int ValFlag, FILE *fp)
static int PrintFlag (Cmd_T *cmd, int TypeFlag, int ValFlag, FILE *fp)
static int PrintStrArray (Cmd_T *cmd, int TypeFlag, int ValFlag, FILE *fp)
static int PrintIntArray (Cmd_T *cmd, int TypeFlag, int ValFlag, FILE *fp)
static int PrintDblArray (Cmd_T *cmd, int TypeFlag, int ValFlag, FILE *fp)
static int BuildCmdList (Cmd_T **cmdp, int *cmdSz, char *ParName, va_list args)
static int StoreCmdLine (char *s)
int DeclareParams (char *ParName,...)
int GetParams (int *n, char ***a, char *DefCmd)
int GetDotParams (char *ParName,...)
int GetStrParams (char **lines, int n, char *parName,...)
int PrintParams (int ValFlag, FILE *fp)
int FullPrintParams (int TypeFlag, int ValFlag, int MsgFlag, FILE *fp)
int SPrintParams (char ***a, char *pfx)
int EnumIdx (Enum_T *en, char *s)
char * EnumStr (Enum_T *en, int i)


Define Documentation

#define FALSE   0

Definition at line 43 of file cmd.c.

Referenced by CmdError(), and MosesTuning::SentenceLevelScorer::Init().

#define LINSIZ   10240

Definition at line 70 of file cmd.c.

Referenced by GetParams().

#define TRUE   1

Definition at line 44 of file cmd.c.

Referenced by CmdError(), and MosesTuning::SentenceLevelScorer::Init().


Function Documentation

static int BuildCmdList ( Cmd_T **  cmdp,
int *  cmdSz,
char *  ParName,
va_list  args 
)

static int CmdError ( char *  opt  ) 

Definition at line 513 of file cmd.c.

References FALSE, PrintParams4(), and TRUE.

Referenced by GetParams().

Here is the call graph for this function:

Here is the caller graph for this function:

int DeclareParams ( char *  ParName,
  ... 
)

Definition at line 158 of file cmd.c.

References BuildCmdList().

Referenced by main(), and mixture::mixture().

Here is the call graph for this function:

Here is the caller graph for this function:

static int EnumError ( Cmd_T cmd,
char *  s 
)

Definition at line 905 of file cmd.c.

References Enum_T::Name, Cmd_T::Name, and Cmd_T::p.

Referenced by SetEnum(), and SetFlag().

Here is the caller graph for this function:

int EnumIdx ( Enum_T en,
char *  s 
)

Definition at line 796 of file cmd.c.

References Enum_T::Idx, and Enum_T::Name.

char* EnumStr ( Enum_T en,
int  i 
)

Definition at line 806 of file cmd.c.

References Enum_T::Idx, and Enum_T::Name.

static int FreeParam ( Cmd_T cmd  ) 

Definition at line 523 of file cmd.c.

References CMDDBLARRAYTYPE, CMDGTETYPE, CMDINTARRAYTYPE, CMDLTETYPE, CMDSTRARRAYTYPE, CMDSUBRANGETYPE, Cmd_T::p, and Cmd_T::Type.

Referenced by GetDotParams(), and GetStrParams().

Here is the caller graph for this function:

int FullPrintParams ( int  TypeFlag,
int  ValFlag,
int  MsgFlag,
FILE *  fp 
)

Definition at line 352 of file cmd.c.

References PrintParams4().

Referenced by print_help().

Here is the call graph for this function:

Here is the caller graph for this function:

int GetDotParams ( char *  ParName,
  ... 
)

Definition at line 303 of file cmd.c.

References BuildCmdList(), FreeParam(), and Moses::Scan().

Here is the call graph for this function:

int GetParams ( int *  n,
char ***  a,
char *  DefCmd 
)

Definition at line 170 of file cmd.c.

References CmdError(), LINSIZ, NULL, pclose(), popen(), Moses::Scan(), and StoreCmdLine().

Referenced by main(), and mixture::mixture().

Here is the call graph for this function:

Here is the caller graph for this function:

int GetStrParams ( char **  lines,
int  n,
char *  parName,
  ... 
)

Definition at line 322 of file cmd.c.

References BuildCmdList(), FreeParam(), and Moses::Scan().

Here is the call graph for this function:

static int GteError ( Cmd_T cmd,
int  n 
)

Definition at line 922 of file cmd.c.

References Cmd_T::Name, and Cmd_T::p.

Referenced by SetGte().

Here is the caller graph for this function:

static int LteError ( Cmd_T cmd,
int  n 
)

Definition at line 934 of file cmd.c.

References Cmd_T::Name, and Cmd_T::p.

Referenced by SetLte().

Here is the caller graph for this function:

static int PrintDblArray ( Cmd_T cmd,
int  TypeFlag,
int  ValFlag,
FILE *  fp 
)

Definition at line 1083 of file cmd.c.

References Cmd_T::Name, Cmd_T::p, and Cmd_T::Val.

Referenced by PrintParam().

Here is the caller graph for this function:

static int PrintEnum ( Cmd_T cmd,
int  TypeFlag,
int  ValFlag,
FILE *  fp 
)

Definition at line 958 of file cmd.c.

References Enum_T::Idx, Enum_T::Name, Cmd_T::Name, Cmd_T::p, and Cmd_T::Val.

Referenced by PrintParam().

Here is the caller graph for this function:

static int PrintFlag ( Cmd_T cmd,
int  TypeFlag,
int  ValFlag,
FILE *  fp 
)

Definition at line 989 of file cmd.c.

References Enum_T::Idx, Enum_T::Name, Cmd_T::Name, Cmd_T::p, and Cmd_T::Val.

Referenced by PrintParam().

Here is the caller graph for this function:

static int PrintIntArray ( Cmd_T cmd,
int  TypeFlag,
int  ValFlag,
FILE *  fp 
)

Definition at line 1051 of file cmd.c.

References Cmd_T::Name, Cmd_T::p, and Cmd_T::Val.

Referenced by PrintParam().

Here is the caller graph for this function:

static int PrintParam ( Cmd_T cmd,
int  TypeFlag,
int  ValFlag,
FILE *  fp 
)

Definition at line 543 of file cmd.c.

References CMDDBLARRAYTYPE, CMDDOUBLETYPE, CMDENUMTYPE, CMDFLAGTYPE, CMDFLOATTYPE, CMDGTETYPE, CMDINTARRAYTYPE, CMDINTTYPE, CMDLTETYPE, CMDSTRARRAYTYPE, CMDSTRINGTYPE, CMDSUBRANGETYPE, Cmd_T::Name, Cmd_T::p, PrintDblArray(), PrintEnum(), PrintFlag(), PrintIntArray(), PrintStrArray(), Cmd_T::Type, and Cmd_T::Val.

Referenced by PrintParams4().

Here is the call graph for this function:

Here is the caller graph for this function:

int PrintParams ( int  ValFlag,
FILE *  fp 
)

Definition at line 343 of file cmd.c.

References PrintParams4().

Here is the call graph for this function:

static int PrintParams4 ( int  TypeFlag,
int  ValFlag,
int  MsgFlag,
FILE *  fp 
)

Definition at line 369 of file cmd.c.

References Cmd_T::Msg, Cmd_T::Name, and PrintParam().

Referenced by CmdError(), FullPrintParams(), and PrintParams().

Here is the call graph for this function:

Here is the caller graph for this function:

static int PrintStrArray ( Cmd_T cmd,
int  TypeFlag,
int  ValFlag,
FILE *  fp 
)

Definition at line 1022 of file cmd.c.

References Cmd_T::Name, Cmd_T::p, and Cmd_T::Val.

Referenced by PrintParam().

Here is the caller graph for this function:

static int SetEnum ( Cmd_T cmd,
char *  s 
)

Definition at line 781 of file cmd.c.

References EnumError(), Enum_T::Idx, Enum_T::Name, Cmd_T::p, and Cmd_T::Val.

Referenced by SetParam().

Here is the call graph for this function:

Here is the caller graph for this function:

static int SetFlag ( Cmd_T cmd,
char *  s 
)

Definition at line 814 of file cmd.c.

References EnumError(), Enum_T::Idx, Enum_T::Name, Cmd_T::p, and Cmd_T::Val.

Referenced by SetParam().

Here is the call graph for this function:

Here is the caller graph for this function:

static int SetGte ( Cmd_T cmd,
char *  s 
)

Definition at line 850 of file cmd.c.

References GteError(), Cmd_T::Name, Cmd_T::p, and Cmd_T::Val.

Referenced by SetParam().

Here is the call graph for this function:

Here is the caller graph for this function:

static int SetLte ( Cmd_T cmd,
char *  s 
)

Definition at line 886 of file cmd.c.

References LteError(), Cmd_T::Name, Cmd_T::p, and Cmd_T::Val.

Referenced by SetParam().

Here is the call graph for this function:

Here is the caller graph for this function:

static int SetNumArray ( Cmd_T cmd,
char *  s 
)

Definition at line 877 of file cmd.c.

References Cmd_T::p, Cmd_T::Type, and Cmd_T::Val.

Referenced by SetParam().

Here is the caller graph for this function:

static int SetParam ( Cmd_T cmd,
char *  s 
)

static int SetStrArray ( Cmd_T cmd,
char *  s 
)

Definition at line 869 of file cmd.c.

References Cmd_T::p, str2array(), and Cmd_T::Val.

Referenced by SetParam().

Here is the call graph for this function:

Here is the caller graph for this function:

static int SetSubrange ( Cmd_T cmd,
char *  s 
)

Definition at line 831 of file cmd.c.

References Cmd_T::Name, Cmd_T::p, SubrangeError(), and Cmd_T::Val.

Referenced by SetParam().

Here is the call graph for this function:

Here is the caller graph for this function:

int SPrintParams ( char ***  a,
char *  pfx 
)

Definition at line 400 of file cmd.c.

References Cmd_T::ArgStr, n, and Cmd_T::Name.

static int StoreCmdLine ( char *  s  ) 

Definition at line 1187 of file cmd.c.

Referenced by GetParams().

Here is the caller graph for this function:

static char ** str2array ( char *  s,
char *  sep 
)

Definition at line 1115 of file cmd.c.

Referenced by SetStrArray().

Here is the caller graph for this function:

static int SubrangeError ( Cmd_T cmd,
int  n 
)

Definition at line 946 of file cmd.c.

References Cmd_T::Name, and Cmd_T::p.

Referenced by SetSubrange().

Here is the caller graph for this function:


Generated on Thu Jul 6 00:31:23 2017 for Moses by  doxygen 1.5.9