2002-03-26 14:46:43 +00:00
|
|
|
#define _GNU_SOURCE
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/wait.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
2002-03-26 22:25:14 +00:00
|
|
|
#include <utime.h>
|
2002-03-26 14:46:43 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#define STATUS_NOTFOUND 3
|
|
|
|
#define STATUS_FATAL 4
|
|
|
|
#define STATUS_NOCACHE 5
|
|
|
|
|
2002-03-26 23:58:31 +00:00
|
|
|
#define MAX_LINE_SIZE 102400
|
2002-03-26 14:46:43 +00:00
|
|
|
|
|
|
|
typedef unsigned uint32;
|
|
|
|
|
|
|
|
#include "mdfour.h"
|
|
|
|
|
|
|
|
void hash_start(void);
|
|
|
|
void hash_string(const char *s);
|
2002-03-26 22:25:14 +00:00
|
|
|
void hash_int(int x);
|
2002-03-26 14:46:43 +00:00
|
|
|
void hash_file(const char *fname);
|
|
|
|
char *hash_result(void);
|
|
|
|
|
2002-03-26 23:58:31 +00:00
|
|
|
void cc_log(const char *format, ...);
|
2002-03-26 14:46:43 +00:00
|
|
|
void fatal(const char *msg);
|
|
|
|
|
|
|
|
void copy_fd(int fd_in, int fd_out);
|
2002-03-27 05:40:28 +00:00
|
|
|
int copy_file(const char *src, const char *dest);
|
2002-03-26 14:46:43 +00:00
|
|
|
|
2002-03-26 22:25:14 +00:00
|
|
|
int create_dir(const char *dir);
|
2002-03-27 02:17:02 +00:00
|
|
|
void x_asprintf(char **ptr, const char *format, ...);
|
2002-03-27 01:38:55 +00:00
|
|
|
char *x_strdup(const char *s);
|
2002-03-26 22:25:14 +00:00
|
|
|
|
2002-03-27 00:39:06 +00:00
|
|
|
int execute(char **argv,
|
|
|
|
const char *path_stdout,
|
|
|
|
const char *path_stderr);
|
2002-03-26 14:46:43 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char **argv;
|
|
|
|
int argc;
|
|
|
|
} ARGS;
|
|
|
|
|
|
|
|
|
|
|
|
ARGS *args_init(void);
|
|
|
|
void args_add(ARGS *args, const char *s);
|