File: hoz.h

package info (click to toggle)
hoz 1.65-3
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 444 kB
  • sloc: ansic: 4,299; makefile: 148; sh: 48
file content (106 lines) | stat: -rwxr-xr-x 5,196 bytes parent folder | download
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
 * hoz - Hacha Open Zource
 * Copyright (C) 2004 Gustavo Picon (http://hoz.sourceforge.net/)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

                         /* #define HOZ_WIN *//* uncomment to compile for ms windows (GUI  mode) */
/* #define HOZ_GTK */
/* language: Makefile will take care of these */
                             /* #define HOZ_LANG_EN *//* english */
                             /* #define HOZ_LANG_ES *//* espa´┐Żol */
                             /* #define HOZ_LANG_FR *//* fran´┐Żaise */
#define HOZ_PROGRAM         "HOZ"
#define HOZ_VERSION         "1.65"
#define HOZ_URL             "http://hoz.sourceforge.net/"
#define HOZ_CRAUTH          "Copyright (c) 2004 Gustavo Picon"
#define HOZ_PROGNAME        HOZ_PROGRAM " " HOZ_VERSION
#define HOZ_COPYRIGHT1      HOZ_PROGNAME "  " HOZ_CRAUTH        /* "   " __DATE__ */
#define HOZ_COPYRIGHT2      "         " HOZ_URL
#define PROGRMETERSTR       " -"

#define MAXLEN 1024             /* max length of a pathname */
#define FILESTREAMSIZE 4096     /* < 4096 */
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>

#include <libintl.h>
#define _(String) gettext (String)

#define HOZ_REPLACE_C       _("Output file '%s' exists, replace? (Y/N) ")
#define HOZ_BADARGSOPT      _("%s: You must specify one of the '-cph' options")
#define HOZ_BADARGSFILE     _("%s: Missing file argument")
#define HOZ_HMOREINFO       _("Try '%s --help' for more information.")
#define HOZ_USAGE_1         _("%s [-pvf] [-c size[K|M]] [-o outpath] inputfname")
#define HOZ_USAGE_2         _("Options:")
#define HOZ_USAGE_3         _("    -c   --cut         cut (file->pieces)")
#define HOZ_USAGE_4         _("    -p   --paste       paste (pieces->file)")
#define HOZ_USAGE_5         _("    -v   --verbose     verbose output")
#define HOZ_USAGE_6         _("    -f   --force       force overwrite of file when pasting")
#define HOZ_USAGE_7         _("    -o   --outpath     specify an output directory")
#define HOZ_USAGE_8         _("    -h   --help        print this help, then exit")
#define HOZ_USAGE_9         _("         --version     print hoz program version number, then exit")
#define HOZ_ENDDOTO         _("ERROR: The file must end with a '.0' extension")
#define HOZ_NOFILE          _("ERROR: File not found: %s")
#define HOZ_BADHEADER       _("ERROR: Corrupted file header: %s")
#define HOZ_BADPARTS        _("ERROR: Corrupted .??? files, final_size/real_size: %s")
#define HOZ_ERROPENWRITE    _("ERROR: Cannot open file for writing: %s")
#define HOZ_ERROPENREAD     _("ERROR: Cannot open file for reading: %s")
#define HOZ_ERRPARTSIZE     _("ERROR: Invalid partial size: %s")
#define HOZ_ERRPROCESS      _("ERROR: Operation failed total_files/file_size: %s")
#define HOZ_ERROUTNODIR     _("ERROR: Output path isn't a directory: '%s'")
#define HOZ_ERRWRITE        _("ERROR: Couldn't write to file: '%s'")
#define HOZ_CUTTOFILE       _("* Cutting to file \"%s\": ")
#define HOZ_PROGRESS        _("* Progress: %u of %u bytes (%.2f%%)")
#define HOZ_CUTEND          _("*** Processed file: %s (%u bytes) in %.3f seconds (%u bytes/s) [output path='%s']")
#define HOZ_BEGINPASTE      _("*** Extracting file: \"%s\" (%u bytes)")
#define HOZ_PASTEFILE       _("* Extracting \"%s\": ")
#define HOZ_PASTEMISSING    _("ERROR: Missing file in paste operation: '%s'")
#define HOZ_PASTEEND        _("*** Extracted file: %s (%u bytes) in %.3f seconds (%u bytes/s) [output path='%s']")
#define HOZ_REPLACE_W       _("File '%s' exists, replace?")
#define HOZ_BADSIZE         _("ERROR: Invalid size: '%s'")
#define HOZ_FDPASTE         _("Hoz/Hacha file to paste")
#define HOZ_FDCUT           _("File to cut")
#define HOZ_READY           _("* Ready!")
#define HOZ_PSIZECAPTION    _("Partial size:")
#define HOZ_OUTPCAPTION     _("Output path:")
#define HOZ_CBPRGRCAPTION   _("Show Progress")
#define HOZ_BTNCUTCAPTION   _("Cut")
#define HOZ_BTNPASTECAPTION _("Paste")
#define HOZ_YESCHARS        _("yY")
#define HOZ_NOCHARS         _("nN")

void hoz_print(const char *);
void hoz_lf();

void hoz_echo(const int, const char *);
int hoz_cut_main(const char *);
int hoz_paste_main(const char *);
int hoz_paste_hr(const char *, const char *);
size_t fsize(const char *);
int isfile(const char *);
int isdir(const char *);
const char *hoz_nopath(const char *);
int hoz_replace_ask(const char *);
int mergepath(const char *, const char *, char *);
int atolp(const char *);
int atolmp(const char*, const int);