pcb 4.1.1
An interactive printed circuit board layout editor.

mymem.h

Go to the documentation of this file.
00001 
00035 #ifndef PCB_MYMEM_H
00036 #define PCB_MYMEM_H
00037 
00038 #ifdef HAVE_CONFIG_H
00039 #include "config.h"
00040 #endif
00041 
00042 #include <stdlib.h>
00043 #include "global.h"
00044 
00045 /* ---------------------------------------------------------------------------
00046  * number of additional objects that are allocated with one system call
00047  */
00048 #define STEP_ELEMENT            50
00049 #define STEP_DRILL              30
00050 #define STEP_POINT              100
00051 #define STEP_SYMBOLLINE         10
00052 #define STEP_SELECTORENTRY      128
00053 #define STEP_REMOVELIST         500
00054 #define STEP_UNDOLIST           500
00055 #define STEP_POLYGONPOINT       10
00056 #define STEP_POLYGONHOLEINDEX   10
00057 #define STEP_LIBRARYMENU        10
00058 #define STEP_LIBRARYENTRY       20
00059 #define STEP_RUBBERBAND         100
00060 
00061 #define STRDUP(x) (((x) != NULL) ? strdup (x) : NULL)
00062 
00066 typedef struct
00067 {
00068   size_t MaxLength;
00069   char *Data;
00070 } DynamicStringType;
00071 
00072 RubberbandType * GetRubberbandMemory (void);
00073 PinType * GetPinMemory (ElementType *);
00074 PadType * GetPadMemory (ElementType *);
00075 PinType * GetViaMemory (DataType *);
00076 LineType * GetLineMemory (LayerType *);
00077 ArcType * GetArcMemory (LayerType *);
00078 RatType * GetRatMemory (DataType *);
00079 TextType * GetTextMemory (LayerType *);
00080 PolygonType * GetPolygonMemory (LayerType *);
00081 PointType * GetPointMemoryInPolygon (PolygonType *);
00082 Cardinal *GetHoleIndexMemoryInPolygon (PolygonType *);
00083 ElementType * GetElementMemory (DataType *);
00084 BoxType * GetBoxMemory (BoxListType *);
00085 ConnectionType * GetConnectionMemory (NetType *);
00086 NetType * GetNetMemory (NetListType *);
00087 NetListType * GetNetListMemory (NetListListType *);
00088 LibraryMenuType * GetLibraryMenuMemory (LibraryType *);
00089 LibraryEntryType * GetLibraryEntryMemory (LibraryMenuType *);
00090 ElementType **GetDrillElementMemory (DrillType *);
00091 PinType ** GetDrillPinMemory (DrillType *);
00092 DrillType * GetDrillInfoDrillMemory (DrillInfoType *);
00093 void **GetPointerMemory (PointerListType *);
00094 void FreePolygonMemory (PolygonType *);
00095 void FreeElementMemory (ElementType *);
00096 void FreePCBMemory (PCBType *);
00097 void FreeBoxListMemory (BoxListType *);
00098 void FreeNetListListMemory (NetListListType *);
00099 void FreeNetListMemory (NetListType *);
00100 void FreeNetMemory (NetType *);
00101 void FreeDataMemory (DataType *);
00102 void FreeLibraryMemory (LibraryType *);
00103 void FreePointerListMemory (PointerListType *);
00104 void DSAddCharacter (DynamicStringType *, char);
00105 void DSAddString (DynamicStringType *, const char *);
00106 void DSClearString (DynamicStringType *);
00107 char *StripWhiteSpaceAndDup (const char *);
00108 
00109 #ifdef NEED_STRDUP
00110 char *strdup (const char *);
00111 #endif
00112 
00113 #ifndef HAVE_LIBDMALLOC
00114 #define malloc(x) calloc(1,(x))
00115 #endif
00116 
00117 #endif