utils

gsch2pcb.c File Reference

#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/stat.h>
Include dependency graph for gsch2pcb.c:

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)
PcbElementpcb_element_line_parse (gchar *line)
static void pcb_element_free (PcbElement *el)
static void get_pcb_element_list (gchar *pcb_file)
static PcbElementpcb_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 PcbElementpkg_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 Documentation

#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   ":"

Function Documentation

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.

  • l expects a GList, contents used as separate arguments
  • s expects a gchar*, contents used as a single argument
    Parameters:
    [in]formatused 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]

Definition at line 227 of file gsch2pcb.c.

Here is the call graph for this function:

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)

Definition at line 391 of file gsch2pcb.c.

Here is the call graph for this function:

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]

Definition at line 476 of file gsch2pcb.c.

Here is the call graph for this function:

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]

Definition at line 546 of file gsch2pcb.c.

Here is the call graph for this function:

gchar* find_element ( gchar *  dir_path,
gchar *  element 
)

Definition at line 599 of file gsch2pcb.c.

gchar* search_element_directories ( PcbElement el)

Definition at line 645 of file gsch2pcb.c.

Here is the call graph for this function:

static PcbElement* pkg_to_element ( FILE *  f,
gchar *  pkg_line 
) [static]

Definition at line 724 of file gsch2pcb.c.

Here is the call graph for this function:

static gint add_elements ( gchar *  pcb_file) [static]

Definition at line 823 of file gsch2pcb.c.

Here is the call graph for this function:

static void update_element_descriptions ( gchar *  pcb_file,
gchar *  bak 
) [static]

Definition at line 924 of file gsch2pcb.c.

Here is the call graph for this function:

static void prune_elements ( gchar *  pcb_file,
gchar *  bak 
) [static]

Definition at line 979 of file gsch2pcb.c.

Here is the call graph for this function:

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]

Definition at line 1088 of file gsch2pcb.c.

Here is the call graph for this function:

static void add_schematic ( gchar *  sch) [static]

Definition at line 1104 of file gsch2pcb.c.

static void add_multiple_schematics ( gchar *  sch) [static]

Definition at line 1113 of file gsch2pcb.c.

Here is the call graph for this function:

static gint parse_config ( gchar *  config,
gchar *  arg 
) [static]

Definition at line 1136 of file gsch2pcb.c.

Here is the call graph for this function:

static void load_project ( gchar *  path) [static]

Definition at line 1202 of file gsch2pcb.c.

Here is the call graph for this function:

static void load_extra_project_files ( void  ) [static]

Definition at line 1224 of file gsch2pcb.c.

Here is the call graph for this function:

static void usage ( void  ) [static]

Definition at line 1327 of file gsch2pcb.c.

static void get_args ( gint  argc,
gchar **  argv 
) [static]

Definition at line 1336 of file gsch2pcb.c.

Here is the call graph for this function:

gint main ( gint  argc,
gchar **  argv 
)

Definition at line 1384 of file gsch2pcb.c.

Here is the call graph for this function:


Variable Documentation

GList* pcb_element_list [static]

Definition at line 63 of file gsch2pcb.c.

Definition at line 63 of file gsch2pcb.c.

Definition at line 63 of file gsch2pcb.c.

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.

Definition at line 70 of file gsch2pcb.c.

gchar * m4_files

Definition at line 70 of file gsch2pcb.c.

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.

Definition at line 76 of file gsch2pcb.c.

Definition at line 76 of file gsch2pcb.c.

Definition at line 76 of file gsch2pcb.c.

Definition at line 76 of file gsch2pcb.c.

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.

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.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines