Revert "Fix locale-dependent gerber output"
[geda-pcb/whiteaudio.git] / src / mymem.h
bloba66e34955528c105ff4e93fad646ca6ac070a211
1 /*
2 * COPYRIGHT
4 * PCB, interactive printed circuit board design
5 * Copyright (C) 1994,1995,1996 Thomas Nau
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * Contact addresses for paper mail and Email:
22 * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
23 * Thomas.Nau@rz.uni-ulm.de
25 * RCS: $Id$
28 /* prototypes for memory routines
31 #ifndef PCB_MYMEM_H
32 #define PCB_MYMEM_H
34 #ifdef HAVE_CONFIG_H
35 #include "config.h"
36 #endif
38 #include <stdlib.h>
39 #include "global.h"
41 /* ---------------------------------------------------------------------------
42 * number of additional objects that are allocated with one system call
44 #define STEP_ELEMENT 50
45 #define STEP_DRILL 30
46 #define STEP_POINT 100
47 #define STEP_SYMBOLLINE 10
48 #define STEP_SELECTORENTRY 128
49 #define STEP_REMOVELIST 500
50 #define STEP_UNDOLIST 500
51 #define STEP_POLYGONPOINT 10
52 #define STEP_POLYGONHOLEINDEX 10
53 #define STEP_LIBRARYMENU 10
54 #define STEP_LIBRARYENTRY 20
55 #define STEP_RUBBERBAND 100
57 #define STRDUP(x) (((x) != NULL) ? strdup (x) : NULL)
59 /* ---------------------------------------------------------------------------
60 * some memory types
62 typedef struct
64 size_t MaxLength;
65 char *Data;
66 } DynamicStringType, *DynamicStringTypePtr;
68 RubberbandTypePtr GetRubberbandMemory (void);
69 PinTypePtr GetPinMemory (ElementTypePtr);
70 PadTypePtr GetPadMemory (ElementTypePtr);
71 PinTypePtr GetViaMemory (DataTypePtr);
72 LineTypePtr GetLineMemory (LayerTypePtr);
73 ArcTypePtr GetArcMemory (LayerTypePtr);
74 RatTypePtr GetRatMemory (DataTypePtr);
75 TextTypePtr GetTextMemory (LayerTypePtr);
76 PolygonTypePtr GetPolygonMemory (LayerTypePtr);
77 PointTypePtr GetPointMemoryInPolygon (PolygonTypePtr);
78 Cardinal *GetHoleIndexMemoryInPolygon (PolygonTypePtr);
79 ElementTypePtr GetElementMemory (DataTypePtr);
80 BoxTypePtr GetBoxMemory (BoxListTypePtr);
81 ConnectionTypePtr GetConnectionMemory (NetTypePtr);
82 NetTypePtr GetNetMemory (NetListTypePtr);
83 NetListTypePtr GetNetListMemory (NetListListTypePtr);
84 LibraryMenuTypePtr GetLibraryMenuMemory (LibraryTypePtr);
85 LibraryEntryTypePtr GetLibraryEntryMemory (LibraryMenuTypePtr);
86 ElementTypeHandle GetDrillElementMemory (DrillTypePtr);
87 PinTypeHandle GetDrillPinMemory (DrillTypePtr);
88 DrillTypePtr GetDrillInfoDrillMemory (DrillInfoTypePtr);
89 void **GetPointerMemory (PointerListTypePtr);
90 void FreePolygonMemory (PolygonTypePtr);
91 void FreeElementMemory (ElementTypePtr);
92 void FreePCBMemory (PCBTypePtr);
93 void FreeBoxListMemory (BoxListTypePtr);
94 void FreeNetListListMemory (NetListListTypePtr);
95 void FreeNetListMemory (NetListTypePtr);
96 void FreeNetMemory (NetTypePtr);
97 void FreeDataMemory (DataTypePtr);
98 void FreeLibraryMemory (LibraryTypePtr);
99 void FreePointerListMemory (PointerListTypePtr);
100 void DSAddCharacter (DynamicStringTypePtr, char);
101 void DSAddString (DynamicStringTypePtr, const char *);
102 void DSClearString (DynamicStringTypePtr);
103 char *StripWhiteSpaceAndDup (const char *);
105 #ifdef NEED_STRDUP
106 char *strdup (const char *);
107 #endif
109 #ifndef HAVE_LIBDMALLOC
110 #define malloc(x) calloc(1,(x))
111 #endif
113 #endif