ARB
Classes | Namespaces | Macros | Typedefs | Functions
gb_aci_impl.h File Reference
#include <gb_aci.h>
Include dependency graph for gb_aci_impl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  GBL_IMPL::gbl_param
 

Namespaces

 GBL_IMPL
 

Macros

#define PASS_2_OUT(args, s)   (args)->output.insert(s)
 
#define COPY_2_OUT(args, s)   PASS_2_OUT(args, ARB_strdup(s))
 
#define IN_2_OUT(args, i)   PASS_2_OUT(args, args->input.get_smart(i))
 
#define PARAM_2_OUT(args, i)   PASS_2_OUT(args, args->get_param_smart(i))
 
#define FORMAT_2_OUT(args, fmt, value)   PASS_2_OUT(args, GBS_global_string_copy(fmt, value))
 
#define GBL_BEGIN_PARAMS   gbl_param *params = NULp
 
#define GBL_PARAM_TYPE(type, var, param_name, def, help_text)   type var = gbl_param_##type(param_name, def, help_text, &params, &var)
 
#define GBL_STRUCT_PARAM_TYPE(type, strct, member, param_name, def, help_text)   strct.member = gbl_param_##type(param_name, def, help_text, &params, &strct.member)
 
#define PARAM_IF(cond, param)   ((cond) ? (param) : NULp)
 
#define GBL_PARAM_INT(var,param_name, def, help_text)   GBL_PARAM_TYPE(int, var, param_name, def, help_text)
 
#define GBL_PARAM_CHAR(var,param_name, def, help_text)   GBL_PARAM_TYPE(char, var, param_name, def, help_text)
 
#define GBL_PARAM_UINT(var,param_name, def, help_text)   GBL_PARAM_TYPE(nat, var, param_name, def, help_text)
 
#define GBL_PARAM_STRING(var, param_name, def, help_text)   GBL_PARAM_TYPE(String, var, param_name, def, help_text)
 
#define GBL_PARAM_BIT(var,param_name, def, help_text)   GBL_PARAM_TYPE(bit, var, param_name, def, help_text)
 
#define GBL_STRUCT_PARAM_INT(strct,member, param_name, def, help_text)   GBL_STRUCT_PARAM_TYPE(int, strct, member, param_name, def, help_text)
 
#define GBL_STRUCT_PARAM_CHAR(strct,member, param_name, def, help_text)   GBL_STRUCT_PARAM_TYPE(char, strct, member, param_name, def, help_text)
 
#define GBL_STRUCT_PARAM_UINT(strct,member, param_name, def, help_text)   GBL_STRUCT_PARAM_TYPE(nat, strct, member, param_name, def, help_text)
 
#define GBL_STRUCT_PARAM_STRING(strct, member, param_name, def, help_text)   GBL_STRUCT_PARAM_TYPE(String, strct, member, param_name, def, help_text)
 
#define GBL_STRUCT_PARAM_BIT(strct,member, param_name, def, help_text)   GBL_STRUCT_PARAM_TYPE(bit, strct, member, param_name, def, help_text)
 
#define GBL_TRACE_PARAMS(args)
 
#define GBL_END_PARAMS
 
#define GBL_CHECK_FREE_PARAM(nr, cnt)
 
#define TRACE_ACI(text)   if (GBL_IMPL::traceACI) GBL_IMPL::print_trace(text)
 
#define DO_AND_RETURN_ON_ERROR(cmd)
 
#define EXPECT_NO_PARAM(args)   DO_AND_RETURN_ON_ERROR(GBL_IMPL::check_no_parameter(args))
 
#define EXPECT_PARAMS_PASSED(args, syntax)   DO_AND_RETURN_ON_ERROR(GBL_IMPL::check_has_parameters(args,syntax))
 
#define ACCEPT_ANY_PARAMS(args)   gb_assert((args)->set_params_checked())
 
#define EXPECT_PARAMS(args, cnt, help)   DO_AND_RETURN_ON_ERROR(GBL_IMPL::check_parameters(args, cnt, help))
 
#define EXPECT_OPTIONAL_PARAMS(args, fixCnt, fixhelp, optCnt, opthelp)   DO_AND_RETURN_ON_ERROR(GBL_IMPL::check_optional_parameters(args, fixCnt, fixhelp, optCnt, opthelp, true, true))
 
#define EXPECT_OPTIONAL_PARAMS_CUSTOM(args, fixCnt, fixhelp, optCnt, opthelp, trail, all)   DO_AND_RETURN_ON_ERROR(GBL_IMPL::check_optional_parameters(args, fixCnt, fixhelp, optCnt, opthelp, trail, all))
 
#define EXPECT_LEGAL_STREAM_INDEX(args, number)
 
#define EXPECT_ITEM_REFERENCED(args)   DO_AND_RETURN_ON_ERROR(GBL_IMPL::check_item_referenced(args))
 
#define COMMAND_DROPS_INPUT_STREAMS(args)
 

Typedefs

typedef const charGBL_IMPL::String
 
typedef int GBL_IMPL::bit
 
typedef unsigned int GBL_IMPL::nat
 

Functions

const charGBL_IMPL::search_matching_parenthesis (const char *source)
 
charGBL_IMPL::search_matching_parenthesis (char *source)
 
void GBL_IMPL::gbl_new_param (gbl_param **pp, GB_TYPES type, void *vaddr, const char *param_name, const char *help_text)
 
int GBL_IMPL::gbl_param_int (const char *param_name, int def, const char *help_text, gbl_param **pp, int *vaddr)
 
char GBL_IMPL::gbl_param_char (const char *param_name, char def, const char *help_text, gbl_param **pp, char *vaddr)
 
nat GBL_IMPL::gbl_param_nat (const char *param_name, nat def, const char *help_text, gbl_param **pp, nat *vaddr)
 
const charGBL_IMPL::gbl_param_String (const char *param_name, const char *def, const char *help_text, gbl_param **pp, String *vaddr)
 
int GBL_IMPL::gbl_param_bit (const char *param_name, int def, const char *help_text, gbl_param **pp, bit *vaddr)
 
GB_ERROR GBL_IMPL::trace_params (const GBL_streams &param, gbl_param *ppara, const char *com)
 
void GBL_IMPL::print_trace (const char *text)
 
void GBL_IMPL::modify_trace_indent (int diff)
 
GB_ERROR GBL_IMPL::check_no_parameter (GBL_command_arguments *args)
 
GB_ERROR GBL_IMPL::check_has_parameters (GBL_command_arguments *args, const char *param_syntax)
 
GB_ERROR GBL_IMPL::check_parameters (GBL_command_arguments *args, int expected, const char *parameterList)
 
GB_ERROR GBL_IMPL::check_optional_parameters (GBL_command_arguments *args, int fix, const char *fixParam, int opt, const char *optParam, bool opt_trailing, bool opt_expect_all)
 
GB_ERROR GBL_IMPL::check_valid_index (int number, const char *what, int min, int max)
 
GB_ERROR GBL_IMPL::check_valid_stream_index (GBL_command_arguments *args, int number)
 
GB_ERROR GBL_IMPL::check_valid_param_index (GBL_command_arguments *args, int number)
 
GB_ERROR GBL_IMPL::check_item_referenced (GBL_command_arguments *args)
 

Macro Definition Documentation

#define PASS_2_OUT (   args,
  s 
)    (args)->output.insert(s)
#define COPY_2_OUT (   args,
  s 
)    PASS_2_OUT(args, ARB_strdup(s))

Definition at line 20 of file gb_aci_impl.h.

Referenced by gbl_sequence(), and gbl_split().

#define IN_2_OUT (   args,
 
)    PASS_2_OUT(args, args->input.get_smart(i))
#define PARAM_2_OUT (   args,
 
)    PASS_2_OUT(args, args->get_param_smart(i))

Definition at line 22 of file gb_aci_impl.h.

Referenced by gbl_echo().

#define FORMAT_2_OUT (   args,
  fmt,
  value 
)    PASS_2_OUT(args, GBS_global_string_copy(fmt, value))
#define GBL_BEGIN_PARAMS   gbl_param *params = NULp

Definition at line 45 of file gb_aci_impl.h.

Referenced by format(), gbl_change_gc(), gbl_checksum(), gbl_diff(), and gbl_filter().

#define GBL_PARAM_TYPE (   type,
  var,
  param_name,
  def,
  help_text 
)    type var = gbl_param_##type(param_name, def, help_text, &params, &var)

Definition at line 91 of file gb_aci_impl.h.

#define GBL_STRUCT_PARAM_TYPE (   type,
  strct,
  member,
  param_name,
  def,
  help_text 
)    strct.member = gbl_param_##type(param_name, def, help_text, &params, &strct.member)

Definition at line 92 of file gb_aci_impl.h.

#define PARAM_IF (   cond,
  param 
)    ((cond) ? (param) : NULp)

Definition at line 95 of file gb_aci_impl.h.

Referenced by format().

#define GBL_PARAM_INT (   var,
  param_name,
  def,
  help_text 
)    GBL_PARAM_TYPE(int, var, param_name, def, help_text)

Definition at line 97 of file gb_aci_impl.h.

Referenced by format().

#define GBL_PARAM_CHAR (   var,
  param_name,
  def,
  help_text 
)    GBL_PARAM_TYPE(char, var, param_name, def, help_text)

Definition at line 98 of file gb_aci_impl.h.

#define GBL_PARAM_UINT (   var,
  param_name,
  def,
  help_text 
)    GBL_PARAM_TYPE(nat, var, param_name, def, help_text)

Definition at line 99 of file gb_aci_impl.h.

Referenced by format().

#define GBL_PARAM_STRING (   var,
  param_name,
  def,
  help_text 
)    GBL_PARAM_TYPE(String, var, param_name, def, help_text)

Definition at line 100 of file gb_aci_impl.h.

Referenced by format(), and gbl_checksum().

#define GBL_PARAM_BIT (   var,
  param_name,
  def,
  help_text 
)    GBL_PARAM_TYPE(bit, var, param_name, def, help_text)

Definition at line 101 of file gb_aci_impl.h.

Referenced by format(), and gbl_checksum().

#define GBL_STRUCT_PARAM_INT (   strct,
  member,
  param_name,
  def,
  help_text 
)    GBL_STRUCT_PARAM_TYPE(int, strct, member, param_name, def, help_text)

Definition at line 103 of file gb_aci_impl.h.

Referenced by gbl_change_gc().

#define GBL_STRUCT_PARAM_CHAR (   strct,
  member,
  param_name,
  def,
  help_text 
)    GBL_STRUCT_PARAM_TYPE(char, strct, member, param_name, def, help_text)

Definition at line 104 of file gb_aci_impl.h.

Referenced by gbl_diff().

#define GBL_STRUCT_PARAM_UINT (   strct,
  member,
  param_name,
  def,
  help_text 
)    GBL_STRUCT_PARAM_TYPE(nat, strct, member, param_name, def, help_text)

Definition at line 105 of file gb_aci_impl.h.

#define GBL_STRUCT_PARAM_STRING (   strct,
  member,
  param_name,
  def,
  help_text 
)    GBL_STRUCT_PARAM_TYPE(String, strct, member, param_name, def, help_text)

Definition at line 106 of file gb_aci_impl.h.

Referenced by gbl_change_gc(), and gbl_filter().

#define GBL_STRUCT_PARAM_BIT (   strct,
  member,
  param_name,
  def,
  help_text 
)    GBL_STRUCT_PARAM_TYPE(bit, strct, member, param_name, def, help_text)

Definition at line 107 of file gb_aci_impl.h.

#define GBL_TRACE_PARAMS (   args)
Value:
do { \
GB_ERROR def_error = \
trace_params((args)->get_param_streams(), params, (args)->get_cmdName()); \
gb_assert((args)->set_params_checked()); \
if (def_error) { GBL_END_PARAMS; return def_error; } \
} while(0)
const char * GB_ERROR
Definition: arb_core.h:25
#define GBL_END_PARAMS
Definition: gb_aci_impl.h:117
GB_ERROR trace_params(const GBL_streams &param, gbl_param *ppara, const char *com)
Definition: adlang1.cxx:68
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166
#define gb_assert(cond)
Definition: arbdbt.h:11

Definition at line 109 of file gb_aci_impl.h.

Referenced by format(), gbl_change_gc(), gbl_checksum(), gbl_diff(), and gbl_filter().

#define GBL_END_PARAMS
Value:
do { \
gbl_param *_gblp; \
while (params) { \
_gblp = params; \
params = params->next; \
free(_gblp); \
} \
} while (0)
while(1)

Definition at line 117 of file gb_aci_impl.h.

Referenced by format(), gbl_change_gc(), gbl_checksum(), gbl_diff(), and gbl_filter().

#define GBL_CHECK_FREE_PARAM (   nr,
  cnt 
)
Value:
do { \
if ((nr)+(cnt) >= GBL_MAX_ARGUMENTS) { \
/* gb_assert(0); */ \
return "max. parameters exceeded"; \
} \
} while (0)
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166

Definition at line 127 of file gb_aci_impl.h.

#define TRACE_ACI (   text)    if (GBL_IMPL::traceACI) GBL_IMPL::print_trace(text)

Definition at line 197 of file gb_aci_impl.h.

Referenced by apply_ACI(), gbl_define(), gbl_do(), and gbl_eval().

#define DO_AND_RETURN_ON_ERROR (   cmd)
Value:
do { \
GB_ERROR perr = (cmd); \
if (perr) return perr; \
} while(0)
const char * GB_ERROR
Definition: arb_core.h:25
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166
while(1)

Definition at line 199 of file gb_aci_impl.h.

#define EXPECT_NO_PARAM (   args)    DO_AND_RETURN_ON_ERROR(GBL_IMPL::check_no_parameter(args))
#define EXPECT_PARAMS_PASSED (   args,
  syntax 
)    DO_AND_RETURN_ON_ERROR(GBL_IMPL::check_has_parameters(args,syntax))

Definition at line 205 of file gb_aci_impl.h.

Referenced by gbl_cut(), gbl_drop(), gbl_exec(), gbl_readdb(), and gbl_srt().

#define ACCEPT_ANY_PARAMS (   args)    gb_assert((args)->set_params_checked())

Definition at line 206 of file gb_aci_impl.h.

Referenced by gbl_echo(), and gbl_select().

#define EXPECT_PARAMS (   args,
  cnt,
  help 
)    DO_AND_RETURN_ON_ERROR(GBL_IMPL::check_parameters(args, cnt, help))
#define EXPECT_OPTIONAL_PARAMS (   args,
  fixCnt,
  fixhelp,
  optCnt,
  opthelp 
)    DO_AND_RETURN_ON_ERROR(GBL_IMPL::check_optional_parameters(args, fixCnt, fixhelp, optCnt, opthelp, true, true))

Definition at line 209 of file gb_aci_impl.h.

Referenced by gbl_colsplit(), gbl_len(), gbl_merge(), gbl_swap(), and gbl_translate().

#define EXPECT_OPTIONAL_PARAMS_CUSTOM (   args,
  fixCnt,
  fixhelp,
  optCnt,
  opthelp,
  trail,
  all 
)    DO_AND_RETURN_ON_ERROR(GBL_IMPL::check_optional_parameters(args, fixCnt, fixhelp, optCnt, opthelp, trail, all))

Definition at line 210 of file gb_aci_impl.h.

Referenced by gbl_split().

#define EXPECT_LEGAL_STREAM_INDEX (   args,
  number 
)
Value:
do { \
if (serr) return serr; \
} while(0)
const char * GB_ERROR
Definition: arb_core.h:25
GB_ERROR check_valid_stream_index(GBL_command_arguments *args, int number)
Definition: gb_aci_impl.h:187
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166
while(1)

Definition at line 212 of file gb_aci_impl.h.

Referenced by backfront_stream(), gbl_cut(), and gbl_swap().

#define EXPECT_ITEM_REFERENCED (   args)    DO_AND_RETURN_ON_ERROR(GBL_IMPL::check_item_referenced(args))
#define COMMAND_DROPS_INPUT_STREAMS (   args)
Value:
do { \
if (GBL_IMPL::traceACI && args->input.size()>0) { \
if (args->input.size()>1 || args->input.get(0)[0]) { \
GBL_IMPL::print_trace(GBS_global_string("Warning: Dropped %i input streams\n", args->input.size())); \
} \
} \
} while(0)
int traceACI
Definition: adlang1.cxx:44
const char * GBS_global_string(const char *templat,...)
Definition: arb_msg.cxx:204
void print_trace(const char *text)
Definition: adlang1.cxx:47
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166

Definition at line 220 of file gb_aci_impl.h.

Referenced by gbl_ali_name(), gbl_define(), gbl_echo(), gbl_export_sequence(), gbl_readdb(), gbl_sequence(), gbl_sequence_type(), gbl_taxonomy(), grl_aid(), grl_groupsize(), grl_hitcount(), grl_hitidx(), grl_markedingroup(), and grl_nesting().