kfile.c File Reference

Virtual KFile I/O interface. More...

#include "kfile.h"
#include <appconfig.h>
#include <cfg/debug.h>
#include <mware/formatwr.h>
#include <string.h>

Go to the source code of this file.


Functions

int kfile_putc (int _c, struct KFile *fd)
 Generic putc() implementation using fd->write.
int kfile_getc (struct KFile *fd)
 Generic getc() implementation using fd->read.
int kfile_print (struct KFile *fd, const char *s)
 Write a string to kfile fd.
kfile_off_t kfile_genericSeek (struct KFile *fd, kfile_off_t offset, KSeekMode whence)
 Move fd file seek position of offset bytes from whence.
struct KFilekfile_genericReopen (struct KFile *fd)
 Reopen file fd.

Detailed Description

Virtual KFile I/O interface.

This module implements some generic I/O interfaces for kfile.

Version:
Id
kfile.c 1197 2008-03-18 09:32:19Z asterix
Author:
Francesco Sacchi <batt@develer.com>

Daniele Basile <asterix@develer.com>

Definition in file kfile.c.


Function Documentation

struct KFile* kfile_genericReopen ( struct KFile fd  )  [read]

Reopen file fd.

Generic implementation of kfile_reopen.

This is a generic implementation that only flush file and reset seek_pos to 0.

Definition at line 214 of file kfile.c.

kfile_off_t kfile_genericSeek ( struct KFile fd,
kfile_off_t  offset,
KSeekMode  whence 
)

Move fd file seek position of offset bytes from whence.

Generic implementation of kfile_seek.

This is a generic implementation of seek function, you can redefine it in your local module if needed.

Definition at line 175 of file kfile.c.

int kfile_getc ( struct KFile fd  ) 

Generic getc() implementation using fd->read.

Generic getc implementation using kfile_read.

Definition at line 77 of file kfile.c.

int kfile_print ( struct KFile fd,
const char *  s 
)

Write a string to kfile fd.

Returns:
0 if OK, EOF in case of error.

Definition at line 108 of file kfile.c.

int kfile_putc ( int  _c,
struct KFile fd 
)

Generic putc() implementation using fd->write.

Generic putc implementation using kfile_write.

Definition at line 64 of file kfile.c.