Improved the images for stock increase/decrease.
[stockwidget] / stockgetter.h
1 #ifndef _STOCKGETTER_H_
2 #define _STOCKGETTER_H_
3
4 #include <curl/curl.h>
5
6 #define SG_OK                                   +1
7 #define SG_INVALID_PARAMS               -1
8 #define SG_LOOKUP_FAILURE               -2
9 #define SG_BAD_ALLOC                    -3
10
11 typedef struct _StockBuffer
12 {
13         int nCurr;
14         int nCount;
15         char *pszBuffer;
16 } StockBuffer;
17
18 typedef struct _SGHandle
19 {
20         CURL *hCurlHandle;
21         StockBuffer sData;
22 } *SGHandle;
23
24 /* API */
25
26 SGHandle
27 InitStockGetter(void);
28
29 int
30 RetrieveStockPrice(SGHandle              hSG,
31                                    char                 *szTicker,
32                                    float                *pfValue,
33                                    float                *pfChangeReal,
34                                    float                *pfChangePercent);
35
36 int
37 FreeStockGetter(SGHandle hSG);
38
39 #endif/*_STOCKGETTER_H_*/