string
This commit is contained in:
parent
62f8299f28
commit
5f29843ab2
4 changed files with 30 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef __MDE_FILE_H__
|
||||
#define __MDE_FIlE_H__
|
||||
#define __MDE_FILE_H__
|
||||
|
||||
#include <MDE/MachDep.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,5 +4,6 @@
|
|||
#include <MDE/MachDep.h>
|
||||
|
||||
#include <MDE/File.h>
|
||||
#include <MDE/String.h>
|
||||
|
||||
#endif
|
||||
|
|
|
|||
16
include/MDE/String.h
Normal file
16
include/MDE/String.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#ifndef __MDE_STRING_H__
|
||||
#define __MDE_STRING_H__
|
||||
|
||||
#include <MDE/MachDep.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
char* MDEStringDuplicate(const char* src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
12
src/string.c
Normal file
12
src/string.c
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#include <MDE/String.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
char* MDEStringDuplicate(const char* src){
|
||||
char* s = malloc(strlen(src) + 1);
|
||||
|
||||
strcpy(s, src);
|
||||
|
||||
return s;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue