ARB
Macros | Functions
GDE_ParseMenu.cxx File Reference
#include "GDE_proto.h"
#include <aw_window.hxx>
#include <MultiFileReader.h>
#include <arb_file.h>
#include <cctype>
Include dependency graph for GDE_ParseMenu.cxx:

Go to the source code of this file.

Macros

#define THROW_IF_NO(ptr, name)   do { if (!ptr) throwParseError(GBS_global_string("'%s' used w/o '" name "'", head), in); } while(0)
 
#define THROW_IF_NO_MENU()   THROW_IF_NO(thismenu, "menu")
 
#define THROW_IF_NO_ITEM()   THROW_IF_NO(thisitem, "item")
 
#define THROW_IF_NO_ARG()   THROW_IF_NO(thisarg, "arg")
 
#define THROW_IF_NO_INPUT()   THROW_IF_NO(thisinput, "in")
 
#define THROW_IF_NO_OUTPUT()   THROW_IF_NO(thisoutput, "out")
 

Functions

bool only_whitespace (const char *line)
 
static charreadableItemname (const GmenuItem &i)
 
__ATTR__NORETURN void throwError (const char *msg)
 
static __ATTR__NORETURN void throwParseError (const char *msg, const LineReader &file)
 
static __ATTR__NORETURN void throwItemError (const GmenuItem &i, const char *error, const LineReader &file)
 
static void CheckItemConsistency (const GmenuItem *item, const LineReader &file)
 
const chartruncate_4000 (const char *str)
 
void trim (char *str)
 
static void splitEntry (const char *input, char *head, char *tail)
 
static void ParseMenus (LineReader &in)
 
GB_ERROR LoadMenus ()
 
bool Find (const char *target, const char *key)
 
int Find2 (const char *target, const char *key)
 

Macro Definition Documentation

#define THROW_IF_NO (   ptr,
  name 
)    do { if (!ptr) throwParseError(GBS_global_string("'%s' used w/o '" name "'", head), in); } while(0)

Definition at line 71 of file GDE_ParseMenu.cxx.

#define THROW_IF_NO_MENU ( )    THROW_IF_NO(thismenu, "menu")

Definition at line 73 of file GDE_ParseMenu.cxx.

Referenced by ParseMenus().

#define THROW_IF_NO_ITEM ( )    THROW_IF_NO(thisitem, "item")

Definition at line 74 of file GDE_ParseMenu.cxx.

Referenced by ParseMenus().

#define THROW_IF_NO_ARG ( )    THROW_IF_NO(thisarg, "arg")

Definition at line 75 of file GDE_ParseMenu.cxx.

Referenced by ParseMenus().

#define THROW_IF_NO_INPUT ( )    THROW_IF_NO(thisinput, "in")

Definition at line 76 of file GDE_ParseMenu.cxx.

Referenced by ParseMenus().

#define THROW_IF_NO_OUTPUT ( )    THROW_IF_NO(thisoutput, "out")

Definition at line 77 of file GDE_ParseMenu.cxx.

Referenced by ParseMenus().

Function Documentation

bool only_whitespace ( const char line)
inline

Definition at line 22 of file GDE_ParseMenu.cxx.

References white().

Referenced by ParseMenus().

static char* readableItemname ( const GmenuItem i)
static
__ATTR__NORETURN void throwError ( const char msg)
inline

Definition at line 31 of file GDE_ParseMenu.cxx.

References string().

Referenced by throwParseError().

static __ATTR__NORETURN void throwParseError ( const char msg,
const LineReader file 
)
static
static __ATTR__NORETURN void throwItemError ( const GmenuItem i,
const char error,
const LineReader file 
)
static

Definition at line 41 of file GDE_ParseMenu.cxx.

References GBS_global_string(), readableItemname(), and throwParseError().

Referenced by CheckItemConsistency().

static void CheckItemConsistency ( const GmenuItem item,
const LineReader file 
)
static

Definition at line 48 of file GDE_ParseMenu.cxx.

References I, GmenuItem::numinputs, GmenuItem::seqtype, and throwItemError().

Referenced by ParseMenus().

const char* truncate_4000 ( const char str)
inline

Definition at line 81 of file GDE_ParseMenu.cxx.

References buffer, BUFSIZE, and strcpy_truncate().

Referenced by ParseMenus().

void trim ( char str)
inline

Definition at line 88 of file GDE_ParseMenu.cxx.

References s.

Referenced by splitEntry().

static void splitEntry ( const char input,
char head,
char tail 
)
static

Split "this:that[:the_other]" into: "this" and "that[:the_other]"

Definition at line 99 of file GDE_ParseMenu.cxx.

References trim().

Referenced by ParseMenus().

static void ParseMenus ( LineReader in)
static
GB_ERROR LoadMenus ( void  )

Load menu config files

loads all '*.menu' from "$ARBHOME/lib/gde" and "$ARB_PROP/gde"

Definition at line 506 of file GDE_ParseMenu.cxx.

References ARB_strdup(), error(), GB_create_directory(), GB_have_error(), GB_incur_error(), GB_is_directory(), GB_path_in_ARBLIB(), GB_path_in_arbprop(), GBS_global_string(), GBS_read_dir(), GBS_static_string(), gde_assert, NULp, and ParseMenus().

Referenced by GDE_init().

bool Find ( const char target,
const char key 
)

Definition at line 548 of file GDE_ParseMenu.cxx.

Referenced by FindType(), GDE_startaction_cb(), ParseMenus(), and ReadGen().

int Find2 ( const char target,
const char key 
)

Definition at line 553 of file GDE_ParseMenu.cxx.

Referenced by LoadData(), ReplaceArgs(), and ReplaceString().