1 /*---------------------------------------------------------------------------*
2   Project:  Revolution NHTTP library
3   File:     NHTTPStartup.h
4 
5   Copyright (C) 2008 Nintendo All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12  *---------------------------------------------------------------------------*/
13 
14 #ifndef __NHTTP_STARTUP_H__
15 #define __NHTTP_STARTUP_H__
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /*---------------------------------------------------------------------------*
22  * Includes
23  *---------------------------------------------------------------------------*/
24 #if defined(RVL_OS)
25 #include <revolution.h>
26 #endif  // RVL_OS
27 
28 /*---------------------------------------------------------------------------*
29  * Types/Declarations
30  *---------------------------------------------------------------------------*/
31 typedef enum {
32     NHTTP_ERROR_SYSTEM = -1,
33 
34     NHTTP_ERROR_NONE = 0,       // 0
35     NHTTP_ERROR_ALLOC,          // 1
36     NHTTP_ERROR_TOOMANYREQ,     // 2
37     NHTTP_ERROR_SOCKET,         // 3
38     NHTTP_ERROR_DNS,            // 4
39     NHTTP_ERROR_CONNECT,        // 5
40     NHTTP_ERROR_BUFFULL,        // 6
41     NHTTP_ERROR_HTTPPARSE,      // 7
42     NHTTP_ERROR_CANCELED,       // 8
43     NHTTP_ERROR_REVOLUTIONSDK,  // 9
44     NHTTP_ERROR_REVOLUTIONWIFI, // 10
45     NHTTP_ERROR_UNKNOWN,        // 11
46     NHTTP_ERROR_DNS_PROXY,      // 12
47     NHTTP_ERROR_CONNECT_PROXY,  // 13
48     NHTTP_ERROR_SSL,            // 14
49     NHTTP_ERROR_BUSY,           // 15
50     NHTTP_ERROR_SSL_ROOTCA,     // 16
51     NHTTP_ERROR_SSL_CLIENTCERT, // 17
52 
53     NHTTP_ERROR_MAX
54 } NHTTPError;
55 
56 typedef void* (*NHTTPAlloc)          ( u32 size, int align );
57 typedef void  (*NHTTPFree)           ( void* ptr );
58 typedef void  (*NHTTPCleanupCallback)( void );
59 
60 /*---------------------------------------------------------------------------*
61  * Function Prototypes
62  *---------------------------------------------------------------------------*/
63 extern int                      NHTTPStartup              ( NHTTPAlloc alloc, NHTTPFree free, u32 threadprio );
64 extern void                     NHTTPCleanupAsync         ( NHTTPCleanupCallback callback );
65 extern NHTTPError               NHTTPGetError             ( void );
66 
67 
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif  // __NHTTP_STARTUP_H__
74