navit  0.5.3-trunk
command.h File Reference

Go to the source code of this file.

Data Structures

struct  command_table
 

Macros

#define command_cast(x)   (int (*)(void *, char *, struct attr **, struct attr ***))(x)
 

Functions

char * command_error_to_text (int err)
 Converts an error to human-readable text. More...
 
enum attr_type command_evaluate_to_attr (struct attr *attr, char *expr, int *error, struct attr *ret)
 
void command_evaluate_to_void (struct attr *attr, char *expr, int *error)
 
char * command_evaluate_to_string (struct attr *attr, char *expr, int *error)
 
int command_evaluate_to_int (struct attr *attr, char *expr, int *error)
 
int command_evaluate_to_boolean (struct attr *attr, const char *expr, int *error)
 
int command_evaluate_to_length (const char *expr, int *error)
 
void command_evaluate (struct attr *attr, const char *expr)
 
void command_add_table_attr (struct command_table *table, int count, void *data, struct attr *attr)
 
void command_add_table (struct callback_list *cbl, struct command_table *table, int count, void *data)
 
void command_saved_set_cb (struct command_saved *cs, struct callback *cb)
 
int command_saved_get_int (struct command_saved *cs)
 Returns an integer representation of the evaluation result of a saved command. More...
 
int command_saved_error (struct command_saved *cs)
 
struct command_savedcommand_saved_attr_new (char *command, struct attr *context, struct callback *cb, int async)
 Creates a new saved command. More...
 
struct command_savedcommand_saved_new (char *command, struct navit *navit, struct callback *cb, int async)
 
void command_saved_destroy (struct command_saved *cs)
 

Macro Definition Documentation

◆ command_cast

#define command_cast (   x)    (int (*)(void *, char *, struct attr **, struct attr ***))(x)

Function Documentation

◆ command_add_table()

void command_add_table ( struct callback_list cbl,
struct command_table table,
int  count,
void *  data 
)

◆ command_add_table_attr()

void command_add_table_attr ( struct command_table table,
int  count,
void *  data,
struct attr attr 
)

◆ command_error_to_text()

char* command_error_to_text ( int  err)

Converts an error to human-readable text.

Parameters
errThe error code
Returns
A string containing the error description. The caller is responsible for freeing up the string by calling
g_free()
when it is no longer needed.

References eof_reached, err(), illegal_character, illegal_number_format, invalid_type, missing_closing_brace, missing_closing_bracket, missing_closing_parenthesis, missing_colon, missing_double_quote, missing_opening_parenthesis, missing_semicolon, no_error, not_ready, and wrong_type.

Referenced by command_evaluate(), osd_std_config(), and osd_std_reconfigure().

◆ command_evaluate()

◆ command_evaluate_to_attr()

enum attr_type command_evaluate_to_attr ( struct attr attr,
char *  expr,
int *  error,
struct attr ret 
)

◆ command_evaluate_to_boolean()

int command_evaluate_to_boolean ( struct attr attr,
const char *  expr,
int *  error 
)

◆ command_evaluate_to_int()

int command_evaluate_to_int ( struct attr attr,
char *  expr,
int *  error 
)

◆ command_evaluate_to_length()

int command_evaluate_to_length ( const char *  expr,
int *  error 
)

◆ command_evaluate_to_string()

char* command_evaluate_to_string ( struct attr attr,
char *  expr,
int *  error 
)

◆ command_evaluate_to_void()

void command_evaluate_to_void ( struct attr attr,
char *  expr,
int *  error 
)

◆ command_saved_attr_new()

struct command_saved* command_saved_attr_new ( char *  command,
struct attr attr,
struct callback cb,
int  async 
)

Creates a new saved command.

Parameters
commandThe command string
attrThe context attribute for the saved command
cbThe callback to call whenver the command is re-evaluated
asyncWhether the saved command should be flagged as asynchronous, causing it to be evaluated in an idle callback

References command_saved::async, callback_cast, callback_new_1, command_saved::cb, command_saved::command, command(), command_register_callbacks(), command_saved_callbacks_changed(), command_saved::context_attr, dbg, command_saved::error, event_add_idle(), lvl_debug, not_ready, command_saved::register_cb, and command_saved::register_ev.

Referenced by command_saved_new(), and script_set_attr_int().

◆ command_saved_destroy()

void command_saved_destroy ( struct command_saved cs)

◆ command_saved_error()

int command_saved_error ( struct command_saved cs)

◆ command_saved_get_int()

int command_saved_get_int ( struct command_saved cs)

Returns an integer representation of the evaluation result of a saved command.

This function is a wrapper around

static int get_int(struct context *ctx, struct result *res)
Returns an integer representation of the result of an expression.
Definition: command.c:442

. It is equivalent to

get_int(&cs->ctx, &cs->res)

. See

for a description.

References command_saved::ctx, get_int(), and command_saved::res.

Referenced by osd_std_config(), and osd_std_reconfigure().

◆ command_saved_new()

struct command_saved* command_saved_new ( char *  command,
struct navit navit,
struct callback cb,
int  async 
)

◆ command_saved_set_cb()

void command_saved_set_cb ( struct command_saved cs,
struct callback cb 
)

References command_saved::cb.

Referenced by osd_std_config().