Ignore:
Timestamp:
Feb 6, 2020, 3:12:42 PM (5 months ago)
Author:
knut
Message:

Added function for allocating memory for map values (allocateMapValue). Fixed issue with getting attributes from input data node. Added code to support MIME subtype attributes in key-value pairs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service.c

    r955 r957  
    18291829#endif
    18301830#endif
     1831
     1832/*
     1833 * Dynamically allocate memory for a map value
     1834 *
     1835 * @param node the map for which the value buffer should be allocated
     1836 * @param num_bytes the number of bytes to allocate
     1837 * @return pointer to the allocated memory buffer
     1838 *
     1839 * This function will free, and hence delete, any existing value in the map.
     1840 * The memory should be deallocated by calling freeMap.
     1841 */
     1842char* allocateMapValue(map* node, size_t num_bytes)
     1843{
     1844        if (node == NULL) {
     1845                return NULL;
     1846        }
     1847
     1848        if (node->value != NULL) {
     1849                free(node->value);
     1850        }
     1851        node->value = (char*) malloc(num_bytes);
     1852               
     1853        return node->value;
     1854}
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png