This commit is contained in:
Nishi 2025-11-16 12:01:34 +09:00
commit 5f29843ab2
Signed by: nishi
GPG key ID: 27EF69B208EB9343
4 changed files with 30 additions and 1 deletions

View file

@ -1,5 +1,5 @@
#ifndef __MDE_FILE_H__
#define __MDE_FIlE_H__
#define __MDE_FILE_H__
#include <MDE/MachDep.h>

View file

@ -4,5 +4,6 @@
#include <MDE/MachDep.h>
#include <MDE/File.h>
#include <MDE/String.h>
#endif

16
include/MDE/String.h Normal file
View 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
View 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;
}