#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <time.h>
#include <signal.h>
#include "rdd.h"
#include "rdd_internals.h"
#include "error.h"
Go to the source code of this file.
Defines | |
#define | bitcount(t) (sizeof(t) * CHAR_BIT) |
#define | MAX_SIZE_BUF_LEN 64 |
#define | TIME_BUF_SIZE 64 |
#define | TIME_FORMAT "%Y-%m-%d %H:%M:%S %Z" |
Functions | |
static void | check_type_sizes (void) |
int | rdd_buf2hex (const unsigned char *buf, unsigned bufsize, char *hexbuf, unsigned hexbuflen) |
void | rdd_catch_signals (void) |
char * | rdd_ctime (void) |
int | rdd_device_size (const char *path, rdd_count_t *size) |
void | rdd_free (void *p) |
double | rdd_gettime (void) |
void | rdd_init (void) |
void * | rdd_malloc (size_t nbyte) |
char * | rdd_strsize (rdd_count_t size) |
static void | set_signal_handler (int signum, void(*handler)(int sig)) |
static void | signal_exit (int signum) |
int | timeUnits (double timeInSecs, int *secs, int *mins, int *hours, int *days) |
Variables | |
static char | copyright [] |
#define bitcount | ( | t | ) | (sizeof(t) * CHAR_BIT) |
Definition at line 67 of file rdd_internals.c.
#define MAX_SIZE_BUF_LEN 64 |
Definition at line 63 of file rdd_internals.c.
#define TIME_BUF_SIZE 64 |
Definition at line 64 of file rdd_internals.c.
#define TIME_FORMAT "%Y-%m-%d %H:%M:%S %Z" |
Definition at line 65 of file rdd_internals.c.
static void check_type_sizes | ( | void | ) | [static] |
Definition at line 72 of file rdd_internals.c.
References bitcount, and error().
int rdd_buf2hex | ( | const unsigned char * | buf, | |
unsigned | bufsize, | |||
char * | hexbuf, | |||
unsigned | hexbuflen | |||
) |
void rdd_catch_signals | ( | void | ) |
Definition at line 226 of file rdd_internals.c.
References set_signal_handler(), and signal_exit().
char* rdd_ctime | ( | void | ) |
Definition at line 144 of file rdd_internals.c.
References error(), TIME_BUF_SIZE, TIME_FORMAT, and unix_error().
int rdd_device_size | ( | const char * | path, | |
rdd_count_t * | size | |||
) |
Definition at line 251 of file rdd_internals.c.
References RDD_EOPEN, RDD_ESEEK, RDD_OK, and RDD_WHOLE_FILE.
void rdd_free | ( | void * | p | ) |
Definition at line 115 of file rdd_internals.c.
double rdd_gettime | ( | void | ) |
Definition at line 167 of file rdd_internals.c.
References unix_error().
void rdd_init | ( | void | ) |
Definition at line 95 of file rdd_internals.c.
References check_type_sizes().
void* rdd_malloc | ( | size_t | nbyte | ) |
Allocates memory and clears it.
Definition at line 103 of file rdd_internals.c.
References error().
char* rdd_strsize | ( | rdd_count_t | size | ) |
Definition at line 179 of file rdd_internals.c.
References bug(), MAX_SIZE_BUF_LEN, and RDD_WHOLE_FILE.
static void set_signal_handler | ( | int | signum, | |
void(*)(int sig) | handler | |||
) | [static] |
Definition at line 212 of file rdd_internals.c.
References unix_error().
static void signal_exit | ( | int | signum | ) | [static] |
Definition at line 198 of file rdd_internals.c.
int timeUnits | ( | double | timeInSecs, | |
int * | secs, | |||
int * | mins, | |||
int * | hours, | |||
int * | days | |||
) |
char copyright[] [static] |
Initial value:
"@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"
Definition at line 39 of file rdd_internals.c.