utils
|
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/stat.h>
Go to the source code of this file.
Data Structures | |
struct | PcbElement |
struct | ElementMap |
Defines | |
#define | GSC2PCB_VERSION "1.6" |
#define | DEFAULT_PCB_INC "pcb.inc" |
#define | SEP_STRING "--------\n" |
#define | PCB_PATH_DELIMETER ":" |
Functions | |
static void | create_m4_override_file () |
static gboolean | build_and_run_command (const gchar *format,...) |
static gboolean | run_gnetlist (gchar *pins_file, gchar *net_file, gchar *pcb_file, gchar *basename, GList *largs) |
static gchar * | token (gchar *string, gchar **next, gboolean *quoted_ret) |
static gchar * | fix_spaces (gchar *str) |
PcbElement * | pcb_element_line_parse (gchar *line) |
static void | pcb_element_free (PcbElement *el) |
static void | get_pcb_element_list (gchar *pcb_file) |
static PcbElement * | pcb_element_exists (PcbElement *el_test, gboolean record) |
static void | simple_translate (PcbElement *el) |
static gboolean | insert_element (FILE *f_out, gchar *element_file, gchar *footprint, gchar *refdes, gchar *value) |
gchar * | find_element (gchar *dir_path, gchar *element) |
gchar * | search_element_directories (PcbElement *el) |
static PcbElement * | pkg_to_element (FILE *f, gchar *pkg_line) |
static gint | add_elements (gchar *pcb_file) |
static void | update_element_descriptions (gchar *pcb_file, gchar *bak) |
static void | prune_elements (gchar *pcb_file, gchar *bak) |
static void | add_m4_file (gchar *arg) |
static gchar * | expand_dir (gchar *dir) |
static void | add_default_m4_files (void) |
static void | add_schematic (gchar *sch) |
static void | add_multiple_schematics (gchar *sch) |
static gint | parse_config (gchar *config, gchar *arg) |
static void | load_project (gchar *path) |
static void | load_extra_project_files (void) |
static void | usage () |
static void | get_args (gint argc, gchar **argv) |
gint | main (gint argc, gchar **argv) |
Variables | |
static GList * | pcb_element_list |
static GList * | element_directory_list |
static GList * | extra_gnetlist_list |
static GList * | extra_gnetlist_arg_list |
static gchar * | sch_basename |
static GList * | schematics |
static gchar * | m4_pcbdir |
static gchar * | default_m4_pcbdir |
static gchar * | m4_files |
static gchar * | m4_override_file |
static gboolean | use_m4 = TRUE |
static gchar * | empty_footprint_name |
static gint | verbose |
static gint | n_deleted |
static gint | n_added_m4 |
static gint | n_added_ef |
static gint | n_fixed |
static gint | n_PKG_removed_new |
static gint | n_PKG_removed_old |
static gint | n_preserved |
static gint | n_changed_value |
static gint | n_not_found |
static gint | n_unknown |
static gint | n_none |
static gint | n_empty |
static gboolean | remove_unfound_elements = TRUE |
static gboolean | quiet_mode = FALSE |
static gboolean | force_element_files |
static gboolean | preserve |
static gboolean | fix_elements |
static gboolean | bak_done |
static gboolean | need_PKG_purge |
static gchar * | usage_string0 = " instead of the default:\n" |
static gchar * | usage_string1 = "\n" |
#define GSC2PCB_VERSION "1.6" |
Definition at line 38 of file gsch2pcb.c.
#define DEFAULT_PCB_INC "pcb.inc" |
Definition at line 40 of file gsch2pcb.c.
#define SEP_STRING "--------\n" |
Definition at line 42 of file gsch2pcb.c.
#define PCB_PATH_DELIMETER ":" |
static void create_m4_override_file | ( | ) | [static] |
Definition at line 91 of file gsch2pcb.c.
static gboolean build_and_run_command | ( | const gchar * | format, |
... | |||
) | [static] |
Build and run a command. No redirection or error handling is done. Format string is split on whitespace. Specifiers l and s are replaced with contents of positional args. To be recognized, specifiers must be separated from other arguments in the format by whitespace.
[in] | format | used to specify command to be executed |
[in] | ... | positional parameters |
Definition at line 131 of file gsch2pcb.c.
static gboolean run_gnetlist | ( | gchar * | pins_file, |
gchar * | net_file, | ||
gchar * | pcb_file, | ||
gchar * | basename, | ||
GList * | largs | ||
) | [static] |
static gchar* token | ( | gchar * | string, |
gchar ** | next, | ||
gboolean * | quoted_ret | ||
) | [static] |
Definition at line 328 of file gsch2pcb.c.
static gchar* fix_spaces | ( | gchar * | str | ) | [static] |
Definition at line 363 of file gsch2pcb.c.
PcbElement* pcb_element_line_parse | ( | gchar * | line | ) |
static void pcb_element_free | ( | PcbElement * | el | ) | [static] |
Definition at line 458 of file gsch2pcb.c.
static void get_pcb_element_list | ( | gchar * | pcb_file | ) | [static] |
static PcbElement* pcb_element_exists | ( | PcbElement * | el_test, |
gboolean | record | ||
) | [static] |
Definition at line 498 of file gsch2pcb.c.
static void simple_translate | ( | PcbElement * | el | ) | [static] |
Definition at line 538 of file gsch2pcb.c.
static gboolean insert_element | ( | FILE * | f_out, |
gchar * | element_file, | ||
gchar * | footprint, | ||
gchar * | refdes, | ||
gchar * | value | ||
) | [static] |
gchar* find_element | ( | gchar * | dir_path, |
gchar * | element | ||
) |
Definition at line 599 of file gsch2pcb.c.
gchar* search_element_directories | ( | PcbElement * | el | ) |
static PcbElement* pkg_to_element | ( | FILE * | f, |
gchar * | pkg_line | ||
) | [static] |
static gint add_elements | ( | gchar * | pcb_file | ) | [static] |
static void update_element_descriptions | ( | gchar * | pcb_file, |
gchar * | bak | ||
) | [static] |
static void prune_elements | ( | gchar * | pcb_file, |
gchar * | bak | ||
) | [static] |
static void add_m4_file | ( | gchar * | arg | ) | [static] |
Definition at line 1062 of file gsch2pcb.c.
static gchar* expand_dir | ( | gchar * | dir | ) | [static] |
Definition at line 1076 of file gsch2pcb.c.
static void add_default_m4_files | ( | void | ) | [static] |
static void add_schematic | ( | gchar * | sch | ) | [static] |
Definition at line 1104 of file gsch2pcb.c.
static void add_multiple_schematics | ( | gchar * | sch | ) | [static] |
static gint parse_config | ( | gchar * | config, |
gchar * | arg | ||
) | [static] |
static void load_project | ( | gchar * | path | ) | [static] |
static void load_extra_project_files | ( | void | ) | [static] |
static void usage | ( | void | ) | [static] |
Definition at line 1327 of file gsch2pcb.c.
static void get_args | ( | gint | argc, |
gchar ** | argv | ||
) | [static] |
gint main | ( | gint | argc, |
gchar ** | argv | ||
) |
GList* pcb_element_list [static] |
Definition at line 63 of file gsch2pcb.c.
GList * element_directory_list |
Definition at line 63 of file gsch2pcb.c.
GList * extra_gnetlist_list |
Definition at line 63 of file gsch2pcb.c.
GList * extra_gnetlist_arg_list |
Definition at line 63 of file gsch2pcb.c.
gchar* sch_basename [static] |
Definition at line 66 of file gsch2pcb.c.
GList* schematics [static] |
Definition at line 68 of file gsch2pcb.c.
gchar* m4_pcbdir [static] |
Definition at line 70 of file gsch2pcb.c.
gchar * default_m4_pcbdir |
Definition at line 70 of file gsch2pcb.c.
gchar * m4_files |
Definition at line 70 of file gsch2pcb.c.
gchar * m4_override_file |
Definition at line 70 of file gsch2pcb.c.
gboolean use_m4 = TRUE [static] |
Definition at line 72 of file gsch2pcb.c.
gchar* empty_footprint_name [static] |
Definition at line 74 of file gsch2pcb.c.
gint verbose [static] |
Definition at line 76 of file gsch2pcb.c.
gint n_deleted |
Definition at line 76 of file gsch2pcb.c.
gint n_added_m4 |
Definition at line 76 of file gsch2pcb.c.
gint n_added_ef |
Definition at line 76 of file gsch2pcb.c.
gint n_fixed |
Definition at line 76 of file gsch2pcb.c.
gint n_PKG_removed_new |
Definition at line 76 of file gsch2pcb.c.
gint n_PKG_removed_old |
Definition at line 76 of file gsch2pcb.c.
gint n_preserved |
Definition at line 76 of file gsch2pcb.c.
gint n_changed_value |
Definition at line 76 of file gsch2pcb.c.
gint n_not_found |
Definition at line 76 of file gsch2pcb.c.
gint n_unknown |
Definition at line 76 of file gsch2pcb.c.
gint n_none |
Definition at line 76 of file gsch2pcb.c.
gint n_empty |
Definition at line 76 of file gsch2pcb.c.
gboolean remove_unfound_elements = TRUE [static] |
Definition at line 85 of file gsch2pcb.c.
gboolean quiet_mode = FALSE |
Definition at line 86 of file gsch2pcb.c.
gboolean force_element_files |
Definition at line 86 of file gsch2pcb.c.
gboolean preserve |
Definition at line 86 of file gsch2pcb.c.
gboolean fix_elements |
Definition at line 86 of file gsch2pcb.c.
gboolean bak_done |
Definition at line 86 of file gsch2pcb.c.
gboolean need_PKG_purge |
Definition at line 86 of file gsch2pcb.c.
gchar* usage_string0 = " instead of the default:\n" [static] |
Definition at line 1243 of file gsch2pcb.c.
gchar* usage_string1 = "\n" [static] |
Definition at line 1301 of file gsch2pcb.c.