This is the ~/pcb directory
|PCB layout and gerber icons and mime registration data
|All files used to generate the documentation
|Speaks for it self, examples how to use PCB
|This directory/library is only used by the toporouter (toporouter.h includes gts.h)
|Internationalization - it handles conversions to non-English languages. It is for i18n, l10n and related stuff. See the ABOUT-NLS text file in the root directory for more information.
|The M4 library stores the footprints as M4 macros
|Some additional m4 scripts used by configure
|File to make newlib library components
|Information in this directory is obsolete and/or very old. Just ignore it.
|The source code
|File to test the build during make
|File needed to build for Windows
|This directory is no part of the git repository it is added by the
This is the ~/pcb/src directory
|Human Interface Device layer. The basic idea is that every action outside the core is treated as a separate human interface device.
|Export a bill of materials
|Export to G-Code
|Export RS-274X (Gerber)
|Graphical User Interface based on GTK2
|Graphical User Interface based on lessif
|Numerical analysis package export
|export postscript /encapsulated postscript
|HID internal interfaces. These may ONLY be called from the HID modules, not from the common PCB code.
These are the files in the ~/pcb/src directory
|Comment / Explanation
|action routines for output window
|This is one of the top files. A lot of the functionality will start here. This is a good place to start your digging work when learning the PCB code.
This file also contains a lot of documentation generating code.
This means two things:
- Look at the PCB manual for a description of all actions (manual is in doc directory after make)
- Take this as an example how to add documentation to the code.
|functions used to autoplace elements.
|functions used to autoroute nets.
|random box-related utilities.
|functions used by paste- and move/copy buffer
|functions used to change object properties
|Clip the line to the clipBox
|executes commands from user
|That is, some commands, only the short-hand vi compatible commands like l, le, m, q, w, s and rn.
See pcb manual for the explanation.
See action.c for the other commands.
|This file is for compatibility across operating systems; we can define functions there that might be missing elsewhere (like linux-specific things) or broken elsewhere. Mostly it's for unix-vs-windows.
|global source constants
|functions used to copy pins, elements …
|functions used to create vias, pins …
|is for the board's crosshair; this handles (for example) grid snapping. This is *not* the same as the GUI's mouse cursor. For the GKT GUI the crosshair will follow the mouse if its over the board-space/canvas.
|just defines common identifiers
|Interprocess communication (IPC)
|D-Bus is a system for interprocess communication (IPC). D-Bus code originally derived from example-service.c in the dbus-glib bindings.
The dbus was added to provide some communications between gschem and pcb, and to provide some remote-control options for pcb. Not sure if anything uses it at the moment.
If you're not interested in connecting to other programs just ignore the files.
|PCB HID main loop integration.
|From the PCB documentation: A number of user defined Symbols are called a font. There is only one per layout. All symbols are made of lines. See the file 'default_font' as an example.
Fontmode.c is linked with this file.
|is for the “Connects→Optimize Routed Tracks” functions.
|REGISTER_*(a) macro in dolists.h will be expanded by the preprocessor to the actual calling of these functions.
|functions to generate drill information
|is for generating drill report information.
|EDIF stands for Electronic Design Interchange Format.
|These files are associated with only one action “LoadFrom(Netlist)”. This will call the function ImportNetlist() in file.c. If the first line of the netlist file contains “edif” it will use these files to parse the EDIF 2.0.0 formatted file. A little googling learns that the EDIF 2.0.0 file format was approved in March 1988. File format EDIF 4.0.0 was released in August 1996. The PCB documentation doesn't say anything about EDIF.
The files are here to be backwards compatible, so we are able to read files generated many year ago. It doesn't hurt so just ignore it.
|This file defines the interface to the outside world.
|file says: A Bison parser, used in with edif.c. EDIF stands for Electronic Design Interchange Format.
|error and debug functions
|file save, load, merge … routines
|routines to find connections between pins, vias, lines…
|routines to initialize and use flags
|flags.c functions are used by some of the HIDs to mark menu entries as “checked” vs “unchecked” when they refer to flags. That's why they're registered, too, there's a list with ASCII names that hids can refer to.
|routines to edit the font in PCB
|There are two actions:
FontEdit() and FontSave()
Font editing draws one of each character on the screen as a PCB. You edit the PCB. Then it reads the traces from the PCB and turns it back into a font. You can then cut/paste the font section out of that pcb to default_font.
default_font is linked with this file.
|some routines to free memory
|shell script used during build.
|Probably a leftover from an old build script, I can't find where it is called. Think the script isn't used.
Just ignore it.
|Used if –enable-nls option is configured. Takes care of internationalization.
|The big include just about everything include file
|The heap functions seem to be associated mainly with the two autorouters. Additionally the file polygon1.c makes use of a heap in one of its functions
|Low level drawing API.
|Human Interface Device layer.
|This is one of the top files.
This is a good place to start looking if you want to know what's-what.
|functions used to insert points into objects
|rectangle intersection/union routines.
|Libiberty realpath. Like realpath, but more consistent behaviour
|some commonly used macros not related to a special C-file the file is included by global.h after const.h
|It all starts here
|functions used to change the mirror flag of an object
|Icons used in the GUI
|functions used to move pins, elements …
|implementation for “empty space” routines (needed for via-space tracking in the auto-router.
|memory management functions
|lexical definitions to parse ASCII input of PCB and Element description
|Parse an element file or layout file. This is either a footprint file or our PCB layout file
|grammar to parse ASCII input of PCB description
|Implementation of printf wrapper to output pcb coords and angles.
|Used during the build to test the program
|file says: poly_Boolean: a polygon clip library.
|Used in polygon.c, polygon1.c and thermal.c
|polygon clipping functions
|special polygon editing routines
|Looks like it is used to “print” the fabrication layer. print.c generates a layer to be used as a fabrication drawing. Whether the HID uses that or not (and what it does with it) is a Separate question. At least, both ps and gerber need that layer. Since the layer is created in “pcb unit space” it's in the core. HID things tend to happen in “hid unit space” instead.
|PCB HID Project - Puller
|See http://www.delorie.com/pcb/puller for more information.
|rats nest routines
|functions used to remove vias, pins …
|Tell the user what he/she must know
|See PCB manual for the options.
|These files are used to parse the pcb-menu.res and gpcb-menu.res files. This defines the menu structure of PCB. res_* is a generic resource parser. Both gtk and lesstif hids use them.
|A parser, to read the resource (menu items etc) form PCB
|functions used to rotate pins, elements …
|a way to quickly find 2-D objects in a 2-D space
|functions used by 'rubberband moves'
|search routines some of the functions use dummy parameters
|routines to update widgets and global settings (except output window and dialogs)
|Some flags routines
|negative thermal finger polygons
|This file implements a topological autorouter.
|Please take a look inside the file for some literature references on the toporouter.
|functions used to undo operations
|operations on vectors.
|routines to generate vendor specific output
|vendor.c is used to load vendor-specific DRC rules and apply them.
C = These files have there focus on the Core Functionality. They support the overall working of the program.
H = These files have there focus on the HID Functionality. They support the HID actions and requests.