Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
emu_msvcrt.cpp File Reference
#include <math.h>
#include <mutex>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <io.h>
#include <direct.h>
#include <process.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <time.h>
#include <signal.h>
#include "CompileInfo.h"
#include "FileItem.h"
#include "FileItemList.h"
#include "ServiceBroker.h"
#include "URL.h"
#include "Util.h"
#include "emu_dummy.h"
#include "emu_msvcrt.h"
#include "filesystem/Directory.h"
#include "filesystem/File.h"
#include "filesystem/SpecialProtocol.h"
#include "settings/Settings.h"
#include "settings/SettingsComponent.h"
#include "util/EmuFileWrapper.h"
#include "utils/log.h"
#include "utils/CharsetConverter.h"
#include "utils/URIUtils.h"
#include <dlfcn.h>
#include "platform/Environment.h"
#include "utils/StringUtils.h"
#include "utils/XTimeUtils.h"

Classes

struct  SDirData
 

Macros

#define MAX_OPEN_DIRS   10
 
#define EMU_MAX_ENVIRONMENT_ITEMS   100
 

Functions

void update_cache_dialog (const char *tmp)
 
void __stdcall init_emu_environ ()
 
void __stdcall update_emu_environ ()
 
void __stdcall cleanup_emu_environ ()
 
void dll_sleep (unsigned long imSec)
 
void dllReleaseAll ()
 
voiddllmalloc (size_t size)
 
void dllfree (void *pPtr)
 
voiddllcalloc (size_t num, size_t size)
 
voiddllrealloc (void *memblock, size_t size)
 
void dllexit (int iCode)
 
void dllabort ()
 
voiddll__dllonexit (PFV input, PFV **start, PFV **end)
 
_onexit_t dll_onexit (_onexit_t func)
 
int dllputs (const char *szLine)
 
int dllprintf (const char *format,...)
 
char * dll_fullpath (char *absPath, const char *relPath, size_t maxLength)
 
FILE * dll_popen (const char *command, const char *mode)
 
voiddll_dlopen (const char *filename, int flag)
 
int dll_pclose (FILE *stream)
 
FILE * dll_fdopen (int fd, const char *mode)
 
int dll_open (const char *szFileName, int iMode)
 
FILE * dll_freopen (const char *path, const char *mode, FILE *stream)
 
int dll_read (int fd, void *buffer, unsigned int uiSize)
 
int dll_write (int fd, const void *buffer, unsigned int uiSize)
 
int dll_fstat64 (int fd, struct __stat64 *buf)
 
int dll_close (int fd)
 
__off64_t dll_lseeki64 (int fd, __off64_t lPos, int iWhence)
 
__off_t dll_lseek (int fd, __off_t lPos, int iWhence)
 
void dll_rewind (FILE *stream)
 
void dll_flockfile (FILE *stream)
 
int dll_ftrylockfile (FILE *stream)
 
void dll_funlockfile (FILE *stream)
 
int dll_fclose (FILE *stream)
 
intptr_t dll_findfirst (const char *file, struct _finddata_t *data)
 
intptr_t dll_findfirst64i32 (const char *file, struct _finddata64i32_t *data)
 
int dll_findnext (intptr_t f, _finddata_t *data)
 
int dll_findnext64i32 (intptr_t f, _finddata64i32_t *data)
 
int dll_findclose (intptr_t handle)
 
void dll__security_error_handler (int code, void *data)
 
DIRdll_opendir (const char *file)
 
struct direntdll_readdir (DIR *dirp)
 
int dll_closedir (DIR *dirp)
 
void dll_rewinddir (DIR *dirp)
 
char * dll_fgets (char *pszString, int num, FILE *stream)
 
int dll_feof (FILE *stream)
 
int dll_fread (void *buffer, size_t size, size_t count, FILE *stream)
 
int dll_fgetc (FILE *stream)
 
int dll_getc (FILE *stream)
 
FILE * dll_fopen (const char *filename, const char *mode)
 
int dll_fopen_s (FILE **pFile, const char *filename, const char *mode)
 
int dll_putc (int c, FILE *stream)
 
int dll_putchar (int c)
 
int dll_fputc (int character, FILE *stream)
 
int dll_fputs (const char *szLine, FILE *stream)
 
int dll_fseek64 (FILE *stream, off64_t offset, int origin)
 
int dll_fseek (FILE *stream, long offset, int origin)
 
int dll_ungetc (int c, FILE *stream)
 
long dll_ftell (FILE *stream)
 
off64_t dll_ftell64 (FILE *stream)
 
long dll_tell (int fd)
 
long long dll_telli64 (int fd)
 
size_t dll_fwrite (const void *buffer, size_t size, size_t count, FILE *stream)
 
int dll_fflush (FILE *stream)
 
int dll_ferror (FILE *stream)
 
int dllvprintf (const char *format, va_list va)
 
int dll_vfprintf (FILE *stream, const char *format, va_list va)
 
int dll_fscanf (FILE *stream, const char *format,...)
 
int dll_fprintf (FILE *stream, const char *format,...)
 
int dll_fgetpos (FILE *stream, fpos_t *pos)
 
int dll_fgetpos64 (FILE *stream, fpos64_t *pos)
 
int dll_fsetpos64 (FILE *stream, const fpos64_t *pos)
 
int dll_fsetpos (FILE *stream, const fpos_t *pos)
 
int dll_fileno (FILE *stream)
 
void dll_clearerr (FILE *stream)
 
char * dll_strdup (const char *str)
 
int dll_initterm (PFV *start, const PFV *end)
 
int dll_stat (const char *path, struct stat *buffer)
 
int dll_stati64 (const char *path, struct _stati64 *buffer)
 
int dll_stat64 (const char *path, struct __stat64 *buffer)
 
int dll_fstat (int fd, struct stat *buffer)
 
int dll_fstati64 (int fd, struct _stati64 *buffer)
 
int dll_setmode (int handle, int mode)
 
void dllperror (const char *s)
 
char * dllstrerror (int iErr)
 
int dll_mkdir (const char *dir)
 
const char * dll_getcwd (char *buffer, int maxlen)
 
int dll_putenv (const char *envstring)
 
char * dll_getenv (const char *szKey)
 
int dll_ctype (int i)
 
int dll_system (const char *command)
 
 void (__cdecl *dll_signal(int sig, void(__cdecl *func)(int)))(int)
 
int dll_getpid ()
 
int dll__commit (int fd)
 
char *** dll___p__environ ()
 
int dll_setvbuf (FILE *stream, char *buf, int type, size_t size)
 
struct mntent * dll_getmntent (FILE *fp)
 
struct mntent * dll_getmntent_r (FILE *fp, struct mntent *result, char *buffer, int bufsize)
 
int __cdecl dll_open_osfhandle (intptr_t _OSFileHandle, int _Flags)
 

Variables

bool bVecDirsInited = false
 
char ** dll__environ = dll__environ_imp
 
CCriticalSection dll_cs_environ
 

Macro Definition Documentation

◆ EMU_MAX_ENVIRONMENT_ITEMS

#define EMU_MAX_ENVIRONMENT_ITEMS   100

◆ MAX_OPEN_DIRS

#define MAX_OPEN_DIRS   10

Function Documentation

◆ cleanup_emu_environ()

void __stdcall cleanup_emu_environ ( )

◆ dll___p__environ()

char *** dll___p__environ ( )

◆ dll__commit()

int dll__commit ( int fd)

◆ dll__dllonexit()

void * dll__dllonexit ( PFV input,
PFV ** start,
PFV ** end )

◆ dll__security_error_handler()

void dll__security_error_handler ( int code,
void * data )

◆ dll_clearerr()

void dll_clearerr ( FILE * stream)

◆ dll_close()

int dll_close ( int fd)

◆ dll_closedir()

int dll_closedir ( DIR * dirp)

◆ dll_ctype()

int dll_ctype ( int i)

◆ dll_dlopen()

void * dll_dlopen ( const char * filename,
int flag )

◆ dll_fclose()

int dll_fclose ( FILE * stream)

◆ dll_fdopen()

FILE * dll_fdopen ( int fd,
const char * mode )

◆ dll_feof()

int dll_feof ( FILE * stream)

◆ dll_ferror()

int dll_ferror ( FILE * stream)

◆ dll_fflush()

int dll_fflush ( FILE * stream)

◆ dll_fgetc()

int dll_fgetc ( FILE * stream)

◆ dll_fgetpos()

int dll_fgetpos ( FILE * stream,
fpos_t * pos )

◆ dll_fgetpos64()

int dll_fgetpos64 ( FILE * stream,
fpos64_t * pos )

◆ dll_fgets()

char * dll_fgets ( char * pszString,
int num,
FILE * stream )

◆ dll_fileno()

int dll_fileno ( FILE * stream)

◆ dll_findclose()

int dll_findclose ( intptr_t handle)

◆ dll_findfirst()

intptr_t dll_findfirst ( const char * file,
struct _finddata_t * data )

◆ dll_findfirst64i32()

intptr_t dll_findfirst64i32 ( const char * file,
struct _finddata64i32_t * data )

◆ dll_findnext()

int dll_findnext ( intptr_t f,
_finddata_t * data )

◆ dll_findnext64i32()

int dll_findnext64i32 ( intptr_t f,
_finddata64i32_t * data )

◆ dll_flockfile()

void dll_flockfile ( FILE * stream)

◆ dll_fopen()

FILE * dll_fopen ( const char * filename,
const char * mode )

◆ dll_fopen_s()

int dll_fopen_s ( FILE ** pFile,
const char * filename,
const char * mode )

◆ dll_fprintf()

int dll_fprintf ( FILE * stream,
const char * format,
... )

◆ dll_fputc()

int dll_fputc ( int character,
FILE * stream )

◆ dll_fputs()

int dll_fputs ( const char * szLine,
FILE * stream )

◆ dll_fread()

int dll_fread ( void * buffer,
size_t size,
size_t count,
FILE * stream )

◆ dll_freopen()

FILE * dll_freopen ( const char * path,
const char * mode,
FILE * stream )

◆ dll_fscanf()

int dll_fscanf ( FILE * stream,
const char * format,
... )

◆ dll_fseek()

int dll_fseek ( FILE * stream,
long offset,
int origin )

◆ dll_fseek64()

int dll_fseek64 ( FILE * stream,
off64_t offset,
int origin )

◆ dll_fsetpos()

int dll_fsetpos ( FILE * stream,
const fpos_t * pos )

◆ dll_fsetpos64()

int dll_fsetpos64 ( FILE * stream,
const fpos64_t * pos )

◆ dll_fstat()

int dll_fstat ( int fd,
struct stat * buffer )

◆ dll_fstat64()

int dll_fstat64 ( int fd,
struct __stat64 * buf )

◆ dll_fstati64()

int dll_fstati64 ( int fd,
struct _stati64 * buffer )

◆ dll_ftell()

long dll_ftell ( FILE * stream)

◆ dll_ftell64()

off64_t dll_ftell64 ( FILE * stream)

◆ dll_ftrylockfile()

int dll_ftrylockfile ( FILE * stream)

◆ dll_fullpath()

char * dll_fullpath ( char * absPath,
const char * relPath,
size_t maxLength )

◆ dll_funlockfile()

void dll_funlockfile ( FILE * stream)

◆ dll_fwrite()

size_t dll_fwrite ( const void * buffer,
size_t size,
size_t count,
FILE * stream )

◆ dll_getc()

int dll_getc ( FILE * stream)

◆ dll_getcwd()

const char * dll_getcwd ( char * buffer,
int maxlen )

◆ dll_getenv()

char * dll_getenv ( const char * szKey)

◆ dll_getmntent()

struct mntent * dll_getmntent ( FILE * fp)

◆ dll_getmntent_r()

struct mntent * dll_getmntent_r ( FILE * fp,
struct mntent * result,
char * buffer,
int bufsize )

◆ dll_getpid()

int dll_getpid ( )

◆ dll_initterm()

int dll_initterm ( PFV * start,
const PFV * end )

◆ dll_lseek()

__off_t dll_lseek ( int fd,
__off_t lPos,
int iWhence )

◆ dll_lseeki64()

__off64_t dll_lseeki64 ( int fd,
__off64_t lPos,
int iWhence )

◆ dll_mkdir()

int dll_mkdir ( const char * dir)

◆ dll_onexit()

_onexit_t dll_onexit ( _onexit_t func)

◆ dll_open()

int dll_open ( const char * szFileName,
int iMode )

◆ dll_open_osfhandle()

int __cdecl dll_open_osfhandle ( intptr_t _OSFileHandle,
int _Flags )

◆ dll_opendir()

DIR * dll_opendir ( const char * file)

◆ dll_pclose()

int dll_pclose ( FILE * stream)

◆ dll_popen()

FILE * dll_popen ( const char * command,
const char * mode )

◆ dll_putc()

int dll_putc ( int c,
FILE * stream )

◆ dll_putchar()

int dll_putchar ( int c)

◆ dll_putenv()

int dll_putenv ( const char * envstring)

◆ dll_read()

int dll_read ( int fd,
void * buffer,
unsigned int uiSize )

◆ dll_readdir()

struct dirent * dll_readdir ( DIR * dirp)

◆ dll_rewind()

void dll_rewind ( FILE * stream)

◆ dll_rewinddir()

void dll_rewinddir ( DIR * dirp)

◆ dll_setmode()

int dll_setmode ( int handle,
int mode )

◆ dll_setvbuf()

int dll_setvbuf ( FILE * stream,
char * buf,
int type,
size_t size )

◆ dll_sleep()

void dll_sleep ( unsigned long imSec)

◆ dll_stat()

int dll_stat ( const char * path,
struct stat * buffer )

◆ dll_stat64()

int dll_stat64 ( const char * path,
struct __stat64 * buffer )

◆ dll_stati64()

int dll_stati64 ( const char * path,
struct _stati64 * buffer )

◆ dll_strdup()

char * dll_strdup ( const char * str)

◆ dll_system()

int dll_system ( const char * command)

◆ dll_tell()

long dll_tell ( int fd)

◆ dll_telli64()

long long dll_telli64 ( int fd)

◆ dll_ungetc()

int dll_ungetc ( int c,
FILE * stream )

◆ dll_vfprintf()

int dll_vfprintf ( FILE * stream,
const char * format,
va_list va )

◆ dll_write()

int dll_write ( int fd,
const void * buffer,
unsigned int uiSize )

◆ dllabort()

void dllabort ( )

◆ dllcalloc()

void * dllcalloc ( size_t num,
size_t size )

◆ dllexit()

void dllexit ( int iCode)

◆ dllfree()

void dllfree ( void * pPtr)

◆ dllmalloc()

void * dllmalloc ( size_t size)

◆ dllperror()

void dllperror ( const char * s)

◆ dllprintf()

int dllprintf ( const char * format,
... )

◆ dllputs()

int dllputs ( const char * szLine)

◆ dllrealloc()

void * dllrealloc ( void * memblock,
size_t size )

◆ dllReleaseAll()

void dllReleaseAll ( )

◆ dllstrerror()

char * dllstrerror ( int iErr)

◆ dllvprintf()

int dllvprintf ( const char * format,
va_list va )

◆ init_emu_environ()

void __stdcall init_emu_environ ( )

◆ update_cache_dialog()

void update_cache_dialog ( const char * tmp)
extern

◆ update_emu_environ()

void __stdcall update_emu_environ ( )

◆ void()

void ( __cdecl * dll_signalint sig, void(__cdecl *func)(int))

Variable Documentation

◆ bVecDirsInited

bool bVecDirsInited = false

◆ dll__environ

char ** dll__environ = dll__environ_imp

◆ dll_cs_environ

CCriticalSection dll_cs_environ