fileio.c File Reference

Provides an interface to C FILE* streams. More...

#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <dirent.h>
#include <kuroko/vm.h>
#include <kuroko/value.h>
#include <kuroko/object.h>
#include <kuroko/memory.h>
#include <kuroko/util.h>
Include dependency graph for fileio.c:

Go to the source code of this file.

Data Structures

struct  File
 Object for a C FILE* stream. More...
 
struct  Directory
 OBject for a C DIR* stream. More...
 

Macros

#define IS_File(o)   (krk_isInstanceOf(o, KRK_BASE_CLASS(File)))
 
#define AS_File(o)   ((struct File*)AS_OBJECT(o))
 
#define IS_BinaryFile(o)   (krk_isInstanceOf(o, KRK_BASE_CLASS(BinaryFile)))
 
#define AS_BinaryFile(o)   ((struct File*)AS_OBJECT(o))
 
#define IS_Directory(o)   (krk_isInstanceOf(o, KRK_BASE_CLASS(Directory)))
 
#define AS_Directory(o)   ((struct Directory*)AS_OBJECT(o))
 
#define CURRENT_CTYPE   struct File *
 
#define CURRENT_NAME   self
 
#define BLOCK_SIZE   1024
 
#define CURRENT_CTYPE   struct Directory *
 

Functions

KrkValue _krk_open (int, KrkValue *, int)
 
KrkValue _File___str__ (int, KrkValue *, int)
 
KrkValue _File_readline (int, KrkValue *, int)
 
KrkValue _File_readlines (int, KrkValue *, int)
 
KrkValue _File_read (int, KrkValue *, int)
 
KrkValue _File_write (int, KrkValue *, int)
 
KrkValue _File_close (int, KrkValue *, int)
 
KrkValue _File_flush (int, KrkValue *, int)
 
KrkValue _File___init__ (int, KrkValue *, int)
 
KrkValue _File___enter__ (int, KrkValue *, int)
 
KrkValue _File___exit__ (int, KrkValue *, int)
 
KrkValue _BinaryFile_readline (int, KrkValue *, int)
 
KrkValue _BinaryFile_readlines (int, KrkValue *, int)
 
KrkValue _BinaryFile_read (int, KrkValue *, int)
 
KrkValue _BinaryFile_write (int, KrkValue *, int)
 
KrkValue _krk_opendir (int, KrkValue *, int)
 
KrkValue _Directory___call__ (int, KrkValue *, int)
 
KrkValue _Directory___iter__ (int, KrkValue *, int)
 
KrkValue _Directory_close (int, KrkValue *, int)
 
KrkValue _Directory___repr__ (int, KrkValue *, int)
 
KrkValue _Directory___enter__ (int, KrkValue *, int)
 
KrkValue _Directory___exit__ (int, KrkValue *, int)
 
void krk_module_init_fileio (void)
 Initialize the built-in 'fileio' module.
 

Detailed Description

Provides an interface to C FILE* streams.

Definition in file fileio.c.