moved here from the newlib branch
[platform/upstream/curl.git] / lib / progress.h
1 #ifndef __PROGRESS_H
2 #define __PROGRESS_H
3 /*****************************************************************************
4  *                                  _   _ ____  _     
5  *  Project                     ___| | | |  _ \| |    
6  *                             / __| | | | |_) | |    
7  *                            | (__| |_| |  _ <| |___ 
8  *                             \___|\___/|_| \_\_____|
9  *
10  *  The contents of this file are subject to the Mozilla Public License
11  *  Version 1.0 (the "License"); you may not use this file except in
12  *  compliance with the License. You may obtain a copy of the License at
13  *  http://www.mozilla.org/MPL/
14  *
15  *  Software distributed under the License is distributed on an "AS IS"
16  *  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
17  *  License for the specific language governing rights and limitations
18  *  under the License.
19  *
20  *  The Original Code is Curl.
21  *
22  *  The Initial Developer of the Original Code is Daniel Stenberg.
23  *
24  *  Portions created by the Initial Developer are Copyright (C) 1998.
25  *  All Rights Reserved.
26  *
27  * ------------------------------------------------------------
28  * Main author:
29  * - Daniel Stenberg <Daniel.Stenberg@haxx.nu>
30  *
31  *      http://curl.haxx.nu
32  *
33  * $Source$
34  * $Revision$
35  * $Date$
36  * $Author$
37  * $State$
38  * $Locker$
39  *
40  * ------------------------------------------------------------
41  ****************************************************************************/
42
43 #include "timeval.h"
44
45
46 typedef enum {
47   TIMER_NONE,
48   TIMER_NAMELOOKUP,
49   TIMER_CONNECT,
50   TIMER_PRETRANSFER,
51   TIMER_POSTRANSFER,
52   TIMER_LAST /* must be last */
53 } timerid;
54   
55 void pgrsDone(struct UrlData *data);
56 void pgrsMode(struct UrlData *data, int mode);
57 void pgrsStartNow(struct UrlData *data);
58 void pgrsSetDownloadSize(struct UrlData *data, double size);
59 void pgrsSetUploadSize(struct UrlData *data, double size);
60 void pgrsSetDownloadCounter(struct UrlData *data, double size);
61 void pgrsSetUploadCounter(struct UrlData *data, double size);
62 int pgrsUpdate(struct UrlData *data);
63 void pgrsTime(struct UrlData *data, timerid timer);
64
65
66 /* Don't show progress for sizes smaller than: */
67 #define LEAST_SIZE_PROGRESS BUFSIZE
68
69 #define PROGRESS_DOWNLOAD (1<<0)
70 #define PROGRESS_UPLOAD   (1<<1)
71 #define PROGRESS_DOWN_AND_UP (PROGRESS_UPLOAD | PROGRESS_DOWNLOAD)
72
73 #define PGRS_SHOW_DL (1<<0)
74 #define PGRS_SHOW_UL (1<<1)
75 #define PGRS_DONE_DL (1<<2)
76 #define PGRS_DONE_UL (1<<3)
77 #define PGRS_HIDE    (1<<4)
78 #define PGRS_UL_SIZE_KNOWN (1<<5)
79 #define PGRS_DL_SIZE_KNOWN (1<<6)
80
81 #define PGRS_HEADERS_OUT (1<<7) /* set when the headers have been written */
82
83
84 #endif /* __PROGRESS_H */