1#ifndef __SERVER_UTIL_H
2#define __SERVER_UTIL_H
3/***************************************************************************
4 *                                  _   _ ____  _
5 *  Project                     ___| | | |  _ \| |
6 *                             / __| | | | |_) | |
7 *                            | (__| |_| |  _ <| |___
8 *                             \___|\___/|_| \_\_____|
9 *
10 * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
11 *
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at http://curl.haxx.se/docs/copyright.html.
15 *
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 ***************************************************************************/
24
25void logmsg(const char *msg, ...);
26
27#define TEST_DATA_PATH "%s/data/test%ld"
28
29#define SERVERLOGS_LOCK "log/serverlogs.lock"
30
31/* global variable, where to find the 'data' dir */
32extern const char *path;
33
34/* global variable, log file name */
35extern const char *serverlogfile;
36
37#ifdef WIN32
38#include <process.h>
39#include <fcntl.h>
40
41#define sleep(sec)   Sleep ((sec)*1000)
42
43#undef perror
44#define perror(m) win32_perror(m)
45void win32_perror (const char *msg);
46#endif  /* WIN32 */
47
48#ifdef USE_WINSOCK
49void win32_init(void);
50void win32_cleanup(void);
51#endif  /* USE_WINSOCK */
52
53/* returns the path name to the test case file */
54char *test2file(long testno);
55
56int wait_ms(int timeout_ms);
57
58int write_pidfile(const char *filename);
59
60void set_advisor_read_lock(const char *filename);
61
62void clear_advisor_read_lock(const char *filename);
63
64#endif  /* __SERVER_UTIL_H */
65