libbtc
bitcoinclibrary
btc.h
Go to the documentation of this file.
1 /*
2 
3  The MIT License (MIT)
4 
5  Copyright (c) 2015 Jonas Schnelli
6 
7  Permission is hereby granted, free of charge, to any person obtaining
8  a copy of this software and associated documentation files (the "Software"),
9  to deal in the Software without restriction, including without limitation
10  the rights to use, copy, modify, merge, publish, distribute, sublicense,
11  and/or sell copies of the Software, and to permit persons to whom the
12  Software is furnished to do so, subject to the following conditions:
13 
14  The above copyright notice and this permission notice shall be included
15  in all copies or substantial portions of the Software.
16 
17  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
21  OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23  OTHER DEALINGS IN THE SOFTWARE.
24 
25 */
26 
27 #ifndef _LIBBTC_H_
28 #define _LIBBTC_H_
29 
30 #include <stdio.h>
31 #include <limits.h>
32 #include <stdint.h>
33 
34 typedef uint8_t btc_bool;
35 
36 #ifndef true
37 #define true 1
38 #endif
39 
40 #ifndef false
41 #define false 0
42 #endif
43 
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 #ifndef LIBBTC_API
50 #if defined(_WIN32)
51 #ifdef LIBBTC_BUILD
52 #define LIBBTC_API __declspec(dllexport)
53 #else
54 #define LIBBTC_API
55 #endif
56 #elif defined(__GNUC__) && defined(LIBBTC_BUILD)
57 #define LIBBTC_API __attribute__((visibility("default")))
58 #else
59 #define LIBBTC_API
60 #endif
61 #endif
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #define BTC_ECKEY_UNCOMPRESSED_LENGTH 65
68 #define BTC_ECKEY_COMPRESSED_LENGTH 33
69 #define BTC_ECKEY_PKEY_LENGTH 32
70 #define BTC_ECKEY_PKEY_LENGTH 32
71 #define BTC_HASH_LENGTH 32
72 
73 #endif //_LIBBTC_H_
uint8_t btc_bool
Definition: btc.h:34