libjio.h File Reference

#include <stdint.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <pthread.h>
#include <unistd.h>

Include dependency graph for libjio.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  jfsck_result
 The result of a jfsck() run. More...

Defines

#define J_NOLOCK   1
 Don't lock the file before operating on it.
#define J_NOROLLBACK   2
 No need to read rollback information.
#define J_LINGER   4
 Use lingering transactions.
#define J_RDONLY   512
 Marks a file as read-only.
#define J_COMMITTED   1024
 Marks a transaction as committed.
#define J_ROLLBACKED   2048
 Marks a transaction as rollbacked.
#define J_ROLLBACKING   4096
 Marks a transaction as rollbacking.
#define J_CLEANUP   1
 Perform a journal cleanup.

Typedefs

typedef struct jfs jfs_t
 An open file, similar to a file descriptor.
typedef struct jtrans jtrans_t
 A single transaction.

Enumerations

enum  jfsck_return {
  J_ESUCCESS = 0, J_ENOENT = -1, J_ENOJOURNAL = -2, J_ENOMEM = -3,
  J_ECLEANUP = -4, J_EIO = -5
}
 jfsck() return values. More...

Functions

jfs_tjopen (const char *name, int flags, int mode, unsigned int jflags)
 Open a file.
int jclose (jfs_t *fs)
 Close a file opened with jopen().
int jsync (jfs_t *fs)
 Sync a file.
jtrans_tjtrans_new (jfs_t *fs, unsigned int flags)
 Create a new transaction.
int jtrans_add_w (jtrans_t *ts, const void *buf, size_t count, off_t offset)
 Add a write operation to a transaction.
int jtrans_add_r (jtrans_t *ts, void *buf, size_t count, off_t offset)
 Add a read operation to a transaction.
ssize_t jtrans_commit (jtrans_t *ts)
 Commit a transaction.
ssize_t jtrans_rollback (jtrans_t *ts)
 Rollback a transaction.
void jtrans_free (jtrans_t *ts)
 Free a transaction structure.
int jmove_journal (jfs_t *fs, const char *newpath)
 Change the location of the journal directory.
int jfs_autosync_start (jfs_t *fs, time_t max_sec, size_t max_bytes)
 Start an autosync thread.
int jfs_autosync_stop (jfs_t *fs)
 Stop an autosync thread that was started using jfs_autosync_start(fs).
enum jfsck_return jfsck (const char *name, const char *jdir, struct jfsck_result *res, unsigned int flags)
 Check and repair the given path.
ssize_t jread (jfs_t *fs, void *buf, size_t count)
 Read from the file.
ssize_t jpread (jfs_t *fs, void *buf, size_t count, off_t offset)
 Read from the file at the given offset.
ssize_t jreadv (jfs_t *fs, const struct iovec *vector, int count)
 Read from the file into multiple buffers.
ssize_t jwrite (jfs_t *fs, const void *buf, size_t count)
 Write to the file.
ssize_t jpwrite (jfs_t *fs, const void *buf, size_t count, off_t offset)
 Write to the file at the given offset.
ssize_t jwritev (jfs_t *fs, const struct iovec *vector, int count)
 Write to the file from multiple buffers.
int jtruncate (jfs_t *fs, off_t length)
 Truncates the file to the given length.
off_t jlseek (jfs_t *fs, off_t offset, int whence)
 Reposition read/write file offset.
jfs_tjfopen (const char *path, const char *mode)
int jfclose (jfs_t *stream)
jfs_tjfreopen (const char *path, const char *mode, jfs_t *stream)
size_t jfread (void *ptr, size_t size, size_t nmemb, jfs_t *stream)
size_t jfwrite (const void *ptr, size_t size, size_t nmemb, jfs_t *stream)
int jfileno (jfs_t *stream)
int jfeof (jfs_t *stream)
void jclearerr (jfs_t *stream)
int jferror (jfs_t *stream)
int jfseek (jfs_t *stream, long offset, int whence)
long jftell (jfs_t *stream)
void jrewind (jfs_t *stream)
FILE * jfsopen (jfs_t *stream, const char *mode)


Define Documentation

#define J_RDONLY   512

Marks a file as read-only.

For internal use only, automatically set when O_RDONLY is passed to jopen().

For internal use only.

Definition at line 471 of file libjio.h.

Referenced by jclose(), jopen(), jtrans_add_common(), and jtrans_commit().

#define J_COMMITTED   1024

Marks a transaction as committed.

For internal use only.

Definition at line 482 of file libjio.h.

Referenced by jtrans_commit().

#define J_ROLLBACKED   2048

Marks a transaction as rollbacked.

For internal use only.

Definition at line 486 of file libjio.h.

Referenced by jtrans_commit().

#define J_ROLLBACKING   4096

Marks a transaction as rollbacking.

For internal use only.

Definition at line 490 of file libjio.h.

Referenced by jtrans_commit().


Typedef Documentation

typedef struct jfs jfs_t

An open file, similar to a file descriptor.

Definition at line 31 of file libjio.h.

typedef struct jtrans jtrans_t

A single transaction.

Definition at line 34 of file libjio.h.


Function Documentation

jfs_t* jfopen ( const char *  path,
const char *  mode 
) [read]

Definition at line 32 of file ansi.c.

Referenced by jfreopen().

Here is the call graph for this function:

Here is the caller graph for this function:

int jfclose ( jfs_t stream  ) 

Definition at line 73 of file ansi.c.

Referenced by jfreopen().

Here is the call graph for this function:

Here is the caller graph for this function:

jfs_t* jfreopen ( const char *  path,
const char *  mode,
jfs_t stream 
) [read]

Definition at line 86 of file ansi.c.

Here is the call graph for this function:

size_t jfread ( void *  ptr,
size_t  size,
size_t  nmemb,
jfs_t stream 
)

Definition at line 96 of file ansi.c.

Here is the call graph for this function:

size_t jfwrite ( const void *  ptr,
size_t  size,
size_t  nmemb,
jfs_t stream 
)

Definition at line 108 of file ansi.c.

Here is the call graph for this function:

int jfileno ( jfs_t stream  ) 

Definition at line 120 of file ansi.c.

Referenced by jfeof().

Here is the caller graph for this function:

int jfeof ( jfs_t stream  ) 

Definition at line 126 of file ansi.c.

Here is the call graph for this function:

void jclearerr ( jfs_t stream  ) 

Definition at line 152 of file ansi.c.

int jferror ( jfs_t stream  ) 

Definition at line 159 of file ansi.c.

int jfseek ( jfs_t stream,
long  offset,
int  whence 
)

Definition at line 167 of file ansi.c.

long jftell ( jfs_t stream  ) 

Definition at line 183 of file ansi.c.

void jrewind ( jfs_t stream  ) 

Definition at line 190 of file ansi.c.

FILE* jfsopen ( jfs_t stream,
const char *  mode 
)

Definition at line 198 of file ansi.c.


Generated on Sat Sep 12 13:33:33 2009 for libjio (internal) by  doxygen 1.5.8