소스 검색

Added libc.realpath

Mark Sibly 8 년 전
부모
커밋
17b5335cbd
2개의 변경된 파일12개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      modules/libc/libc.monkey2
  2. 5 0
      modules/libc/native/libc.h

+ 7 - 1
modules/libc/libc.monkey2

@@ -76,6 +76,10 @@ Alias intptr_t:ULong
 Alias uintptr_t:ULong
 Alias uintptr_t:ULong
 
 
 Function sizeof<T>:size_t( t:T )="sizeof"
 Function sizeof<T>:size_t( t:T )="sizeof"
+	
+'***** limits.h *****
+
+Const PATH_MAX:Int
 
 
 '***** stdio.h *****
 '***** stdio.h *****
 
 
@@ -114,11 +118,13 @@ Function free:Void( mem:Void Ptr )
 
 
 Function system:Int( cmd:CString )="system_"
 Function system:Int( cmd:CString )="system_"
 Function setenv:Int( name:CString,value:CString,overwrite:Int )="setenv_"
 Function setenv:Int( name:CString,value:CString,overwrite:Int )="setenv_"
-Function getenv:char_t Ptr( name:CString )
+Function getenv:char_t ptr( name:CString )
 
 
 Function exit_:Void( status:Int )="exit"
 Function exit_:Void( status:Int )="exit"
 Function atexit:Int( func:Void() )="atexit" 
 Function atexit:Int( func:Void() )="atexit" 
 Function abort:Void()
 Function abort:Void()
+	
+Function realpath:char_t Ptr( path:CString,resolved_path:char_t Ptr )
 
 
 '***** string.h *****
 '***** string.h *****
 
 

+ 5 - 0
modules/libc/native/libc.h

@@ -22,6 +22,11 @@ typedef int mode_t;
 #include <sys/time.h>
 #include <sys/time.h>
 #endif
 #endif
 
 
+#if _WIN32
+#define PATH_MAX 260
+#define realpath(X,Y) _fullpath( (Y),(X),PATH_MAX )
+#endif
+
 typedef struct tm tm_t;
 typedef struct tm tm_t;
 
 
 typedef struct stat stat_t;
 typedef struct stat stat_t;