forked from tburette/randtype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
randtype.h
60 lines (52 loc) · 1.69 KB
/
randtype.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
/* Copyright (C) 1999-2001 bjk <[email protected]>
*
* 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
*/
/* Set some defaults. */
#ifndef DEF_MS
#define DEF_MS 18
#endif
#ifndef DEF_MULT
#define DEF_MULT 20000
#endif
#ifndef LINE_MAX
#define LINE_MAX 2048
#endif
#ifndef NAME_MAX
#define NAME_MAX 255
#endif
#define VERSION "randtype 1.13"
#define COPYRIGHT "Copyright (C) 1999-2001 bjk <[email protected]>"
typedef struct replaces {
char *find;
char *replace;
struct replaces *next;
} REPLACE;
/* External variables. */
REPLACE *replace;
float tms, cms;
int err;
unsigned int tmult, cmult;
unsigned int dolines, mistakes, dir;
char _nowait[137], _wait[137];
char dumpstr[64];
/* Function prototypes. */
static void usage(const char *me);
static int randtype(char *str);
static int splitter(const char *filename, int kill);
static char chk_special(const char *str, const char c);
static int time_split(const char *str, float *ms, unsigned int *mult);
static void randsleep(float ms, unsigned int mult);
static void catch_signal(int signal);