2001-12-29 12:03:18 +00:00
|
|
|
#ifndef UTIL_H
|
|
|
|
#define UTIL_H
|
|
|
|
|
2002-01-08 13:56:50 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include <config.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_GETOPT_H
|
|
|
|
#include <getopt.h>
|
|
|
|
#endif
|
2001-12-29 12:03:18 +00:00
|
|
|
#include <stdio.h>
|
2002-01-08 13:56:50 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <errno.h>
|
2001-12-29 12:03:18 +00:00
|
|
|
#include <opensc.h>
|
|
|
|
|
2002-01-08 13:56:50 +00:00
|
|
|
extern const struct option options[];
|
|
|
|
extern const char *option_help[];
|
2002-03-24 14:12:38 +00:00
|
|
|
extern const char *app_name;
|
2002-01-08 13:56:50 +00:00
|
|
|
|
2001-12-29 12:03:18 +00:00
|
|
|
void print_binary(FILE *f, const u8 *buf, int count);
|
2002-01-24 16:02:54 +00:00
|
|
|
void hex_dump(FILE *f, const u8 *in, int len, const char *sep);
|
2002-01-09 01:03:10 +00:00
|
|
|
void hex_dump_asc(FILE *f, const u8 *in, size_t count, int addr);
|
2002-03-24 14:12:38 +00:00
|
|
|
void print_usage_and_die();
|
2002-02-20 09:56:47 +00:00
|
|
|
const char * acl_to_str(const struct sc_acl_entry *e);
|
2002-02-21 18:53:23 +00:00
|
|
|
void warn(const char *fmt, ...);
|
|
|
|
void error(const char *fmt, ...);
|
|
|
|
void fatal(const char *fmt, ...);
|
2001-12-29 12:03:18 +00:00
|
|
|
|
|
|
|
#endif
|