pcb 4.1.1
An interactive printed circuit board layout editor.
|
Prototypes for memory routines. More...
Go to the source code of this file.
Data Structures | |
struct | DynamicStringType |
Dynamic string type. More... | |
Defines | |
#define | STEP_ELEMENT 50 |
#define | STEP_DRILL 30 |
#define | STEP_POINT 100 |
#define | STEP_SYMBOLLINE 10 |
#define | STEP_SELECTORENTRY 128 |
#define | STEP_REMOVELIST 500 |
#define | STEP_UNDOLIST 500 |
#define | STEP_POLYGONPOINT 10 |
#define | STEP_POLYGONHOLEINDEX 10 |
#define | STEP_LIBRARYMENU 10 |
#define | STEP_LIBRARYENTRY 20 |
#define | STEP_RUBBERBAND 100 |
#define | STRDUP(x) (((x) != NULL) ? strdup (x) : NULL) |
#define | malloc(x) calloc(1,(x)) |
Functions | |
RubberbandType * | GetRubberbandMemory (void) |
Get the next slot for a rubberband connection. | |
PinType * | GetPinMemory (ElementType *) |
Get the next slot for a pin. | |
PadType * | GetPadMemory (ElementType *) |
Get the next slot for a pad. | |
PinType * | GetViaMemory (DataType *) |
Get the next slot for a via. | |
LineType * | GetLineMemory (LayerType *) |
Get the next slot for a line. | |
ArcType * | GetArcMemory (LayerType *) |
Get the next slot for an arc. | |
RatType * | GetRatMemory (DataType *) |
Get the next slot for a Rat. | |
TextType * | GetTextMemory (LayerType *) |
Get the next slot for a text object. | |
PolygonType * | GetPolygonMemory (LayerType *) |
Get the next slot for a polygon object. | |
PointType * | GetPointMemoryInPolygon (PolygonType *) |
Get the next slot for a point in a polygon struct. | |
Cardinal * | GetHoleIndexMemoryInPolygon (PolygonType *) |
Gets the next slot for a point in a polygon struct. | |
ElementType * | GetElementMemory (DataType *) |
Get the next slot for an element. | |
BoxType * | GetBoxMemory (BoxListType *) |
Get the next slot for a box. | |
ConnectionType * | GetConnectionMemory (NetType *) |
Get the next slot for a connection. | |
NetType * | GetNetMemory (NetListType *) |
Get the next slot for a subnet. | |
NetListType * | GetNetListMemory (NetListListType *) |
Get the next slot for a net list. | |
LibraryMenuType * | GetLibraryMenuMemory (LibraryType *) |
Get the next slot for a library menu. | |
LibraryEntryType * | GetLibraryEntryMemory (LibraryMenuType *) |
Get the next slot for a library entry. | |
ElementType ** | GetDrillElementMemory (DrillType *) |
Get the next slot for a DrillElement. | |
PinType ** | GetDrillPinMemory (DrillType *) |
Get the next slot for a DrillPoint. | |
DrillType * | GetDrillInfoDrillMemory (DrillInfoType *) |
Get the next slot for a Drill. | |
void ** | GetPointerMemory (PointerListType *) |
void | FreePolygonMemory (PolygonType *) |
Free the memory used by a polygon. | |
void | FreeElementMemory (ElementType *) |
Free the memory used by an element. | |
void | FreePCBMemory (PCBType *) |
Free the memory used by PCB. | |
void | FreeBoxListMemory (BoxListType *) |
Free the memory used by a box list. | |
void | FreeNetListListMemory (NetListListType *) |
Free the memory used by a net list. | |
void | FreeNetListMemory (NetListType *) |
Free the memory used by a net. | |
void | FreeNetMemory (NetType *) |
Free the memory used by a subnet. | |
void | FreeDataMemory (DataType *) |
Free the memory used by data struct. | |
void | FreeLibraryMemory (LibraryType *) |
Free the memory that's allocated by the library. | |
void | FreePointerListMemory (PointerListType *) |
void | DSAddCharacter (DynamicStringType *, char) |
Adds one character to a dynamic string. | |
void | DSAddString (DynamicStringType *, const char *) |
Add a string to a dynamic string. | |
void | DSClearString (DynamicStringType *) |
Clear a dynamic string. | |
char * | StripWhiteSpaceAndDup (const char *) |
Strips leading and trailing blanks from the passed string. |
Prototypes for memory routines.
PCB, interactive printed circuit board design
Copyright (C) 1994,1995,1996 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
Definition in file mymem.h.
#define STEP_DRILL 30 |
Definition at line 49 of file mymem.h.
Referenced by GetDrillInfoDrillMemory().
#define STEP_ELEMENT 50 |
Definition at line 48 of file mymem.h.
Referenced by GetDrillElementMemory().
#define STEP_LIBRARYENTRY 20 |
Definition at line 58 of file mymem.h.
Referenced by GetLibraryEntryMemory().
#define STEP_LIBRARYMENU 10 |
Definition at line 57 of file mymem.h.
Referenced by GetLibraryMenuMemory().
#define STEP_POINT 100 |
Definition at line 50 of file mymem.h.
Referenced by GetBoxMemory(), GetConnectionMemory(), GetDrillPinMemory(), GetNetListMemory(), GetNetMemory(), and GetPointerMemory().
#define STEP_POLYGONHOLEINDEX 10 |
Definition at line 56 of file mymem.h.
Referenced by GetHoleIndexMemoryInPolygon().
#define STEP_POLYGONPOINT 10 |
Definition at line 55 of file mymem.h.
Referenced by GetPointMemoryInPolygon().
#define STEP_REMOVELIST 500 |
Definition at line 53 of file mymem.h.
Referenced by GetUndoSlot().
#define STEP_RUBBERBAND 100 |
Definition at line 59 of file mymem.h.
Referenced by GetRubberbandMemory().
#define STEP_SYMBOLLINE 10 |
Definition at line 51 of file mymem.h.
Referenced by CreateNewLineInSymbol().
#define STEP_UNDOLIST 500 |
Definition at line 54 of file mymem.h.
Referenced by GetUndoSlot().
Definition at line 61 of file mymem.h.
Referenced by AttributePutToList(), CreateNewAttribute(), CreateNewConnection(), CreateNewPad(), CreateNewPin(), CreateNewVia(), netlist_style(), and SmashBufferElement().
void DSAddCharacter | ( | DynamicStringType * | , |
char | |||
) |
Adds one character to a dynamic string.
Definition at line 857 of file mymem.c.
References DynamicStringType::Data, and DSRealloc().
Referenced by CreateQuotedString(), EvaluateFilename(), ExpandFilename(), and WritePipe().
void DSAddString | ( | DynamicStringType * | , |
const char * | |||
) |
Add a string to a dynamic string.
Definition at line 870 of file mymem.c.
References DynamicStringType::Data, and DSRealloc().
Referenced by EvaluateFilename(), GetInfoString(), ReportFoundPins(), and WritePipe().
void DSClearString | ( | DynamicStringType * | ) |
Clear a dynamic string.
Definition at line 885 of file mymem.c.
References DynamicStringType::Data.
Referenced by CreateQuotedString(), EvaluateFilename(), ExpandFilename(), ReportFoundPins(), and WritePipe().
void FreeBoxListMemory | ( | BoxListType * | ) |
Free the memory used by a box list.
Definition at line 598 of file mymem.c.
References BoxListType::Box.
Referenced by ComputeCost().
void FreeDataMemory | ( | DataType * | ) |
Free the memory used by data struct.
Definition at line 739 of file mymem.c.
References LayerType::Arc, LayerType::arc_tree, LayerType::Attributes, DataType::Element, ELEMENT_LOOP, DataType::element_tree, END_LOOP, FreeArc(), FreeAttributeListMemory(), FreeElement(), FreeElementMemory(), FreeLine(), FreePolygon(), FreePolygonMemory(), FreeRat(), FreeText(), FreeVia(), g_list_free_full(), DataType::Layer, layer, LayerType::Line, line, LINE_LOOP, LayerType::line_tree, MAX_ALL_LAYER, LayerType::Name, DataType::name_tree, LineType::Number, DataType::pad_tree, DataType::pin_tree, LayerType::Polygon, POLYGON_LOOP, LayerType::polygon_tree, r_destroy_tree(), DataType::Rat, DataType::rat_tree, LayerType::Text, TEXT_LOOP, LayerType::text_tree, DataType::Via, VIA_LOOP, and DataType::via_tree.
Referenced by ClearBuffer(), ClearUndoList(), and FreePCBMemory().
void FreeElementMemory | ( | ElementType * | ) |
Free the memory used by an element.
Definition at line 677 of file mymem.c.
References ElementType::Arc, ElementType::Attributes, ELEMENTNAME_LOOP, END_LOOP, FreeArc(), FreeAttributeListMemory(), FreeLine(), FreePad(), FreePin(), g_list_free_full(), ElementType::Line, pin_st::Name, pin_st::Number, ElementType::Pad, PAD_LOOP, ElementType::Pin, pin, and PIN_LOOP.
Referenced by DestroyElement(), FreeDataMemory(), pinout_set_data(), and SmashBufferElement().
void FreeLibraryMemory | ( | LibraryType * | ) |
Free the memory that's allocated by the library.
Definition at line 817 of file mymem.c.
References END_LOOP, ENTRY_LOOP, LibraryType::Menu, and MENU_LOOP.
Referenced by ActionLoadFrom(), FreePCBMemory(), and netlist_clear().
void FreeNetListListMemory | ( | NetListListType * | ) |
Free the memory used by a net list.
Definition at line 629 of file mymem.c.
References END_LOOP, FreeNetListMemory(), NetListListType::NetList, and NETLIST_LOOP.
Referenced by CreateRouteData(), and import_clusters().
void FreeNetListMemory | ( | NetListType * | ) |
Free the memory used by a net.
Definition at line 611 of file mymem.c.
References END_LOOP, FreeNetMemory(), NetListType::Net, and NET_LOOP.
Referenced by AddAllRats(), FreeNetListListMemory(), and ProcNetlist().
void FreeNetMemory | ( | NetType * | ) |
Free the memory used by a subnet.
Definition at line 647 of file mymem.c.
References NetType::Connection.
Referenced by DrawShortestRats(), FreeNetListMemory(), and TransferNet().
void FreePCBMemory | ( | PCBType * | ) |
Free the memory used by PCB.
Definition at line 713 of file mymem.c.
References PCBType::Attributes, PCBType::Data, PCBType::Filename, PCBType::Font, FreeAttributeListMemory(), FreeDataMemory(), FreeLibraryMemory(), SymbolType::Line, PCBType::Name, NetlistChanged(), PCBType::NetlistLib, PCBType::PrintFilename, and FontType::Symbol.
Referenced by pcb_main_uninit(), and RemovePCB().
void FreePointerListMemory | ( | PointerListType * | ) |
Definition at line 112 of file mymem.c.
References PointerListType::Ptr.
Referenced by AutoPlaceSelected(), CheckShorts(), ComputeCost(), and CreateRouteData().
void FreePolygonMemory | ( | PolygonType * | ) |
Free the memory used by a polygon.
Definition at line 579 of file mymem.c.
References polygon_st::Clipped, polygon_st::HoleIndex, polygon_st::NoHoles, polygon_st::Points, poly_Free(), and poly_FreeContours().
Referenced by DestroyCrosshair(), DestroyPolygon(), and FreeDataMemory().
Get the next slot for an arc.
Allocates memory if necessary.
Definition at line 328 of file mymem.c.
References LayerType::Arc, and LayerType::ArcN.
Referenced by CreateNewArcOnLayer().
BoxType* GetBoxMemory | ( | BoxListType * | Boxes | ) |
Get the next slot for a box.
Allocates memory if necessary.
Definition at line 124 of file mymem.c.
References BoxListType::Box, box, BoxListType::BoxMax, BoxListType::BoxN, realloc(), and STEP_POINT.
Referenced by ComputeCost().
ConnectionType* GetConnectionMemory | ( | NetType * | Net | ) |
Get the next slot for a connection.
Allocates memory if necessary.
Definition at line 147 of file mymem.c.
References NetType::Connection, NetType::ConnectionMax, NetType::ConnectionN, realloc(), and STEP_POINT.
Referenced by AddAllRats(), CollectSubnets(), GatherSubnets(), ProcNetlist(), and TransferNet().
ElementType** GetDrillElementMemory | ( | DrillType * | Drill | ) |
Get the next slot for a DrillElement.
Allocates memory if necessary.
Definition at line 512 of file mymem.c.
References DrillType::Element, DrillType::ElementMax, DrillType::ElementN, realloc(), and STEP_ELEMENT.
Referenced by FillDrill(), and InitializeDrill().
DrillType* GetDrillInfoDrillMemory | ( | DrillInfoType * | DrillInfo | ) |
Get the next slot for a Drill.
Allocates memory if necessary.
Definition at line 560 of file mymem.c.
References DrillInfoType::Drill, DrillInfoType::DrillMax, DrillInfoType::DrillN, realloc(), and STEP_DRILL.
Referenced by GetDrillInfo().
Get the next slot for a DrillPoint.
Allocates memory if necessary.
Definition at line 537 of file mymem.c.
References DrillType::Pin, pin, DrillType::PinMax, DrillType::PinN, realloc(), and STEP_POINT.
Referenced by FillDrill(), and InitializeDrill().
ElementType* GetElementMemory | ( | DataType * | data | ) |
Get the next slot for an element.
Allocates memory if necessary.
Definition at line 441 of file mymem.c.
References DataType::Element, and DataType::ElementN.
Referenced by CreateNewElement().
Cardinal* GetHoleIndexMemoryInPolygon | ( | PolygonType * | Polygon | ) |
Gets the next slot for a point in a polygon struct.
Allocates memory if necessary.
Definition at line 419 of file mymem.c.
References polygon_st::HoleIndex, polygon_st::HoleIndexMax, polygon_st::HoleIndexN, realloc(), and STEP_POLYGONHOLEINDEX.
Referenced by CreateNewHoleInPolygon().
LibraryEntryType* GetLibraryEntryMemory | ( | LibraryMenuType * | Menu | ) |
Get the next slot for a library entry.
Allocates memory if necessary.
Definition at line 490 of file mymem.c.
References LibraryMenuType::Entry, LibraryMenuType::EntryMax, LibraryMenuType::EntryN, realloc(), and STEP_LIBRARYENTRY.
LibraryMenuType* GetLibraryMenuMemory | ( | LibraryType * | lib | ) |
Get the next slot for a library menu.
Allocates memory if necessary.
Definition at line 468 of file mymem.c.
References LibraryType::Menu, LibraryType::MenuMax, LibraryType::MenuN, realloc(), and STEP_LIBRARYMENU.
Get the next slot for a line.
Allocates memory if necessary.
Definition at line 305 of file mymem.c.
References LayerType::Line, and LayerType::LineN.
Referenced by CreateNewLineOnLayer().
NetListType* GetNetListMemory | ( | NetListListType * | Netlistlist | ) |
Get the next slot for a net list.
Allocates memory if necessary.
Definition at line 190 of file mymem.c.
References NetListListType::NetList, NetListListType::NetListMax, NetListListType::NetListN, realloc(), and STEP_POINT.
Referenced by CollectSubnets().
NetType* GetNetMemory | ( | NetListType * | Netlist | ) |
Get the next slot for a subnet.
Allocates memory if necessary.
Definition at line 169 of file mymem.c.
References NetListType::Net, NetListType::NetMax, NetListType::NetN, realloc(), and STEP_POINT.
Referenced by AddAllRats(), CollectSubnets(), and ProcNetlist().
PadType* GetPadMemory | ( | ElementType * | element | ) |
Get the next slot for a pad.
Allocates memory if necessary.
Definition at line 236 of file mymem.c.
References ElementType::Pad, and ElementType::PadN.
Referenced by CreateNewPad().
PinType* GetPinMemory | ( | ElementType * | element | ) |
Get the next slot for a pin.
Allocates memory if necessary.
Definition at line 213 of file mymem.c.
References ElementType::Pin, and ElementType::PinN.
Referenced by CreateNewPin().
void** GetPointerMemory | ( | PointerListType * | ) |
Definition at line 95 of file mymem.c.
References PointerListType::Ptr, ptr, PointerListType::PtrMax, PointerListType::PtrN, realloc(), and STEP_POINT.
Referenced by AddIrregularObstacle(), AddLine(), AddPad(), AddPin(), CheckShorts(), collectSelectedElements(), and ComputeCost().
PointType* GetPointMemoryInPolygon | ( | PolygonType * | Polygon | ) |
Get the next slot for a point in a polygon struct.
Allocates memory if necessary.
Definition at line 397 of file mymem.c.
References polygon_st::PointMax, polygon_st::PointN, polygon_st::Points, realloc(), and STEP_POLYGONPOINT.
Referenced by CreateNewPointInPolygon().
PolygonType* GetPolygonMemory | ( | LayerType * | layer | ) |
Get the next slot for a polygon object.
Allocates memory if necessary.
Definition at line 374 of file mymem.c.
References LayerType::Polygon, and LayerType::PolygonN.
Referenced by CreateNewPolygon().
Get the next slot for a Rat.
Allocates memory if necessary.
Definition at line 282 of file mymem.c.
References DataType::Rat, and DataType::RatN.
Referenced by CreateNewRat().
RubberbandType* GetRubberbandMemory | ( | void | ) |
Get the next slot for a rubberband connection.
Allocates memory if necessary.
Definition at line 76 of file mymem.c.
References CrosshairType::AttachedObject, Crosshair, ptr, realloc(), AttachedObjectType::Rubberband, AttachedObjectType::RubberbandMax, AttachedObjectType::RubberbandN, and STEP_RUBBERBAND.
Referenced by CreateNewRubberbandEntry().
Get the next slot for a text object.
Allocates memory if necessary.
Definition at line 351 of file mymem.c.
References LayerType::Text, and LayerType::TextN.
Referenced by CreateNewText().
Get the next slot for a via.
Allocates memory if necessary.
Definition at line 259 of file mymem.c.
References DataType::Via, and DataType::ViaN.
Referenced by CreateNewVia().
char* StripWhiteSpaceAndDup | ( | const char * | S | ) |
Strips leading and trailing blanks from the passed string.
Definition at line 898 of file mymem.c.
References realloc().
Referenced by ActionLoadFrom(), and ghid_route_style_selector_edit_dialog().