Sys_File_Paths_Equal

master
insofaras 2016-02-24 16:52:18 +00:00
parent 0a6c851788
commit d676f5f0b8
3 changed files with 30 additions and 0 deletions

View File

@ -31,6 +31,9 @@ typedef Sys_File_Time_Stamp_Sig(System_File_Time_Stamp);
#define Sys_Set_File_List_Sig(name) void name(File_List *file_list, String directory)
typedef Sys_Set_File_List_Sig(System_Set_File_List);
#define Sys_File_Paths_Equal_Sig(name) b32 name(char *path_a, char *path_b)
typedef Sys_File_Paths_Equal_Sig(System_File_Paths_Equal);
#define Sys_Post_Clipboard_Sig(name) void name(String str)
typedef Sys_Post_Clipboard_Sig(System_Post_Clipboard);

View File

@ -369,6 +369,22 @@ Sys_Set_File_List_Sig(system_set_file_list){
}
}
Sys_File_Paths_Equal_Sig(system_file_paths_equal){
b32 result = 0;
char* real_a = realpath(path_a, NULL);
char* real_b = realpath(path_b, NULL);
if(real_a && real_b){
result = strcmp(real_a, real_b);
free(real_a);
free(real_b);
}
return result;
}
Sys_Post_Clipboard_Sig(system_post_clipboard){
LinuxStringDup(&linuxvars.clipboard_outgoing, str.str, str.size);
XSetSelectionOwner(linuxvars.XDisplay, linuxvars.atom_CLIPBOARD, linuxvars.XWindow, CurrentTime);

View File

@ -495,6 +495,17 @@ DIRECTORY_CD_SIG(system_directory_cd){
return(result);
}
Sys_File_Paths_Equal_Sig(system_file_paths_equal){
b32 result = 0;
// TODO(someone who knows windows): implement me
AllowLocal(path_a);
AllowLocal(path_b);
return result;
}
internal
Sys_Post_Clipboard_Sig(system_post_clipboard){
if (OpenClipboard(win32vars.window_handle)){