sfunc.h revision d18ffdd88be3c62d027fd49a115bc9c4fe4b910c
1/*
2* Disktest
3* Copyright (c) International Business Machines Corp., 2001
4*
5*
6* This program is free software; you can redistribute it and/or modify
7* it under the terms of the GNU General Public License as published by
8* the Free Software Foundation; either version 2 of the License, or
9* (at your option) any later version.
10*
11* This program is distributed in the hope that it will be useful,
12* but WITHOUT ANY WARRANTY; without even the implied warranty of
13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14* GNU General Public License for more details.
15*
16* You should have received a copy of the GNU General Public License
17* along with this program; if not, write to the Free Software
18* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19*
20*  Please send e-mail to yardleyb@us.ibm.com if you have
21*  questions or comments.
22*
23*  Project Website:  TBD
24*
25*
26* $Id: sfunc.h,v 1.4 2005/05/04 17:54:00 mridge Exp $
27* $Log: sfunc.h,v $
28* Revision 1.4  2005/05/04 17:54:00  mridge
29* Update to version 1.2.8
30*
31* Revision 1.12  2005/05/03 16:24:38  yardleyb
32* Added needed code changes to support windows
33*
34* Revision 1.11  2005/01/08 21:18:34  yardleyb
35* Update performance output and usage.  Fixed pass count check
36*
37* Revision 1.10  2004/11/02 20:47:13  yardleyb
38* Added -F functions.
39* lots of minor fixes. see README
40*
41* Revision 1.9  2002/03/30 01:32:14  yardleyb
42* Major Changes:
43*
44* Added Dumping routines for
45* data miscompares,
46*
47* Updated performance output
48* based on command line.  Gave
49* one decimal in MB/s output.
50*
51* Rewrote -pL IO routine to show
52* correct stats.  Now show pass count
53* when using -C.
54*
55* Minor Changes:
56*
57* Code cleanup to remove the plethera
58* if #ifdef for windows/unix functional
59* differences.
60*
61* Revision 1.8  2002/02/28 02:04:32  yardleyb
62* Moved FileSeek64 to IO
63* source files.
64*
65* Revision 1.7  2002/02/19 02:46:37  yardleyb
66* Added changes to compile for AIX.
67* Update getvsiz so it returns a -1
68* if the ioctl fails and we handle
69* that fact correctly.  Added check
70* to force vsiz to always be greater
71* then stop_lba.
72*
73* Revision 1.6  2001/12/04 18:51:06  yardleyb
74* Checkin of new source files and removal
75* of outdated source
76*
77* Revision 1.4  2001/10/10 00:17:14  yardleyb
78* Added Copyright and GPL license text.
79* Miner bug fixes throughout text.
80*
81* Revision 1.3  2001/09/22 03:44:25  yardleyb
82* Added level code pMsg.
83*
84* Revision 1.2  2001/09/06 18:23:30  yardleyb
85* Added duty cycle -D.  Updated usage. Added
86* make option to create .tar.gz of all files
87*
88* Revision 1.1  2001/09/05 22:44:42  yardleyb
89* Split out some of the special functions.
90* added O_DIRECT -Id.  Updated usage.  Lots
91* of clean up to functions.  Added header info
92* to pMsg.
93*
94*
95*/
96
97#ifndef _SFUNC_H
98#define _SFUNC_H 1
99
100#include <stdarg.h>
101
102#include "main.h"
103#include "defs.h"
104
105#define MARK_FIRST	1
106#define MARK_LAST	2
107#define MARK_ALL	3
108
109typedef enum lvl {
110	START, END, STAT, INFO, DEBUG, WARN, ERR
111} lvl_t;
112
113typedef struct fmt_time {
114	time_t days;
115	time_t hours;
116	time_t minutes;
117	time_t seconds;
118} fmt_time_t;
119
120OFF_T my_strtofft(const char *pStr);
121int pMsg(lvl_t level, child_args_t *, char *Msg,...);
122void fill_buffer(void *, size_t, void *, size_t, const unsigned int);
123void mark_buffer(void *, const size_t, void *, const OFF_T, const unsigned short);
124void normalize_percs(child_args_t *);
125#ifndef WINDOWS
126void Sleep(unsigned int);
127char *strupr(char *);
128char *strlwr(char *);
129#endif
130OFF_T get_vsiz(const char *);
131OFF_T get_file_size(char *);
132OFF_T Rand64(void);
133fmt_time_t format_time(time_t);
134
135#endif /* _SFUNC_H */
136
137