pcb 4.1.1
An interactive printed circuit board layout editor.

misc.h File Reference

Prototypes for misc routines. More...

#include <stdlib.h>
#include "global.h"
#include "mymem.h"
Include dependency graph for misc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  UnitList

Defines

#define AttributeGet(OBJ, name)   AttributeGetFromList (&(OBJ->Attributes), name)
#define AttributePut(OBJ, name, value)   AttributePutToList (&(OBJ->Attributes), name, value, 1)
#define AttributeRemove(OBJ, name)   AttributeRemoveFromList (&(OBJ->Attributes), name)
#define NoFlags()   MakeFlags(0)
#define MKDIR(a, b)   pcb_mkdir(a, b)
#define MKDIR_IS_PCBMKDIR   1

Enumerations

enum  unitflags { UNIT_PERCENT = 1 }

Functions

double Distance (double x1, double y1, double x2, double y2)
 Distance() should be used so that there is only one place to deal with overflow/precision errors.
Angle NormalizeAngle (Angle a)
 Bring an angle into [0, 360] range.
void r_delete_element (DataType *, ElementType *)
void SetLineBoundingBox (LineType *)
 Sets the bounding box of a line.
void SetArcBoundingBox (ArcType *)
 Computes the bounding box of an arc.
void SetPointBoundingBox (PointType *)
 Sets the bounding box of a point (which is silly).
void SetPinBoundingBox (PinType *)
 Sets the bounding box of a pin or via.
void SetPadBoundingBox (PadType *)
 Sets the bounding box of a pad.
void SetPolygonBoundingBox (PolygonType *)
 Sets the bounding box of a polygons.
void SetElementBoundingBox (DataType *, ElementType *, FontType *)
 Sets the bounding box of an element.
bool IsDataEmpty (DataType *)
 Returns true if data area is empty.
bool IsLayerEmpty (LayerType *)
bool IsLayerNumEmpty (int)
bool IsLayerGroupEmpty (int)
bool IsPasteEmpty (int)
void CountHoles (int *, int *, const BoxType *)
 Counts the number of plated and unplated holes in the design within a given area of the board.
void CountHolesEx (int *, int *, const BoxType *, Cardinal, Cardinal)
 Counts the number of plated and unplated holes in the design within a given area of the board.
BoxTypeGetDataBoundingBox (DataType *)
 Gets minimum and maximum coordinates.
void CenterDisplay (Coord, Coord, bool warp_pointer)
 Centers the displayed PCB around the specified point (X,Y), and move the crosshair there.
void SetFontInfo (FontType *)
 Transforms symbol coordinates so that the left edge of each symbol is at the zero position.
char * make_route_string (RouteStyleType rs[], int n_styles)
 Serializes the route style list .
int ParseGroupString (char *, LayerGroupType *, int *)
int ParseRouteString (char *, RouteStyleType *, const char *)
void QuitApplication (void)
 Quits application.
char * EvaluateFilename (char *, char *, char *, char *)
 Creates a filename from a template.
char * ExpandFilename (char *, char *)
 Concatenates directory and filename.
void SetTextBoundingBox (FontType *, TextType *)
 Creates the bounding box of a text object.
void SaveOutputWindow (void)
int GetLayerNumber (DataType *, LayerType *)
 Returns the layer number for the passed pointer.
int GetLayerGroupNumberByPointer (LayerType *)
 Returns the layergroup number for the passed pointer.
int GetLayerGroupNumberByNumber (Cardinal)
 Returns the layergroup number for the passed layer number.
int GetLayerGroupNumberBySide (int)
 Returns the layergroup number for the passed side (TOP_SIDE or BOTTOM_SIDE).
int ChangeGroupVisibility (int, bool, bool)
 Changes the visibility of all layers in a group.
void LayerStringToLayerStack (char *)
 Given a string description of a layer stack, adjust the layer stack to correspond.
BoxTypeGetObjectBoundingBox (int, void *, void *, void *)
 Returns a pointer to an objects bounding box.
void ResetStackAndVisibility (void)
 Resets the layerstack setting.
void SaveStackAndVisibility (void)
 Saves the layerstack setting.
void RestoreStackAndVisibility (void)
 Restores the layerstack setting.
char * GetWorkingDirectory (char *)
 Returns pointer to current working directory.
void CreateQuotedString (DynamicStringType *, char *)
 Write a string to the passed file pointer.
BoxTypeGetArcEnds (ArcType *)
void ChangeArcAngles (LayerType *, ArcType *, Angle, Angle)
char * UniqueElementName (DataType *, char *)
 Make a unique name for the name on board.
void AttachForCopy (Coord, Coord)
double GetValue (const char *, const char *, bool *)
 GetValue() returns a numeric value passed from the string and sets the bool variable absolute to false if it leads with a +/- character.
double GetValueEx (const char *, const char *, bool *, UnitList, const char *)
double GetUnitlessValue (const char *, bool *)
 Extract a unit-less value from a string.
int FileExists (const char *)
 Return nonzero if the given file exists and is readable.
char * Concat (const char *,...)
char * pcb_author ()
char * AttributeGetFromList (AttributeListType *list, char *name)
 Returns NULL if the name isn't found, else the value for that named attribute.
int AttributePutToList (AttributeListType *list, const char *name, const char *value, int replace)
 Adds an attribute to the list.
void AttributeRemoveFromList (AttributeListType *list, char *name)
 Remove an attribute by name.
FlagType MakeFlags (unsigned int)
 This just fills in a FlagType with current flags.
FlagType OldFlags (unsigned int)
 This converts old flag bits (from saved PCB files) to new format.
FlagType AddFlags (FlagType, unsigned int)
FlagType MaskFlags (FlagType, unsigned int)
int MoveLayerToGroup (int layer, int group)
 Returns group actually moved to (i.e. either group or previous).
char * LayerGroupsToString (LayerGroupType *)
 Returns pointer to private buffer.
void MakeLayerGroupsDefault ()
const char * c_dtostr (double d)
char * GetInfoString (void)
 Returns a string that has a bunch of information about the program.
void AssignDefaultLayerTypes ()
 Sets up any remaining layer type guesses.
int ElementOrientation (ElementType *e)
 Returns a best guess about the orientation of an element.
bool IsLayerMoveSafe (int, int)
void ChangeBuriedViasAfterLayerMove (int, int)
 Update buried vias after layer move.
void ChangeBuriedViasAfterLayerCreate (int)
 Update buried vias after new layer create.
void ChangeBuriedViasAfterLayerDelete (int)
 Update buried vias after layer delete.
bool ViaIsOnLayerGroup (PinType *, int)
 Check if via penetrates layer group.
bool ViaIsOnAnyVisibleLayer (PinType *)
 Check if via penetrates any visible layer.
void SanitizeBuriedVia (PinType *)
 Sanitize buried via.
int GetMaxBottomLayer ()
void NetlistChanged (int force_unfreeze)
int pcb_mkdir (const char *path, int mode)
 mkdir() implentation, mostly for plugins, which don't have our config.h.

Detailed Description

Prototypes for misc routines.


Copyright.


PCB, interactive printed circuit board design

Copyright (C) 1994,1995,1996,2006 Thomas Nau

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Contact addresses for paper mail and Email:

Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany

Thomas.Nau@rz.uni-ulm.de

Definition in file misc.h.


Define Documentation

#define AttributeGet (   OBJ,
  name 
)    AttributeGetFromList (&(OBJ->Attributes), name)
#define AttributePut (   OBJ,
  name,
  value 
)    AttributePutToList (&(OBJ->Attributes), name, value, 1)

Definition at line 110 of file misc.h.

Referenced by ActionImport(), ImportGUI(), real_load_pcb(), SetGrid(), and SetUnits().

#define AttributeRemove (   OBJ,
  name 
)    AttributeRemoveFromList (&(OBJ->Attributes), name)

Definition at line 113 of file misc.h.

Referenced by ActionImport().

#define MKDIR (   a,
 
)    pcb_mkdir(a, b)

Definition at line 173 of file misc.h.

Referenced by config_file_open(), hid_save_settings(), and pcb_mkdir().

#define MKDIR_IS_PCBMKDIR   1

Definition at line 174 of file misc.h.


Enumeration Type Documentation

enum unitflags
Enumerator:
UNIT_PERCENT 

Definition at line 42 of file misc.h.


Function Documentation

FlagType AddFlags ( FlagType  ,
unsigned  int 
)

Definition at line 2144 of file src/misc.c.

References FlagType::f.

Referenced by SmashBufferElement().

void AssignDefaultLayerTypes ( )

Sets up any remaining layer type guesses.

Definition at line 1227 of file src/misc.c.

References PCBType::Data, END_LOOP, layer, LAYER_TYPE_LOOP, LT_OUTLINE, LT_ROUTE, max_copper_layer, n, outline_layer, and PCB.

Referenced by real_load_pcb().

char* AttributeGetFromList ( AttributeListType list,
char *  name 
)

Returns NULL if the name isn't found, else the value for that named attribute.

Definition at line 2546 of file src/misc.c.

References AttributeListType::List, AttributeType::name, AttributeListType::Number, and AttributeType::value.

Referenced by gsvit_write_xcentroids(), and PrintBOM().

int AttributePutToList ( AttributeListType list,
const char *  name,
const char *  value,
int  replace 
)

Adds an attribute to the list.

If the attribute already exists, whether it's replaced or a second copy added depends on REPLACE.

Returns:
Non-zero if an existing attribute was replaced.

Definition at line 2564 of file src/misc.c.

References AttributeListType::List, AttributeListType::Max, AttributeType::name, AttributeListType::Number, realloc(), STRDUP, and AttributeType::value.

Here is the call graph for this function:

void AttributeRemoveFromList ( AttributeListType list,
char *  name 
)

Remove an attribute by name.

Definition at line 2602 of file src/misc.c.

References AttributeListType::List, AttributeType::name, AttributeListType::Number, and AttributeType::value.

const char* c_dtostr ( double  d)
Todo:
In future all use of this should be supplanted by pcb-printf and mr/m# spec.

These act like you'd expect, except always in the C locale.

Definition at line 2623 of file src/misc.c.

References f.

Referenced by WritePCBDataHeader().

void CenterDisplay ( Coord  X,
Coord  Y,
bool  warp_pointer 
)

Centers the displayed PCB around the specified point (X,Y), and move the crosshair there.

If warp_pointer is true warp the pointer to the crosshair.

Definition at line 878 of file src/misc.c.

References Crosshair, PCBType::Grid, gui, HID_SC_CENTER_IN_VIEWPORT, HID_SC_CENTER_IN_VIEWPORT_AND_WARP_POINTER, MoveCrosshairAbsolute(), notify_crosshair_change(), PCB, hid_st::set_crosshair, CrosshairType::X, and CrosshairType::Y.

Referenced by ActionAddRats(), ActionNew(), GotoError(), row_activated_cb(), and selection_changed_cb().

Here is the call graph for this function:

void ChangeArcAngles ( LayerType Layer,
ArcType a,
Angle  new_sa,
Angle  new_da 
)
Todo:
Doesn't this belong in change.c ??

Definition at line 1891 of file src/misc.c.

References AddObjectToChangeAnglesUndoList(), LayerType::arc_tree, ClearFromPolygon(), PCBType::Data, PCB, r_delete_entry(), r_insert_entry(), RestoreToPolygon(), and SetArcBoundingBox().

Referenced by maybe_pull_1(), Puller(), and reverse_arc().

Here is the call graph for this function:

void ChangeBuriedViasAfterLayerCreate ( int  )

Update buried vias after new layer create.

Definition at line 2411 of file src/misc.c.

References AddObjectToSetViaLayersUndoList(), PCBType::Data, END_LOOP, PCB, VIA_IS_BURIED, and VIA_LOOP.

Referenced by MoveLayer().

Here is the call graph for this function:

void ChangeBuriedViasAfterLayerDelete ( int  )

Update buried vias after layer delete.

Definition at line 2435 of file src/misc.c.

References AddObjectToSetViaLayersUndoList(), PCBType::Data, END_LOOP, PCB, RemoveDegradedVias(), SanitizeBuriedVia(), VIA_IS_BURIED, and VIA_LOOP.

Referenced by MoveLayer().

Here is the call graph for this function:

void ChangeBuriedViasAfterLayerMove ( int  ,
int   
)

Update buried vias after layer move.

Definition at line 2309 of file src/misc.c.

References _, AddObjectToSetViaLayersUndoList(), PCBType::Data, END_LOOP, Message(), PCB, RemoveDegradedVias(), SanitizeBuriedVia(), VIA_IS_BURIED, VIA_LOOP, and VIA_ON_LAYER.

Referenced by MoveLayer().

Here is the call graph for this function:

int ChangeGroupVisibility ( int  Layer,
bool  On,
bool  ChangeStackOrder 
)
char* Concat ( const char *  ,
  ... 
)
void CountHoles ( int *  plated,
int *  unplated,
const BoxType within_area 
)

Counts the number of plated and unplated holes in the design within a given area of the board.

To count for the whole board, pass NULL to the within_area.

Definition at line 764 of file src/misc.c.

References PCBType::Data, hole_counting_callback(), HoleCountStruct::nplated, HoleCountStruct::nunplated, PCB, DataType::pin_tree, r_search(), and DataType::via_tree.

Referenced by DrawEverything().

Here is the call graph for this function:

void CountHolesEx ( int *  plated,
int *  unplated,
const BoxType within_area,
Cardinal  group_from,
Cardinal  group_to 
)

Counts the number of plated and unplated holes in the design within a given area of the board.

To count for the whole board, pass NULL to the within_area.

Definition at line 782 of file src/misc.c.

References PCBType::Data, hole_counting_callback(), HoleCountStruct::nplated, HoleCountStruct::nunplated, PCB, DataType::pin_tree, r_search(), and DataType::via_tree.

Referenced by DrawEverything().

Here is the call graph for this function:

void CreateQuotedString ( DynamicStringType DS,
char *  S 
)

Write a string to the passed file pointer.

Some special characters are quoted.

Definition at line 1862 of file src/misc.c.

References DSAddCharacter(), and DSClearString().

Referenced by PrintAndSelectUnusedPinsAndPadsOfElement(), PrintConnectionListEntry(), PrintElementNameList(), and PrintQuotedString().

Here is the call graph for this function:

int ElementOrientation ( ElementType e)

Returns a best guess about the orientation of an element.

The value corresponds to the rotation; a difference is the right value to pass to RotateElementLowLevel. However, the actual value is no indication of absolute rotation; only relative rotation is meaningful.

Returns:
a relative rotation for an element, useful only for comparing two similar footprints.

Definition at line 2784 of file src/misc.c.

References abs, END_LOOP, NSTRCMP, pin_st::Number, PAD_LOOP, pin, PIN_LOOP, pin_st::X, and pin_st::Y.

Referenced by ActionElementList(), and ActionListRotations().

char* EvaluateFilename ( char *  Template,
char *  Path,
char *  Filename,
char *  Parameter 
)

Creates a filename from a template.

"%f" is replaced by the filename.

"%p" is replaced by the searchpath.

Definition at line 1319 of file src/misc.c.

References command, DynamicStringType::Data, DSAddCharacter(), DSAddString(), DSClearString(), Settings, and SettingType::verbose.

Referenced by Parse(), ReadLibraryContents(), and ReadNetlist().

Here is the call graph for this function:

char* ExpandFilename ( char *  Dirname,
char *  Filename 
)

Concatenates directory and filename.

If directory != NULL expands them with a shell and returns the found name(s) or NULL.

Definition at line 1369 of file src/misc.c.

References c, command, DynamicStringType::Data, DSAddCharacter(), DSClearString(), and PopenErrorMessage().

Here is the call graph for this function:

int FileExists ( const char *  )

Return nonzero if the given file exists and is readable.

Definition at line 2062 of file src/misc.c.

References f.

BoxType* GetDataBoundingBox ( DataType Data)

Gets minimum and maximum coordinates.

Returns:
NULL if layout is empty.

Definition at line 799 of file src/misc.c.

References ALLARC_LOOP, ALLLINE_LOOP, ALLPOLYGON_LOOP, ALLTEXT_LOOP, box, ELEMENT_LOOP, END_LOOP, ENDALL_LOOP, IsDataEmpty(), line, MAX, MIN, NAMEONPCB_TEXT, VIA_LOOP, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by eps_hid_export_to_file(), png_do_export(), png_hid_export_to_file(), and SetBufferBoundingBox().

Here is the call graph for this function:

char* GetInfoString ( void  )

Returns a string that has a bunch of information about the program.

Can be used for things like "about" dialog boxes.

Definition at line 2675 of file src/misc.c.

References _, DynamicStringType::Data, DSAddString(), exporter, gui, hid_enumerate(), and TAB.

Referenced by About(), and ghid_dialog_about().

Here is the call graph for this function:

int GetLayerGroupNumberByPointer ( LayerType )
int GetMaxBottomLayer ( )
BoxType* GetObjectBoundingBox ( int  Type,
void *  Ptr1,
void *  Ptr2,
void *  Ptr3 
)

Returns a pointer to an objects bounding box.

Data is valid until the routine is called again.

Definition at line 1645 of file src/misc.c.

References _, and Message().

Referenced by crosshair_update_range().

Here is the call graph for this function:

double GetUnitlessValue ( const char *  val,
bool *  absolute 
)

Extract a unit-less value from a string.

Parameters:
valString containing the value to be read.
absoluteReturns whether the returned value is an absolute one.
Returns:
The value read, with sign.

This is the same as GetValue() and GetValueEx(), but totally ignoring units. Typical application is a list selector, like the type of thermal to apply to a pin.

Definition at line 233 of file src/misc.c.

Referenced by ActionSetThermal().

double GetValue ( const char *  ,
const char *  ,
bool *   
)
double GetValueEx ( const char *  ,
const char *  ,
bool *  ,
UnitList  ,
const char *   
)

Definition at line 140 of file src/misc.c.

References get_unit_struct(), n, UnitList::scale, UnitList::suffix, UNIT_PERCENT, and unit_to_coord().

Referenced by CursorAction(), GetNum(), GetValue(), hid_get_flag(), parse_bloat(), style_value_cb(), and sz_str2val().

Here is the call graph for this function:

char* GetWorkingDirectory ( char *  path)

Returns pointer to current working directory.

If 'path' is not NULL, then the current working directory is copied to the array pointed to by 'path'.

Definition at line 1845 of file src/misc.c.

Referenced by LoadNewlibFootprintsFromDir(), and ParseLibraryTree().

bool IsDataEmpty ( DataType )
bool IsLayerEmpty ( LayerType )

Definition at line 682 of file src/misc.c.

References LayerType::ArcN, LayerType::LineN, LayerType::PolygonN, and LayerType::TextN.

Referenced by DrawLayer(), and IsLayerNumEmpty().

bool IsLayerGroupEmpty ( int  )

Definition at line 697 of file src/misc.c.

References LayerGroupType::Entries, IsLayerNumEmpty(), PCBType::LayerGroups, LayerGroupType::Number, and PCB.

Referenced by png_hid_export_to_file().

Here is the call graph for this function:

bool IsLayerMoveSafe ( int  ,
int   
)
bool IsLayerNumEmpty ( int  )

Definition at line 691 of file src/misc.c.

References PCBType::Data, IsLayerEmpty(), DataType::Layer, and PCB.

Referenced by IsLayerGroupEmpty().

Here is the call graph for this function:

bool IsPasteEmpty ( int  )

Definition at line 707 of file src/misc.c.

References ALLPAD_LOOP, PCBType::Data, ENDALL_LOOP, ON_SIDE, PCB, and TEST_FLAG.

Referenced by DrawEverything().

char* LayerGroupsToString ( LayerGroupType )

Returns pointer to private buffer.

Definition at line 2195 of file src/misc.c.

References bottom_silk_layer, LayerGroupType::Entries, layer, PCBType::LayerGroups, MAX_ALL_LAYER, max_group, LayerGroupType::Number, PCB, and top_silk_layer.

Referenced by WritePCBDataHeader().

void LayerStringToLayerStack ( char *  )

Given a string description of a layer stack, adjust the layer stack to correspond.

Definition at line 1502 of file src/misc.c.

References _, args, ChangeGroupVisibility(), CLEAR_FLAG, PCBType::Data, PCBType::ElementOn, PCBType::InvisibleObjectsOn, DataType::Layer, LayerStack, malloc(), max_copper_layer, LayerType::Name, LayerType::On, PCB, PCBType::PinOn, PCBType::RatOn, SET_FLAG, Settings, SettingType::ShowBottomSide, SILK_LAYER, and PCBType::ViaOn.

Referenced by main().

Here is the call graph for this function:

char* make_route_string ( RouteStyleType  rs[],
int  n_styles 
)

Serializes the route style list .

Right now n_styles should always be set to NUM_STYLES, since that is the number of route styles ParseRouteString() expects to parse.

Definition at line 987 of file src/misc.c.

References FALSE, and pcb_g_strdup_printf().

Referenced by route_styles_edited_cb().

Here is the call graph for this function:

FlagType MakeFlags ( unsigned  int)

This just fills in a FlagType with current flags.

Definition at line 2112 of file src/misc.c.

References FlagType::f.

Referenced by ConvertBufferToElement(), export_pcb_drawarc(), export_pcb_drawline(), IronDownAllUnfixedPaths(), NotifyMode(), RD_DrawLine(), and RD_DrawVia().

void MakeLayerGroupsDefault ( )
Todo:
is this an orphan prototype ?

Make the current layer groups the default.

int MoveLayerToGroup ( int  layer,
int  group 
)

Returns group actually moved to (i.e. either group or previous).

Definition at line 2164 of file src/misc.c.

References bottom_silk_layer, LayerGroupType::Entries, GetLayerGroupNumberByNumber(), layer, PCBType::LayerGroups, max_copper_layer, max_group, LayerGroupType::Number, PCB, and top_silk_layer.

Referenced by FontEdit(), lgbutton_cb(), and lgbutton_input().

Here is the call graph for this function:

void NetlistChanged ( int  force_unfreeze)
Todo:
These are in netlist.c

Definition at line 93 of file netlist.c.

References hid_action(), netlist_frozen, and netlist_needs_update.

Referenced by ActionLoadFrom(), ActionRenumber(), AddNet(), FreePCBMemory(), Netlist(), netlist_add(), netlist_clear(), netlist_norats(), netlist_rats(), and UndoNetlistChange().

Here is the call graph for this function:

FlagType OldFlags ( unsigned  int)

This converts old flag bits (from saved PCB files) to new format.

Definition at line 2125 of file src/misc.c.

References FlagType::f, f, and FlagType::t.

int ParseGroupString ( char *  ,
LayerGroupType ,
int *   
)
int ParseRouteString ( char *  ,
RouteStyleType ,
const char *   
)

Definition at line 1014 of file src/misc.c.

References RouteStyleType::Diameter, error, GetNum(), RouteStyleType::Hole, RouteStyleType::Keepaway, MIL_TO_COORD, RouteStyleType::Name, style, and RouteStyleType::Thick.

Referenced by REGISTER_ATTRIBUTES().

Here is the call graph for this function:

char* pcb_author ( )

Definition at line 2501 of file src/misc.c.

References SettingType::FabAuthor, len, malloc(), and Settings.

Referenced by PrintBOM(), and PrintFab().

Here is the call graph for this function:

int pcb_mkdir ( const char *  path,
int  mode 
)

mkdir() implentation, mostly for plugins, which don't have our config.h.

Definition at line 2767 of file src/misc.c.

References MKDIR.

void QuitApplication ( void  )

Quits application.

Definition at line 1290 of file src/misc.c.

References PCBType::Changed, DisableEmergencySave(), hid_st::do_exit, EmergencySave(), gui, PCB, pcb_main_uninit(), SettingType::SaveInTMP, and Settings.

Referenced by ActionQuit().

Here is the call graph for this function:

void r_delete_element ( DataType ,
ElementType  
)
void ResetStackAndVisibility ( void  )
void RestoreStackAndVisibility ( void  )
void SanitizeBuriedVia ( PinType via)

Sanitize buried via.

  • remove degraded vias
  • ensure correct order of layers
  • change full size vias to TH vias

Definition at line 2259 of file src/misc.c.

References pin_st::BuriedFrom, pin_st::BuriedTo, and GetMaxBottomLayer().

Referenced by ChangeBuriedViasAfterLayerDelete(), ChangeBuriedViasAfterLayerMove(), ChangeObjectViaLayers(), and ChangeSelectedViaLayers().

Here is the call graph for this function:

void SaveOutputWindow ( void  )
void SaveStackAndVisibility ( void  )
void SetFontInfo ( FontType Ptr)

Transforms symbol coordinates so that the left edge of each symbol is at the zero position.

The y coordinates are moved so that min(y) = 0.

Definition at line 904 of file src/misc.c.

References FontType::DefaultSymbol, SymbolType::Height, SymbolType::Line, line, SymbolType::LineN, MAX, FontType::MaxHeight, FontType::MaxWidth, maxx, maxy, MIN, minx, miny, MOVE_LINE_LOWLEVEL, FontType::Symbol, SymbolType::Valid, SymbolType::Width, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by FontSave().

void SetPadBoundingBox ( PadType )

Sets the bounding box of a pad.

Definition at line 292 of file src/misc.c.

References close_box(), M_PI, pad_st::Mask, MAX, MIN, POLY_CIRC_RADIUS_ADJ, and TEST_FLAG.

Referenced by SetElementBoundingBox().

Here is the call graph for this function:

void SetPinBoundingBox ( PinType )
void SetPointBoundingBox ( PointType )

Sets the bounding box of a point (which is silly).

Definition at line 259 of file src/misc.c.

References PointType::X, PointType::X2, PointType::Y, and PointType::Y2.

Referenced by SetLineBoundingBox().

void SetPolygonBoundingBox ( PolygonType )
char* UniqueElementName ( DataType Data,
char *  Name 
)

Make a unique name for the name on board.

This can alter the contents of the input string.

Definition at line 1942 of file src/misc.c.

References BumpName(), ELEMENT_LOOP, END_LOOP, NAMEONPCB_NAME, and NSTRCMP.

Referenced by ChangeElementName(), and CreateNewElement().

Here is the call graph for this function:

bool ViaIsOnAnyVisibleLayer ( PinType )

Check if via penetrates any visible layer.

Definition at line 2483 of file src/misc.c.

References pin_st::BuriedFrom, PCBType::Data, DataType::Layer, layer, LayerType::On, PCB, and VIA_IS_BURIED.

Referenced by _draw_pv(), and hole_callback().

bool ViaIsOnLayerGroup ( PinType ,
int   
)