Changeset 2291 for trunk/src/kash/shinstance.c
- Timestamp:
- Feb 28, 2009, 2:06:16 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/shinstance.c
r2290 r2291 1 1 /* $Id$ */ 2 2 /** @file 3 *4 3 * The shell instance methods. 5 * 4 */ 5 6 /* 6 7 * Copyright (c) 2007-2009 knut st. osmundsen <bird-kBuild-spamix@anduin.net> 7 8 * … … 344 345 345 346 return ret; 346 }347 348 /** malloc() */349 void *sh_malloc(shinstance *psh, size_t size)350 {351 (void)psh;352 return malloc(size);353 }354 355 /** calloc() */356 void *sh_calloc(shinstance *psh, size_t num, size_t size)357 {358 (void)psh;359 return calloc(num, size);360 }361 362 /** realloc() */363 void *sh_realloc(shinstance *psh, void *old, size_t new_size)364 {365 return realloc(old, new_size);366 }367 368 /** strdup() */369 char *sh_strdup(shinstance *psh, const char *string)370 {371 size_t len = strlen(string);372 char *ret = sh_malloc(psh, len + 1);373 if (ret)374 memcpy(ret, string, len + 1);375 return ret;376 }377 378 /** free() */379 void sh_free(shinstance *psh, void *ptr)380 {381 if (ptr)382 free(ptr);383 (void)psh;384 347 } 385 348
Note:
See TracChangeset
for help on using the changeset viewer.