Annotation of embedaddon/curl/tests/server/util.h, revision 1.1.1.1

1.1       misho       1: #ifndef HEADER_CURL_SERVER_UTIL_H
                      2: #define HEADER_CURL_SERVER_UTIL_H
                      3: /***************************************************************************
                      4:  *                                  _   _ ____  _
                      5:  *  Project                     ___| | | |  _ \| |
                      6:  *                             / __| | | | |_) | |
                      7:  *                            | (__| |_| |  _ <| |___
                      8:  *                             \___|\___/|_| \_\_____|
                      9:  *
                     10:  * Copyright (C) 1998 - 2020, 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 https://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: #include "server_setup.h"
                     25: 
                     26: char *data_to_hex(char *data, size_t len);
                     27: void logmsg(const char *msg, ...);
                     28: long timediff(struct timeval newer, struct timeval older);
                     29: 
                     30: #define TEST_DATA_PATH "%s/data/test%ld"
                     31: #define ALTTEST_DATA_PATH "%s/log/test%ld"
                     32: 
                     33: #define SERVERLOGS_LOCK "log/serverlogs.lock"
                     34: 
                     35: /* global variable, where to find the 'data' dir */
                     36: extern const char *path;
                     37: 
                     38: /* global variable, log file name */
                     39: extern const char *serverlogfile;
                     40: 
                     41: #if defined(WIN32) || defined(_WIN32)
                     42: #include <process.h>
                     43: #include <fcntl.h>
                     44: 
                     45: #define sleep(sec) Sleep ((sec)*1000)
                     46: 
                     47: #undef perror
                     48: #define perror(m) win32_perror(m)
                     49: void win32_perror(const char *msg);
                     50: #endif  /* WIN32 or _WIN32 */
                     51: 
                     52: #ifdef USE_WINSOCK
                     53: void win32_init(void);
                     54: void win32_cleanup(void);
                     55: #endif  /* USE_WINSOCK */
                     56: 
                     57: /* fopens the test case file */
                     58: FILE *test2fopen(long testno);
                     59: 
                     60: int wait_ms(int timeout_ms);
                     61: int write_pidfile(const char *filename);
                     62: int write_portfile(const char *filename, int port);
                     63: void set_advisor_read_lock(const char *filename);
                     64: void clear_advisor_read_lock(const char *filename);
                     65: int strncasecompare(const char *first, const char *second, size_t max);
                     66: 
                     67: /* global variable which if set indicates that the program should finish */
                     68: extern volatile int got_exit_signal;
                     69: 
                     70: /* global variable which if set indicates the first signal handled */
                     71: extern volatile int exit_signal;
                     72: 
                     73: void install_signal_handlers(bool keep_sigalrm);
                     74: void restore_signal_handlers(bool keep_sigalrm);
                     75: 
                     76: #endif  /* HEADER_CURL_SERVER_UTIL_H */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>