Alien-Libjio

 view release on metacpan or  search on metacpan

libjio/libjio/libjio.h  view on Meta::CPAN


/*
 * libjio - A library for Journaled I/O
 * Alberto Bertogli (albertito@blitiri.com.ar)
 */

#ifndef _LIBJIO_H
#define _LIBJIO_H

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

/* Check if we're using Large File Support - otherwise refuse to build.
 * Otherwise, we would allow applications not using LFS to link with the
 * library (which uses LFS) and that's just begging for problems. There should
 * be a portable way for the C library to do some of this for us, but until I
 * find one, this is the best we can do */
#ifndef _LARGEFILE_SOURCE
#error "You must compile your application with Large File Support"
#endif

/*
 * Opaque types, the API does not expose these
 */

/** An open file, similar to a file descriptor. */
typedef struct jfs jfs_t;

/** A single transaction. */
typedef struct jtrans jtrans_t;


/*
 * Public types
 */

/** The result of a jfsck() run.
 *
 * @see jfsck()
 * @ingroup check
 */
struct jfsck_result {
	/** Total transactions files processed */
	int total;

	/** Number of invalid transactions */
	int invalid;

	/** Number of transactions in progress */
	int in_progress;

	/** Number of broken transactions */
	int broken;

	/** Number of corrupt transactions */
	int corrupt;

	/** Number of transactions successfully reapplied */
	int reapplied;
};

/** jfsck() return values.
 *
 * @see jfsck()
 * @ingroup check
 */
enum jfsck_return {
	/** Success */
	J_ESUCCESS = 0,

	/** No such file or directory */
	J_ENOENT = -1,

	/** No journal associated with the given file */
	J_ENOJOURNAL = -2,

	/** Not enough free memory */



( run in 1.235 second using v1.01-cache-2.11-cpan-bbb979687b5 )