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

Function msMSSQL2008LayerInitItemInfo

mapmssql2008.c:473–497  ·  view source on GitHub ↗

allocate the iteminfo index array - same order as the item list */

Source from the content-addressed store, hash-verified

471
472/* allocate the iteminfo index array - same order as the item list */
473int msMSSQL2008LayerInitItemInfo(layerObj *layer)
474{
475 int i;
476 int *itemindexes ;
477
478 if (layer->debug) {
479 msDebug("msMSSQL2008LayerInitItemInfo called\n");
480 }
481
482 if(layer->numitems == 0) {
483 return MS_SUCCESS;
484 }
485
486 msFree(layer->iteminfo);
487
488 layer->iteminfo = (int *) msSmallMalloc(sizeof(int) * layer->numitems);
489
490 itemindexes = (int*)layer->iteminfo;
491
492 for(i = 0; i < layer->numitems; i++) {
493 itemindexes[i] = i; /* last one is always the geometry one - the rest are non-geom */
494 }
495
496 return MS_SUCCESS;
497}
498
499/* Prepare and execute the SQL statement for this layer */
500static int prepare_database(layerObj *layer, rectObj rect, char **query_string)

Callers 1

msMSSQL2008LayerGetItemsFunction · 0.85

Calls 4

msDebugFunction · 0.85
msFreeFunction · 0.85
msSmallMallocFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected