ReactOS 0.4.16-dev-2110-ge3521eb
rsym_common.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "rsym.h"
Include dependency graph for rsym_common.c:

Go to the source code of this file.

Functions

charconvert_path (const char *origpath)
 
voidload_file (const char *file_name, size_t *file_size)
 

Function Documentation

◆ convert_path()

char * convert_path ( const char origpath)

Definition at line 10 of file rsym_common.c.

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}
static char * strdup(const char *buf)
Definition: string.h:83
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

◆ load_file()

void * load_file ( const char file_name,
size_t file_size 
)

Definition at line 39 of file rsym_common.c.

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
__msvcrt_long CDECL ftell(FILE *file)
Definition: file.c:4740
int CDECL fclose(FILE *file)
Definition: file.c:3757
int CDECL fseek(FILE *file, __msvcrt_long offset, int whence)
Definition: file.c:1610
size_t CDECL fread(void *ptr, size_t size, size_t nmemb, FILE *file)
Definition: file.c:4406
FILE *CDECL fopen(const char *path, const char *mode)
Definition: file.c:4310
#define L(x)
Definition: resources.c:13
GLfloat f
Definition: glext.h:7540
#define SEEK_SET
Definition: jmemansi.c:26
#define f
Definition: ke_i.h:83
static LPCWSTR file_name
Definition: protocol.c:147
static unsigned int file_size
Definition: regtests2xml.c:47