pcb 4.1.1
An interactive printed circuit board layout editor.

hid/common/flags.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "global.h"
#include "data.h"
#include "misc.h"
#include "hid.h"
#include "../hidint.h"
Include dependency graph for hid/common/flags.c:

Go to the source code of this file.

Data Structures

struct  HID_FlagNode

Typedefs

typedef struct HID_FlagNode HID_FlagNode

Functions

void hid_register_flags (HID_Flag *a, int n)
static int flag_sort (const void *va, const void *vb)
HID_Flaghid_find_flag (const char *name)
int hid_get_flag (const char *name)
 Looks up one of the flags registered above.
void hid_save_and_show_layer_ons (int *save_array)
 Use this to temporarily enable all layers, so that they can be exported even if they're not currently visible.
void hid_restore_layer_ons (int *save_array)
 Use this to restore them.
const char * layer_type_to_file_name (int idx, int style)
const char * layer_type_to_file_name_ex (int idx, int style, const char *layer_name)

Variables

HID_FlagNodehid_flag_nodes = 0
static int n_flags = 0
static HID_Flagall_flags = 0

Typedef Documentation

typedef struct HID_FlagNode HID_FlagNode

Function Documentation

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

Definition at line 51 of file hid/common/flags.c.

References HID_Flag::name.

Referenced by hid_find_flag().

HID_Flag* hid_find_flag ( const char *  name)

Definition at line 59 of file hid/common/flags.c.

References flag_sort(), HID_FlagNode::flags, malloc(), HID_FlagNode::n, n, n_flags, and HID_FlagNode::next.

Referenced by hid_get_flag().

Here is the call graph for this function:

int hid_get_flag ( const char *  name_)

Looks up one of the flags registered above.

Returns:
If the flag is unknown, returns zero.

Definition at line 94 of file hid/common/flags.c.

References f, HID_Flag::function, GetValueEx(), hid_find_flag(), HID_Flag::parm, and realloc().

Referenced by lesstif_update_widget_flags(), menu_toggle_update_cb(), set_some_route_style(), and update_style_buttons().

Here is the call graph for this function:

void hid_register_flags ( HID_Flag a,
int  n 
)

Definition at line 32 of file hid/common/flags.c.

References HID_FlagNode::flags, hid_flag_nodes, malloc(), n, HID_FlagNode::n, n_flags, and HID_FlagNode::next.

Here is the call graph for this function:

void hid_restore_layer_ons ( int *  save_array)
void hid_save_and_show_layer_ons ( int *  save_array)

Use this to temporarily enable all layers, so that they can be exported even if they're not currently visible.

save_array must be MAX_ALL_LAYER big.

Definition at line 129 of file hid/common/flags.c.

References PCBType::Data, DataType::Layer, max_copper_layer, LayerType::On, PCB, and SILK_LAYER.

Referenced by eps_do_export(), gcode_do_export(), gerber_do_export(), gsvit_do_export(), nelma_do_export(), png_do_export(), and ps_do_export().

const char* layer_type_to_file_name_ex ( int  idx,
int  style,
const char *  layer_name 
)

Definition at line 221 of file hid/common/flags.c.

References layer_type_to_file_name(), and SL.

Referenced by assign_file_suffix(), and ps_set_layer().

Here is the call graph for this function:


Variable Documentation

HID_Flag* all_flags = 0 [static]

Definition at line 29 of file hid/common/flags.c.

Definition at line 27 of file hid/common/flags.c.

Referenced by hid_register_flags().

int n_flags = 0 [static]

Definition at line 28 of file hid/common/flags.c.

Referenced by hid_find_flag(), and hid_register_flags().