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

Function msAddNewSymbol

mapsymbol.c:664–685  ·  view source on GitHub ↗

* Add a default new symbol. If the symbol name exists * return the id of the symbol. */

Source from the content-addressed store, hash-verified

662 * return the id of the symbol.
663 */
664int msAddNewSymbol(mapObj *map, char *name)
665{
666 int i = 0;
667
668 if (!map || !name)
669 return -1;
670
671 i = msGetSymbolIndex(&map->symbolset, name, MS_TRUE);
672 if (i >= 0)
673 return i;
674
675 /* Allocate memory for new symbol if needed */
676 if (msGrowSymbolSet(&(map->symbolset)) == NULL)
677 return -1;
678
679 i = map->symbolset.numsymbols;
680 map->symbolset.symbol[i]->name = msStrdup(name);
681
682 map->symbolset.numsymbols++;
683
684 return i;
685}
686
687/* msAppendSymbol and msRemoveSymbol are part of the work to resolve
688 * MapServer bug 579.

Callers 2

symbol.cFile · 0.85
php_mapscript.cFile · 0.85

Calls 3

msGetSymbolIndexFunction · 0.85
msGrowSymbolSetFunction · 0.85
msStrdupFunction · 0.85

Tested by

no test coverage detected