include curl.h for the typedef
[platform/upstream/curl.git] / lib / strtoofft.h
1 /***************************************************************************
2  *                                  _   _ ____  _     
3  *  Project                     ___| | | |  _ \| |    
4  *                             / __| | | | |_) | |    
5  *                            | (__| |_| |  _ <| |___ 
6  *                             \___|\___/|_| \_\_____|
7  *
8  * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
9  *
10  * This software is licensed as described in the file COPYING, which
11  * you should have received as part of this distribution. The terms
12  * are also available at http://curl.haxx.se/docs/copyright.html.
13  * 
14  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15  * copies of the Software, and permit persons to whom the Software is
16  * furnished to do so, under the terms of the COPYING file.
17  *
18  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19  * KIND, either express or implied.
20  *
21  * $Id$
22  ***************************************************************************/
23
24 #ifndef _CURL_STRTOOFFT_R_H
25 #define _CURL_STRTOOFFT_R_H
26
27 #include "setup.h"
28 #include <stddef.h>
29 #include <curl/curl.h> /* for the curl_off_t type */
30
31 /* Determine what type of file offset conversion handling we wish to use.  For
32  * systems with a 32-bit curl_off_t type, we should use strtol.  For systems
33  * with a 64-bit curl_off_t type, we should use strtoll if it exists, and if
34  * not, should try to emulate its functionality.  At any rate, we define
35  * 'strtoofft' such that it can be used to work with curl_off_t's regardless.
36  */
37 #if SIZEOF_CURL_OFF_T > 4
38 #if HAVE_STRTOLL
39 #define strtoofft strtoll
40 #else
41 curl_off_t Curl_strtoll(const char *nptr, char **endptr, int base);
42 #define strtoofft Curl_strtoll
43 #define NEED_CURL_STRTOLL
44 #endif
45 #else
46 #define strtoofft strtol
47 #endif
48
49 #endif
50