first ideas

This commit is contained in:
Martin Diehl 2016-03-08 23:32:18 +01:00
parent efde4d363d
commit 564ff68fbb
2 changed files with 25 additions and 2 deletions

24
code/C_helper.c Normal file
View File

@ -0,0 +1,24 @@
/* Unix */
#include <unistd.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
#define GETCWD getcwd
void getCurrentWorkDir(char *str,int *stat){
if(GETCWD(str, sizeof(str)) == str){
*stat = 0;
}
else{
*stat = 1;
}
}
int isDirectory(const char *path){
struct stat statbuf;
if(stat(path, &statbuf) != 0)
return 0;
return S_ISDIR(statbuf.st_mode);
}

View File

@ -1237,8 +1237,7 @@ character(len=300) pure function IO_extractValue(pair,key)
IO_extractValue = ''
myChunk = scan(pair,SEP)
if (myChunk > 0 .and. pair(:myChunk-1) == key(:myChunk-1)) &
IO_extractValue = pair(myChunk+1:) ! extract value if key matches
if (myChunk > 0 .and. pair(:myChunk-1) == key) IO_extractValue = pair(myChunk+1:) ! extract value if key matches
end function IO_extractValue