Changeset 881 for branches/prototype-v0/zoo-project/zoo-kernel
- Timestamp:
- Sep 12, 2018, 6:05:49 PM (6 years ago)
- Location:
- branches/prototype-v0/zoo-project/zoo-kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/service.c
r877 r881 452 452 } 453 453 454 455 /** 456 * Allocate memory for a service. 457 * Require to call free after calling this function. 458 * 459 * @return the service 460 */ 461 service* createService(){ 462 service *s1 = (service *) malloc (SERVICE_SIZE); 463 s1->name=NULL; 464 s1->content=NULL; 465 s1->metadata=NULL; 466 s1->additional_parameters=NULL; 467 s1->inputs=NULL; 468 s1->outputs=NULL; 469 return s1; 470 } 471 454 472 /** 455 473 * Free allocated memory of a service. 456 * Require to call free on e after calling this function.474 * Require to be invoked for every createService call. 457 475 * 458 476 * @param s the service to free -
branches/prototype-v0/zoo-project/zoo-kernel/service.h
r877 r881 296 296 ZOO_DLL_EXPORT void freeElements(elements**); 297 297 ZOO_DLL_EXPORT void setServiceName(service**,char*); 298 ZOO_DLL_EXPORT service* createService(); 298 299 ZOO_DLL_EXPORT void freeService(service**); 299 300 ZOO_DLL_EXPORT void addToMap(map*,const char*,const char*); -
branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c
r880 r881 337 337 map* import = getMapFromMaps (m, IMPORTSERVICE, tmpsn); 338 338 if (import == NULL || import->value == NULL || zoo_path_compare(tmps1, import->value) != 0 ) { // service is not in [include] block 339 service *s1 = (service *) malloc (SERVICE_SIZE);339 service *s1 = createService(); 340 340 if (s1 == NULL) 341 341 { … … 1523 1523 if(s2==NULL){ 1524 1524 #endif 1525 s1 = (service *) malloc (SERVICE_SIZE);1525 s1 = createService(); 1526 1526 t = readServiceFile (m, import->value, &s1, import->name); 1527 1527 … … 1586 1586 #endif 1587 1587 */ 1588 s1 = (service *) malloc (SERVICE_SIZE);1588 s1 = createService(); 1589 1589 t = readServiceFile (m, buff1, &s1, tmpMapI->value); 1590 1590 if (t < 0) … … 1671 1671 snprintf (buff1, 1024, "%s/%s", conf_dir, 1672 1672 dp->d_name); 1673 s1 = (service *) malloc (SERVICE_SIZE);1673 s1 = createService(); 1674 1674 if (s1 == NULL) 1675 1675 { … … 1927 1927 }else /* Not found in MetaDB */{ 1928 1928 #endif 1929 s1 = (service *) malloc (SERVICE_SIZE);1929 s1 = createService(); 1930 1930 if (s1 == NULL) 1931 1931 {
Note: See TracChangeset
for help on using the changeset viewer.