Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
include "NSLog.incl"
|
||||
|
||||
BeginCDeclaration
|
||||
char *strdup(const char *src);
|
||||
EndC
|
||||
|
||||
BeginCFunction
|
||||
char *strdup(const char *src) {
|
||||
char *dst = malloc(strlen (src) + 1); // Space for length plus null
|
||||
if (dst == NULL) return NULL; // No memory
|
||||
strcpy(dst, src); // Copy the characters
|
||||
return dst; // Return the new string
|
||||
}
|
||||
EndC
|
||||
|
||||
BeginCCode
|
||||
NSLog( @"%s", strdup( "Hello, World!" ) );
|
||||
EndC
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue