pcb 4.1.1
An interactive printed circuit board layout editor.

actions.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "global.h"
#include "data.h"
#include "error.h"
#include "hid.h"
#include "../hidint.h"
Include dependency graph for actions.c:

Go to the source code of this file.

Defines

#define static

Functions

static const char * check_action_name (const char *s)
void hid_register_actions (HID_Action *a, int n)
void hid_register_action (HID_Action *a)
static int action_sort_compar (const void *va, const void *vb)
static void sort_actions ()
static int action_search_compar (const void *va, const void *vb)
HID_Actionhid_find_action (const char *name)
void print_actions ()
static void dump_string (char prefix, const char *str)
void dump_actions ()
int hid_action (const char *name)
int hid_actionl (const char *name,...)
int hid_actionv (const char *name, int argc, char **argv)
static int hid_parse_actionstring (const char *rstr, char require_parens)
int hid_parse_command (const char *str_)
 Parse the given command string into action calls, and call hid_actionv for each action found.
int hid_parse_actions (const char *str_)
 Parse the given string into action calls, and call hid_actionv for each action found.

Variables

static HID_Action ** all_actions = 0
static int all_actions_sorted = 0
static int n_actions = 0
HID_Actioncurrent_action = NULL
static const char pcbchanged_syntax [] = "PCBChanged([revert])"
static const char pcbchanged_help [] = "reloaded, and that it might keep some viewport settings"
static const char routestyleschanged_syntax [] = "RouteStylesChanged()"
static const char routestyleschanged_help [] = "Tells the GUI that the routing styles have changed."
static const char netlistchanged_syntax [] = "NetlistChanged()"
static const char netlistchanged_help [] = "Tells the GUI that the netlist has changed."
static const char layerschanged_syntax [] = "LayersChanged()"
static const char layerschanged_help [] = "Tells the GUI that the layers have changed."
static const char librarychanged_syntax [] = "LibraryChanged()"
static const char librarychanged_help [] = "Tells the GUI that the libraries have changed."

Define Documentation

#define static

Definition at line 419 of file actions.c.


Function Documentation

static int action_search_compar ( const void *  va,
const void *  vb 
) [static]

Definition at line 79 of file actions.c.

References action, and HID_Action::name.

Referenced by hid_find_action().

static int action_sort_compar ( const void *  va,
const void *  vb 
) [static]

Definition at line 64 of file actions.c.

References HID_Action::name.

Referenced by sort_actions().

static const char* check_action_name ( const char *  s) [static]

Definition at line 28 of file actions.c.

Referenced by hid_register_actions().

void dump_actions ( )

Definition at line 167 of file actions.c.

References all_actions_sorted, HID_Action::description, dump_string(), n_actions, sort_actions(), and HID_Action::syntax.

Referenced by main().

Here is the call graph for this function:

static void dump_string ( char  prefix,
const char *  str 
) [static]

Definition at line 147 of file actions.c.

Referenced by dump_actions().

int hid_actionl ( const char *  name,
  ... 
)
int hid_actionv ( const char *  name,
int  argc,
char **  argv 
)
HID_Action* hid_find_action ( const char *  name)

Definition at line 87 of file actions.c.

References action, action_search_compar(), all_actions_sorted, n_actions, and sort_actions().

Referenced by hid_actionv().

Here is the call graph for this function:

int hid_parse_actions ( const char *  str_)

Parse the given string into action calls, and call hid_actionv for each action found.

Accepts only "action(arg1, arg2)".

Definition at line 413 of file actions.c.

References hid_parse_actionstring(), and TRUE.

Referenced by ActionExecuteFile(), callback(), do_mouse_action(), ghid_listener_cb(), ghid_menu_cb(), lesstif_key_event(), lesstif_listener_cb(), and main().

Here is the call graph for this function:

static int hid_parse_actionstring ( const char *  rstr,
char  require_parens 
) [static]

Definition at line 250 of file actions.c.

References _, hid_actionv(), malloc(), max, Message(), and realloc().

Referenced by hid_parse_actions(), and hid_parse_command().

Here is the call graph for this function:

int hid_parse_command ( const char *  str_)

Parse the given command string into action calls, and call hid_actionv for each action found.

Accepts both "action(arg1, arg2)" and command-style "action arg1 arg2", allowing only one action in the later case.

Returns:
Returns nonzero if the action handler(s) return nonzero.

Definition at line 408 of file actions.c.

References FALSE, and hid_parse_actionstring().

Referenced by batch_do_export(), command_callback(), command_entry_activate_cb(), and ghid_handle_user_command().

Here is the call graph for this function:

void hid_register_action ( HID_Action a)

Definition at line 58 of file actions.c.

References hid_register_actions().

Here is the call graph for this function:

void hid_register_actions ( HID_Action a,
int  n 
)

Definition at line 37 of file actions.c.

References _, all_actions_sorted, check_action_name(), Message(), n, n_actions, and realloc().

Referenced by hid_register_action().

Here is the call graph for this function:

void print_actions ( void  )

Definition at line 112 of file actions.c.

References all_actions_sorted, n_actions, sort_actions(), and HID_Action::syntax.

Referenced by help(), and main().

Here is the call graph for this function:

static void sort_actions ( ) [static]

Definition at line 72 of file actions.c.

References action_sort_compar(), all_actions_sorted, and n_actions.

Referenced by dump_actions(), hid_find_action(), and print_actions().

Here is the call graph for this function:


Variable Documentation

HID_Action** all_actions = 0 [static]

Definition at line 21 of file actions.c.

int all_actions_sorted = 0 [static]

This is either NULL or points to the current HID_Action that is being called.

The action launcher sets and unsets this variable.

Definition at line 25 of file actions.c.

Referenced by hid_actionv().

const char layerschanged_help[] = "Tells the GUI that the layers have changed." [static]

Definition at line 473 of file actions.c.

const char layerschanged_syntax[] = "LayersChanged()" [static]

Definition at line 471 of file actions.c.

const char librarychanged_help[] = "Tells the GUI that the libraries have changed." [static]

Definition at line 486 of file actions.c.

const char librarychanged_syntax[] = "LibraryChanged()" [static]

Definition at line 484 of file actions.c.

int n_actions = 0 [static]
const char netlistchanged_help[] = "Tells the GUI that the netlist has changed." [static]

Definition at line 462 of file actions.c.

const char netlistchanged_syntax[] = "NetlistChanged()" [static]

Definition at line 460 of file actions.c.

const char pcbchanged_help[] = "reloaded, and that it might keep some viewport settings" [static]

Definition at line 438 of file actions.c.

const char pcbchanged_syntax[] = "PCBChanged([revert])" [static]

Definition at line 436 of file actions.c.

const char routestyleschanged_help[] = "Tells the GUI that the routing styles have changed." [static]

Definition at line 451 of file actions.c.

const char routestyleschanged_syntax[] = "RouteStylesChanged()" [static]

Definition at line 449 of file actions.c.