Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
fc_cmdhelp.c File Reference
#include <stdarg.h>
#include "fciconv.h"
#include "fcintl.h"
#include "mem.h"
#include "shared.h"
#include "support.h"
#include "fc_cmdhelp.h"
#include "speclist.h"

Go to the source code of this file.

Data Structures

struct  cmdarg
 
struct  cmdhelp
 

Macros

#define SPECLIST_TAG   cmdarg
 
#define SPECLIST_TYPE   struct cmdarg
 
#define cmdarg_list_iterate(cmdarg_list, pcmdarg)    TYPED_LIST_ITERATE(struct cmdarg, cmdarg_list, pcmdarg)
 
#define cmdarg_list_iterate_end   LIST_ITERATE_END
 

Functions

static struct cmdargcmdarg_new (const char *shortarg, const char *longarg, const char *helpstr)
 
static void cmdarg_destroy (struct cmdarg *pcmdarg)
 
static int cmdarg_compare (const struct cmdarg *const *pcmdarg0, const struct cmdarg *const *pcmdarg1)
 
struct cmdhelpcmdhelp_new (const char *cmdname)
 
void cmdhelp_destroy (struct cmdhelp *pcmdhelp)
 
void cmdhelp_add (struct cmdhelp *pcmdhelp, const char *shortarg, const char *longarg, const char *helpstr,...)
 
void cmdhelp_display (struct cmdhelp *pcmdhelp, bool sort, bool gui_options, bool report_bugs)
 

Macro Definition Documentation

◆ cmdarg_list_iterate

#define cmdarg_list_iterate (   cmdarg_list,
  pcmdarg 
)     TYPED_LIST_ITERATE(struct cmdarg, cmdarg_list, pcmdarg)

Definition at line 39 of file fc_cmdhelp.c.

◆ cmdarg_list_iterate_end

#define cmdarg_list_iterate_end   LIST_ITERATE_END

Definition at line 41 of file fc_cmdhelp.c.

◆ SPECLIST_TAG

#define SPECLIST_TAG   cmdarg

Definition at line 36 of file fc_cmdhelp.c.

◆ SPECLIST_TYPE

#define SPECLIST_TYPE   struct cmdarg

Definition at line 37 of file fc_cmdhelp.c.

Function Documentation

◆ cmdarg_compare()

static int cmdarg_compare ( const struct cmdarg *const pp0,
const struct cmdarg *const pp1 
)
static

Compare two command argument definitions.

Definition at line 179 of file fc_cmdhelp.c.

Referenced by cmdhelp_display().

◆ cmdarg_destroy()

static void cmdarg_destroy ( struct cmdarg pcmdarg)
static

Destroy a command argument struct.

Definition at line 163 of file fc_cmdhelp.c.

Referenced by cmdhelp_destroy().

◆ cmdarg_new()

static struct cmdarg * cmdarg_new ( const char shortarg,
const char longarg,
const char helpstr 
)
static

Create a new command argument struct.

Definition at line 143 of file fc_cmdhelp.c.

Referenced by cmdhelp_add().

◆ cmdhelp_add()

void cmdhelp_add ( struct cmdhelp pcmdhelp,
const char shortarg,
const char longarg,
const char helpstr,
  ... 
)

Add a command help moption.

Definition at line 86 of file fc_cmdhelp.c.

Referenced by client_main(), fcmp_parse_cmdline(), main(), main(), re_parse_cmdline(), and rup_parse_cmdline().

◆ cmdhelp_destroy()

void cmdhelp_destroy ( struct cmdhelp pcmdhelp)

Destroy a command help struct.

Definition at line 70 of file fc_cmdhelp.c.

Referenced by client_main(), fcmp_parse_cmdline(), main(), main(), re_parse_cmdline(), and rup_parse_cmdline().

◆ cmdhelp_display()

void cmdhelp_display ( struct cmdhelp pcmdhelp,
bool  sort,
bool  gui_options,
bool  report_bugs 
)

Display the help for the command.

Definition at line 104 of file fc_cmdhelp.c.

Referenced by client_main(), fcmp_parse_cmdline(), main(), main(), re_parse_cmdline(), and rup_parse_cmdline().

◆ cmdhelp_new()

struct cmdhelp * cmdhelp_new ( const char cmdname)

Create a new command help struct.

Definition at line 57 of file fc_cmdhelp.c.

Referenced by client_main(), fcmp_parse_cmdline(), main(), main(), re_parse_cmdline(), and rup_parse_cmdline().