4 * \brief Prototypes for memory routines.
8 * <h1><b>Copyright.</b></h1>\n
10 * PCB, interactive printed circuit board design
12 * Copyright (C) 1994,1995,1996 Thomas Nau
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 * Contact addresses for paper mail and Email:
30 * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
32 * Thomas.Nau@rz.uni-ulm.de
45 /* ---------------------------------------------------------------------------
46 * number of additional objects that are allocated with one system call
48 #define STEP_ELEMENT 50
50 #define STEP_POINT 100
51 #define STEP_SYMBOLLINE 10
52 #define STEP_SELECTORENTRY 128
53 #define STEP_REMOVELIST 500
54 #define STEP_UNDOLIST 500
55 #define STEP_POLYGONPOINT 10
56 #define STEP_POLYGONHOLEINDEX 10
57 #define STEP_LIBRARYMENU 10
58 #define STEP_LIBRARYENTRY 20
59 #define STEP_RUBBERBAND 100
61 #define STRDUP(x) (((x) != NULL) ? strdup (x) : NULL)
64 * \brief Dynamic string type.
72 RubberbandType
* GetRubberbandMemory (void);
73 PinType
* GetPinMemory (ElementType
*);
74 PadType
* GetPadMemory (ElementType
*);
75 PinType
* GetViaMemory (DataType
*);
76 LineType
* GetLineMemory (LayerType
*);
77 ArcType
* GetArcMemory (LayerType
*);
78 RatType
* GetRatMemory (DataType
*);
79 TextType
* GetTextMemory (LayerType
*);
80 PolygonType
* GetPolygonMemory (LayerType
*);
81 PointType
* GetPointMemoryInPolygon (PolygonType
*);
82 Cardinal
*GetHoleIndexMemoryInPolygon (PolygonType
*);
83 ElementType
* GetElementMemory (DataType
*);
84 BoxType
* GetBoxMemory (BoxListType
*);
85 ConnectionType
* GetConnectionMemory (NetType
*);
86 NetType
* GetNetMemory (NetListType
*);
87 NetListType
* GetNetListMemory (NetListListType
*);
88 LibraryMenuType
* GetLibraryMenuMemory (LibraryType
*);
89 LibraryEntryType
* GetLibraryEntryMemory (LibraryMenuType
*);
90 ElementType
**GetDrillElementMemory (DrillType
*);
91 PinType
** GetDrillPinMemory (DrillType
*);
92 DrillType
* GetDrillInfoDrillMemory (DrillInfoType
*);
93 void **GetPointerMemory (PointerListType
*);
94 void FreePolygonMemory (PolygonType
*);
95 void FreeElementMemory (ElementType
*);
96 void FreePCBMemory (PCBType
*);
97 void FreeBoxListMemory (BoxListType
*);
98 void FreeNetListListMemory (NetListListType
*);
99 void FreeNetListMemory (NetListType
*);
100 void FreeNetMemory (NetType
*);
101 void FreeDataMemory (DataType
*);
102 void FreeLibraryMemory (LibraryType
*);
103 void FreePointerListMemory (PointerListType
*);
104 void DSAddCharacter (DynamicStringType
*, char);
105 void DSAddString (DynamicStringType
*, const char *);
106 void DSClearString (DynamicStringType
*);
107 char *StripWhiteSpaceAndDup (const char *);
110 char *strdup (const char *);
113 #ifndef HAVE_LIBDMALLOC
114 #define malloc(x) calloc(1,(x))