#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
#include "rdd.h"
#include "rdd_internals.h"
#include "alignedbuf.h"
#include "reader.h"
Go to the source code of this file.
Data Structures | |
struct | _RDD_ALIGNED_READER |
Defines | |
#define | MOD_ALIGN(r, n) ((n) % ((r)->align)) |
Typedefs | |
typedef struct _RDD_ALIGNED_READER | RDD_ALIGNED_READER |
Functions | |
static int | rdd_aligned_close (RDD_READER *r, int recurse) |
static int | rdd_aligned_read (RDD_READER *r, unsigned char *buf, unsigned nbyte, unsigned *nread) |
static int | rdd_aligned_seek (RDD_READER *r, rdd_count_t pos) |
static int | rdd_aligned_tell (RDD_READER *r, rdd_count_t *pos) |
int | rdd_open_aligned_reader (RDD_READER **self, RDD_READER *parent, unsigned align) |
Instantiates a reader that reads from a reader that expects aligned accesses and aligned user buffers. | |
Variables | |
static RDD_READ_OPS | aligned_read_ops |
static char | copyright [] |
#define MOD_ALIGN | ( | r, | |||
n | ) | ((n) % ((r)->align)) |
Definition at line 55 of file alignedreader.c.
typedef struct _RDD_ALIGNED_READER RDD_ALIGNED_READER |
static int rdd_aligned_close | ( | RDD_READER * | r, | |
int | recurse | |||
) | [static] |
Definition at line 239 of file alignedreader.c.
References _RDD_ALIGNED_READER::parent, RDD_OK, and rdd_reader_close().
static int rdd_aligned_read | ( | RDD_READER * | r, | |
unsigned char * | buf, | |||
unsigned | nbyte, | |||
unsigned * | nread | |||
) | [static] |
Definition at line 99 of file alignedreader.c.
References _RDD_ALIGNED_READER::align, RDD_ALIGNEDBUF::aligned, bug(), error(), MOD_ALIGN, _RDD_ALIGNED_READER::parent, rdd_aligned_seek(), rdd_aligned_tell(), RDD_BADARG, RDD_EAGAIN, RDD_EREAD, RDD_ESEEK, rdd_free_alignedbuf(), rdd_new_alignedbuf(), RDD_OK, rdd_reader_read(), and RDD_SECTOR_SIZE.
static int rdd_aligned_seek | ( | RDD_READER * | r, | |
rdd_count_t | pos | |||
) | [static] |
Definition at line 231 of file alignedreader.c.
References _RDD_ALIGNED_READER::parent, and rdd_reader_seek().
static int rdd_aligned_tell | ( | RDD_READER * | r, | |
rdd_count_t * | pos | |||
) | [static] |
Definition at line 223 of file alignedreader.c.
References _RDD_ALIGNED_READER::parent, and rdd_reader_tell().
int rdd_open_aligned_reader | ( | RDD_READER ** | r, | |
RDD_READER * | parent, | |||
unsigned | align | |||
) |
Instantiates a reader that reads from a reader that expects aligned accesses and aligned user buffers.
r | output value: a new reader object. | |
parent | output value: the parent reader. | |
align | alignment in bytes. |
RDD_OK
on success.Definition at line 79 of file alignedreader.c.
References _RDD_ALIGNED_READER::align, _RDD_ALIGNED_READER::parent, rdd_new_reader(), RDD_OK, and _RDD_READER::state.
RDD_READ_OPS aligned_read_ops [static] |
Initial value:
Definition at line 71 of file alignedreader.c.
char copyright[] [static] |
Initial value:
"@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"
Definition at line 34 of file alignedreader.c.