X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=shmf.c;fp=shmf.c;h=530aa1e75f1b5ab0d604e24961952a19af0f854e;hb=a2b5b7caf8344c52f7b6c268433a5cf2ee966cd0;hp=265e7d85bfa65473702c51530fa776f64d398735;hpb=684994f24d5459c7bb7b8baedd1dc6a9980dcfbf;p=lib1stclass%2Fmain.git diff --git a/shmf.c b/shmf.c index 265e7d8..530aa1e 100755 --- a/shmf.c +++ b/shmf.c @@ -1,6 +1,15 @@ #include -char *shmf(const char *file, char *shmfile){ +#ifdef __cplusplus +#include "1stclass.hpp" +string firstclass::shmf(const string in_file){ + const char *file=in_file.c_str(); + char shm_file[1024]=""; +#else +#include "lib1stclass.h" +int shmf(const char *file, char *shm_file){ +#endif + char tmp_file[1024]=""; int i; safe_strcat(tmp_file, file); @@ -12,7 +21,14 @@ char *shmf(const char *file, char *shmfile){ break; } } - safe_strcat(shmfile, "/dev/shm/"); - safe_strcat(shmfile, tmp_file); - return tmp_file; + + safe_strcat(shm_file, "/dev/shm/"); + safe_strcat(shm_file, tmp_file); + +#ifdef __cplusplus + string result(shm_file); + return result; +#else + return 0; +#endif }