RetroArch
Classes | Macros | Typedefs | Functions | Variables
liolib.c File Reference
#include "lprefix.h"
#include <ctype.h>
#include <errno.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
Include dependency graph for liolib.c:

Classes

struct  RN
 

Macros

#define liolib_c
 
#define LUA_LIB
 
#define L_MODEEXT   "b"
 
#define l_popen(L, c, m)
 
#define l_pclose(L, file)   ((void)L, (void)file, -1)
 
#define l_getc(f)   getc(f)
 
#define l_lockfile(f)   ((void)0)
 
#define l_unlockfile(f)   ((void)0)
 
#define l_fseek(f, o, w)   fseek(f,o,w)
 
#define l_ftell(f)   ftell(f)
 
#define l_seeknum   long
 
#define IO_PREFIX   "_IO_"
 
#define IOPREF_LEN   (sizeof(IO_PREFIX)/sizeof(char) - 1)
 
#define IO_INPUT   (IO_PREFIX "input")
 
#define IO_OUTPUT   (IO_PREFIX "output")
 
#define tolstream(L)   ((LStream *)luaL_checkudata(L, 1, LUA_FILEHANDLE))
 
#define isclosed(p)   ((p)->closef == NULL)
 
#define MAXARGLINE   250
 
#define L_MAXLENNUM   200
 

Typedefs

typedef luaL_Stream LStream
 

Functions

static int l_checkmode (const char *mode)
 
static int io_type (lua_State *L)
 
static int f_tostring (lua_State *L)
 
static FILEtofile (lua_State *L)
 
static LStreamnewprefile (lua_State *L)
 
static int aux_close (lua_State *L)
 
static int f_close (lua_State *L)
 
static int io_close (lua_State *L)
 
static int f_gc (lua_State *L)
 
static int io_fclose (lua_State *L)
 
static LStreamnewfile (lua_State *L)
 
static void opencheck (lua_State *L, const char *fname, const char *mode)
 
static int io_open (lua_State *L)
 
static int io_pclose (lua_State *L)
 
static int io_popen (lua_State *L)
 
static int io_tmpfile (lua_State *L)
 
static FILEgetiofile (lua_State *L, const char *findex)
 
static int g_iofile (lua_State *L, const char *f, const char *mode)
 
static int io_input (lua_State *L)
 
static int io_output (lua_State *L)
 
static int io_readline (lua_State *L)
 
static void aux_lines (lua_State *L, int toclose)
 
static int f_lines (lua_State *L)
 
static int io_lines (lua_State *L)
 
static int nextc (RN *rn)
 
static int test2 (RN *rn, const char *set)
 
static int readdigits (RN *rn, int hex)
 
static int read_number (lua_State *L, FILE *f)
 
static int test_eof (lua_State *L, FILE *f)
 
static int read_line (lua_State *L, FILE *f, int chop)
 
static void read_all (lua_State *L, FILE *f)
 
static int read_chars (lua_State *L, FILE *f, size_t n)
 
static int g_read (lua_State *L, FILE *f, int first)
 
static int io_read (lua_State *L)
 
static int f_read (lua_State *L)
 
static int g_write (lua_State *L, FILE *f, int arg)
 
static int io_write (lua_State *L)
 
static int f_write (lua_State *L)
 
static int f_seek (lua_State *L)
 
static int f_setvbuf (lua_State *L)
 
static int io_flush (lua_State *L)
 
static int f_flush (lua_State *L)
 
static void createmeta (lua_State *L)
 
static int io_noclose (lua_State *L)
 
static void createstdfile (lua_State *L, FILE *f, const char *k, const char *fname)
 
LUAMOD_API int luaopen_io (lua_State *L)
 

Variables

static const luaL_Reg iolib []
 
static const luaL_Reg flib []
 

Macro Definition Documentation

◆ IO_INPUT

#define IO_INPUT   (IO_PREFIX "input")

◆ IO_OUTPUT

#define IO_OUTPUT   (IO_PREFIX "output")

◆ IO_PREFIX

#define IO_PREFIX   "_IO_"

◆ IOPREF_LEN

#define IOPREF_LEN   (sizeof(IO_PREFIX)/sizeof(char) - 1)

◆ isclosed

#define isclosed (   p)    ((p)->closef == NULL)

◆ l_fseek

#define l_fseek (   f,
  o,
  w 
)    fseek(f,o,w)

◆ l_ftell

#define l_ftell (   f)    ftell(f)

◆ l_getc

#define l_getc (   f)    getc(f)

◆ l_lockfile

#define l_lockfile (   f)    ((void)0)

◆ L_MAXLENNUM

#define L_MAXLENNUM   200

◆ L_MODEEXT

#define L_MODEEXT   "b"

◆ l_pclose

#define l_pclose (   L,
  file 
)    ((void)L, (void)file, -1)

◆ l_popen

#define l_popen (   L,
  c,
  m 
)
Value:
((void)((void)c, m), \
luaL_error(L, "'popen' not supported"), \
(FILE*)0)
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
const GLubyte * c
Definition: glext.h:9812
#define FILE
Definition: file_stream_transforms.h:35
LUALIB_API int luaL_error(lua_State *L, const char *fmt,...)
Definition: lauxlib.c:223
Ιστορικό Εικόνα Πληροφορίες Όλοι Οι Χρήστες Χειρίζονται Το Μενού Αριστερό Αναλογικό Αριστερό Αναλογικό Αριστερό Αναλογικό Y Αριστερό Αναλογικό Δεξί Αναλογικό X Δεξί Αναλογικό Δεξί Αναλογικό Y Δεξί Αναλογικό Σκανδάλη Όπλου Όπλο Aux A Όπλο Aux C Όπλο Select Όπλο D pad Κάτω Όπλο D pad Δεξιά Νεκρή Ζώνη Αναλογικού Σύνδεση Όλων Λήξη Χρόνου Σύνδεσης Hide Unbound Core Input Descriptors Κατάλογος Συσκευών Κατάλογος Ποντικιού Duty Cycle Keyboard Gamepad Mapping Enable Κουμπί D pad κάτω Κουμπί Κουμπί L(πίσω)" ) MSG_HASH( MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT
const GLfloat * m
Definition: glext.h:11755

◆ l_seeknum

#define l_seeknum   long

◆ l_unlockfile

#define l_unlockfile (   f)    ((void)0)

◆ liolib_c

#define liolib_c

◆ LUA_LIB

#define LUA_LIB

◆ MAXARGLINE

#define MAXARGLINE   250

◆ tolstream

#define tolstream (   L)    ((LStream *)luaL_checkudata(L, 1, LUA_FILEHANDLE))

Typedef Documentation

◆ LStream

Function Documentation

◆ aux_close()

static int aux_close ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ aux_lines()

static void aux_lines ( lua_State L,
int  toclose 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createmeta()

static void createmeta ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createstdfile()

static void createstdfile ( lua_State L,
FILE f,
const char *  k,
const char *  fname 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_close()

static int f_close ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_flush()

static int f_flush ( lua_State L)
static
Here is the call graph for this function:

◆ f_gc()

static int f_gc ( lua_State L)
static
Here is the call graph for this function:

◆ f_lines()

static int f_lines ( lua_State L)
static
Here is the call graph for this function:

◆ f_read()

static int f_read ( lua_State L)
static
Here is the call graph for this function:

◆ f_seek()

static int f_seek ( lua_State L)
static
Here is the call graph for this function:

◆ f_setvbuf()

static int f_setvbuf ( lua_State L)
static
Here is the call graph for this function:

◆ f_tostring()

static int f_tostring ( lua_State L)
static
Here is the call graph for this function:

◆ f_write()

static int f_write ( lua_State L)
static
Here is the call graph for this function:

◆ g_iofile()

static int g_iofile ( lua_State L,
const char *  f,
const char *  mode 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ g_read()

static int g_read ( lua_State L,
FILE f,
int  first 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ g_write()

static int g_write ( lua_State L,
FILE f,
int  arg 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getiofile()

static FILE* getiofile ( lua_State L,
const char *  findex 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ io_close()

static int io_close ( lua_State L)
static
Here is the call graph for this function:

◆ io_fclose()

static int io_fclose ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ io_flush()

static int io_flush ( lua_State L)
static
Here is the call graph for this function:

◆ io_input()

static int io_input ( lua_State L)
static
Here is the call graph for this function:

◆ io_lines()

static int io_lines ( lua_State L)
static
Here is the call graph for this function:

◆ io_noclose()

static int io_noclose ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ io_open()

static int io_open ( lua_State L)
static
Here is the call graph for this function:

◆ io_output()

static int io_output ( lua_State L)
static
Here is the call graph for this function:

◆ io_pclose()

static int io_pclose ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ io_popen()

static int io_popen ( lua_State L)
static
Here is the call graph for this function:

◆ io_read()

static int io_read ( lua_State L)
static
Here is the call graph for this function:

◆ io_readline()

static int io_readline ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ io_tmpfile()

static int io_tmpfile ( lua_State L)
static
Here is the call graph for this function:

◆ io_type()

static int io_type ( lua_State L)
static
Here is the call graph for this function:

◆ io_write()

static int io_write ( lua_State L)
static
Here is the call graph for this function:

◆ l_checkmode()

static int l_checkmode ( const char *  mode)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaopen_io()

LUAMOD_API int luaopen_io ( lua_State L)
Here is the call graph for this function:

◆ newfile()

static LStream* newfile ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ newprefile()

static LStream* newprefile ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nextc()

static int nextc ( RN rn)
static
Here is the caller graph for this function:

◆ opencheck()

static void opencheck ( lua_State L,
const char *  fname,
const char *  mode 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_all()

static void read_all ( lua_State L,
FILE f 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_chars()

static int read_chars ( lua_State L,
FILE f,
size_t  n 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_line()

static int read_line ( lua_State L,
FILE f,
int  chop 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_number()

static int read_number ( lua_State L,
FILE f 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readdigits()

static int readdigits ( RN rn,
int  hex 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test2()

static int test2 ( RN rn,
const char *  set 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_eof()

static int test_eof ( lua_State L,
FILE f 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tofile()

static FILE* tofile ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ flib

const luaL_Reg flib[]
static
Initial value:
= {
{"close", f_close},
{"flush", f_flush},
{"lines", f_lines},
{"read", f_read},
{"seek", f_seek},
{"setvbuf", f_setvbuf},
{"write", f_write},
{"__gc", f_gc},
{"__tostring", f_tostring},
}
static int f_flush(lua_State *L)
Definition: liolib.c:692
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static int f_lines(lua_State *L)
Definition: liolib.c:349
static int f_gc(lua_State *L)
Definition: liolib.c:222
static int f_tostring(lua_State *L)
Definition: liolib.c:164
static int f_seek(lua_State *L)
Definition: liolib.c:656
static int f_write(lua_State *L)
Definition: liolib.c:649
static int f_close(lua_State *L)
Definition: liolib.c:209
static int f_setvbuf(lua_State *L)
Definition: liolib.c:675
static int f_read(lua_State *L)
Definition: liolib.c:584

◆ iolib

const luaL_Reg iolib[]
static
Initial value:
= {
{"close", io_close},
{"flush", io_flush},
{"input", io_input},
{"lines", io_lines},
{"open", io_open},
{"output", io_output},
{"popen", io_popen},
{"read", io_read},
{"tmpfile", io_tmpfile},
{"type", io_type},
{"write", io_write},
}
static int io_type(lua_State *L)
Definition: liolib.c:150
static int io_write(lua_State *L)
Definition: liolib.c:644
static int io_close(lua_State *L)
Definition: liolib.c:215
static int io_output(lua_State *L)
Definition: liolib.c:325
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static int io_open(lua_State *L)
Definition: liolib.c:256
static int io_flush(lua_State *L)
Definition: liolib.c:687
static int io_popen(lua_State *L)
Definition: liolib.c:276
static int io_tmpfile(lua_State *L)
Definition: liolib.c:286
static int io_read(lua_State *L)
Definition: liolib.c:579
static int io_input(lua_State *L)
Definition: liolib.c:320
static int io_lines(lua_State *L)
Definition: liolib.c:356