ReactOS 0.4.15-dev-7788-g1ad9096
rsym_common.c
Go to the documentation of this file.
1/* rsym_common.c */
2
3#include <stdio.h>
4#include <string.h>
5#include <stdlib.h>
6
7#include "rsym.h"
8
9char*
10convert_path ( const char* origpath )
11{
12 char* newpath;
13 int i;
14
15 newpath = strdup(origpath);
16
17 i = 0;
18 while (newpath[i] != 0)
19 {
20#ifdef UNIX_PATHS
21 if (newpath[i] == '\\')
22 {
23 newpath[i] = '/';
24 }
25#else
26#ifdef DOS_PATHS
27 if (newpath[i] == '/')
28 {
29 newpath[i] = '\\';
30 }
31#endif
32#endif
33 i++;
34 }
35 return(newpath);
36}
37
38void*
39load_file ( const char* file_name, size_t* file_size )
40{
41 FILE* f;
42 void* FileData = NULL;
43
44 f = fopen ( file_name, "rb" );
45 if (f != NULL)
46 {
47 fseek(f, 0L, SEEK_END);
48 *file_size = ftell(f);
49 fseek(f, 0L, SEEK_SET);
51 if (FileData != NULL)
52 {
53 if ( *file_size != fread(FileData, 1, *file_size, f) )
54 {
56 FileData = NULL;
57 }
58 }
59 fclose(f);
60 }
61 return FileData;
62}
static FILEDATA FileData[MAX_FDS]
Definition: fs.c:51
#define SEEK_END
Definition: cabinet.c:29
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
GLfloat f
Definition: glext.h:7540
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_Check_return_opt_ _CRTIMP size_t __cdecl fread(_Out_writes_bytes_(_ElementSize *_Count) void *_DstBuf, _In_ size_t _ElementSize, _In_ size_t _Count, _Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fseek(_Inout_ FILE *_File, _In_ long _Offset, _In_ int _Origin)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP long __cdecl ftell(_Inout_ FILE *_File)
#define SEEK_SET
Definition: jmemansi.c:26
#define f
Definition: ke_i.h:83
static LPCWSTR file_name
Definition: protocol.c:147
#define L(x)
Definition: ntvdm.h:50
static unsigned int file_size
Definition: regtests2xml.c:47
char * convert_path(const char *origpath)
Definition: rsym_common.c:10
void * load_file(const char *file_name, size_t *file_size)
Definition: rsym_common.c:39
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)