-
Notifications
You must be signed in to change notification settings - Fork 0
/
misc.h
74 lines (48 loc) · 1.92 KB
/
misc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
Copyright (C) 2000 - 2008 Pawel A. Gajda <[email protected]>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2 as
published by the Free Software Foundation (see file COPYING for details).
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef POLDEK_MISC_H
#define POLDEK_MISC_H
#include <stdarg.h>
#include <ctype.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <argp.h>
#include <vfile/p_open.h>
#include <trurl/narray.h>
int bin2hex(char *hex, int hex_size, const unsigned char *bin, int bin_size);
#define DIGEST_SHA1 1
#define DIGEST_MD5 2
#define DIGEST_SIZE_MD5 32
#define DIGEST_SIZE_SHA1 40
int mhexdigest(FILE *stream, unsigned char *mdhex, int *mdhex_size, int type);
/*
Returns $TMPDIR or "/tmp" if $TMPDIR isn't set.
Returned dir always begin with '/'
*/
char *util__setup_cachedir(const char *path);
char *trimslash(char *path);
char *next_token(char **str, char delim, int *toklen);
int util__isdir(const char *path);
int util__mksubdir(const char *path, const char *dn);
int util__mkdir_p(const char *path, const char *dn);
char *util__abs_path(const char *path);
void packages_display_summary(int verbose_l, const char *prefix, tn_array *pkgs,
int parseable);
int snprintf_size(char *buf, int bufsize, unsigned long nbytes,
int ndigits, int longunit);
tn_array *lc_lang_select(tn_array *avlangs, const char *lc_lang);
char *poldek__conf_path(char *s, char *v);
int poldek__is_in_testing_mode(void);
#include "poldek_util.h"
const char *lc_messages_lang(void);
void *timethis_begin(void);
void timethis_end(int verbose_level, void *tvp, const char *prefix);
#endif /* POLDEK_MISC_H */