ReactOS  0.4.15-dev-1187-g119f102
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 }
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_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)

◆ 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  {
55  free(FileData);
56  FileData = NULL;
57  }
58  }
59  fclose(f);
60  }
61  return FileData;
62 }
static FILEDATA FileData[MAX_FDS]
Definition: fs.c:51
#define free
Definition: debug_ros.c:5
_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)
smooth NULL
Definition: ftsmooth.c:416
_Check_return_opt_ _CRTIMP int __cdecl fseek(_Inout_ FILE *_File, _In_ long _Offset, _In_ int _Origin)
#define SEEK_SET
Definition: jmemansi.c:26
GLfloat f
Definition: glext.h:7540
static const WCHAR L[]
Definition: oid.c:1250
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
#define f
Definition: ke_i.h:83
static LPCWSTR file_name
Definition: protocol.c:147
_Check_return_ _CRTIMP long __cdecl ftell(_Inout_ FILE *_File)
#define SEEK_END
Definition: cabinet.c:27
#define malloc
Definition: debug_ros.c:4
#define file_size(inode)
Definition: reiserfs_fs.h:1869