Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenrsym_common.c
Go to the documentation of this file.
00001 /* rsym_common.c */ 00002 00003 #include <stdio.h> 00004 #include <string.h> 00005 #include <stdlib.h> 00006 00007 #include "rsym.h" 00008 00009 char* 00010 convert_path ( const char* origpath ) 00011 { 00012 char* newpath; 00013 int i; 00014 00015 newpath = strdup(origpath); 00016 00017 i = 0; 00018 while (newpath[i] != 0) 00019 { 00020 #ifdef UNIX_PATHS 00021 if (newpath[i] == '\\') 00022 { 00023 newpath[i] = '/'; 00024 } 00025 #else 00026 #ifdef DOS_PATHS 00027 if (newpath[i] == '/') 00028 { 00029 newpath[i] = '\\'; 00030 } 00031 #endif 00032 #endif 00033 i++; 00034 } 00035 return(newpath); 00036 } 00037 00038 void* 00039 load_file ( const char* file_name, size_t* file_size ) 00040 { 00041 FILE* f; 00042 void* FileData = NULL; 00043 00044 f = fopen ( file_name, "rb" ); 00045 if (f != NULL) 00046 { 00047 fseek(f, 0L, SEEK_END); 00048 *file_size = ftell(f); 00049 fseek(f, 0L, SEEK_SET); 00050 FileData = malloc(*file_size); 00051 if (FileData != NULL) 00052 { 00053 if ( *file_size != fread(FileData, 1, *file_size, f) ) 00054 { 00055 free(FileData); 00056 FileData = NULL; 00057 } 00058 } 00059 fclose(f); 00060 } 00061 return FileData; 00062 } Generated on Sat May 26 2012 04:36:37 for ReactOS by
1.7.6.1
|