MCPcopy Create free account
hub / github.com/MapServer/MapServer / insertNewVTFItem

Function insertNewVTFItem

mappluginlayer.c:87–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87static int
88insertNewVTFItem(VTFactoryObj *pVTFactory,
89 VTFactoryItemObj *pVTFI)
90{
91 /* Ensure there is room for one more item in the array
92 * (safe to use for initial alloc of the array as well)
93 */
94 if (pVTFactory->first_free == pVTFactory->size) {
95 int i;
96 VTFactoryItemObj **vtItemPtr;
97 vtItemPtr = (VTFactoryItemObj**)realloc(pVTFactory->vtItems,
98 (pVTFactory->size+MS_LAYER_ALLOCSIZE)*sizeof(VTFactoryItemObj*));
99 MS_CHECK_ALLOC(vtItemPtr, (pVTFactory->size+MS_LAYER_ALLOCSIZE)*sizeof(VTFactoryItemObj*), MS_FAILURE);
100
101
102 pVTFactory->size += MS_LAYER_ALLOCSIZE;
103 pVTFactory->vtItems = vtItemPtr;
104
105 for (i=pVTFactory->first_free; i<pVTFactory->size; i++)
106 pVTFactory->vtItems[i] = NULL;
107 }
108
109 /* Insert item */
110 pVTFactory->vtItems[pVTFactory->first_free] = pVTFI;
111 pVTFactory->first_free++;
112
113 return MS_SUCCESS;
114}
115
116static VTFactoryItemObj *
117loadCustomLayerDLL(layerObj *layer, const char *library_path)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected