Deduplicate cJSON: consolidate 4 copies into a single canonical pair
- Compile cJSON.c as a standalone C translation unit (added stdbool.h) - Rename hush_cJSON.c → hush_cJSON.cpp and compile as standalone C++ unit with forward declarations for external deps (_stripwhite, clonestr, etc.) - Remove #include "cJSON.c" unity-build from hush_cJSON - Change hush.h from #include "hush_cJSON.c" to #include "hush_cJSON.h" - Add both files to libbitcoin_server_a_SOURCES in Makefile.am - Delete cc/dapps/cJSON.c (old 2009 fork, 1201 lines removed) - Replace cc/includes/cJSON.h with thin redirect to canonical headers - Update dapp includes to reference canonical cJSON.c
This commit is contained in:
@@ -83,14 +83,14 @@ There are **13,652 lines** of implementation code in `hush_*.h` headers:
|
|||||||
|
|
||||||
## 6. Deduplicate Vendored Code
|
## 6. Deduplicate Vendored Code
|
||||||
|
|
||||||
`cJSON` exists in **4 copies**:
|
`cJSON` has been consolidated:
|
||||||
|
|
||||||
- `src/cJSON.c` + `src/cJSON.h`
|
- `src/cJSON.c` + `src/cJSON.h` — canonical implementation, compiled as a standalone C translation unit
|
||||||
- `src/hush_cJSON.c` + `src/hush_cJSON.h`
|
- `src/hush_cJSON.cpp` + `src/hush_cJSON.h` — helper/wrapper functions, compiled as a standalone C++ translation unit
|
||||||
- `src/cc/dapps/cJSON.c`
|
- `src/cc/includes/cJSON.h` — thin redirect to the canonical headers above
|
||||||
- `src/cc/includes/cJSON.h`
|
- `src/cc/dapps/cJSON.c` — deleted (old 2009 fork); dapp includes updated to use canonical copy
|
||||||
|
|
||||||
- [ ] Consolidate to a single copy and have other modules link against it
|
- [x] Consolidate to a single copy and have other modules link against it
|
||||||
|
|
||||||
## 7. Relocate Shell Scripts Out of `src/`
|
## 7. Relocate Shell Scripts Out of `src/`
|
||||||
|
|
||||||
|
|||||||
@@ -278,6 +278,8 @@ libbitcoin_server_a_SOURCES = \
|
|||||||
i2p.cpp \
|
i2p.cpp \
|
||||||
init.cpp \
|
init.cpp \
|
||||||
dbwrapper.cpp \
|
dbwrapper.cpp \
|
||||||
|
cJSON.c \
|
||||||
|
hush_cJSON.cpp \
|
||||||
hush_impl.cpp \
|
hush_impl.cpp \
|
||||||
hush_nSPV_impl.cpp \
|
hush_nSPV_impl.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#pragma GCC visibility pop
|
#pragma GCC visibility pop
|
||||||
|
|||||||
1201
src/cc/dapps/cJSON.c
1201
src/cc/dapps/cJSON.c
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
#include "cJSON.c"
|
#include "../../cJSON.c"
|
||||||
|
|
||||||
bits256 zeroid;
|
bits256 zeroid;
|
||||||
|
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ int32_t safecopy(char *dest,char *src,long len)
|
|||||||
//#ifdef STANDALONE
|
//#ifdef STANDALONE
|
||||||
//#include "../hush3/src/hush_cJSON.c"
|
//#include "../hush3/src/hush_cJSON.c"
|
||||||
//#else
|
//#else
|
||||||
#include "../hush_cJSON.c"
|
#include "../../hush_cJSON.cpp"
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
int32_t games_replay(uint64_t seed,int32_t sleeptime);
|
int32_t games_replay(uint64_t seed,int32_t sleeptime);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
#include "cJSON.c"
|
#include "../../cJSON.c"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
NOTE: HUSH nor any Hush Arrakis Chain has any sprout outputs. This code is kept for historical and educational purposes.
|
NOTE: HUSH nor any Hush Arrakis Chain has any sprout outputs. This code is kept for historical and educational purposes.
|
||||||
|
|||||||
@@ -1,255 +1,19 @@
|
|||||||
// Copyright (c) 2016-2024 The Hush developers
|
// Copyright (c) 2016-2024 The Hush developers
|
||||||
// Distributed under the GPLv3 software license, see the accompanying
|
// Distributed under the GPLv3 software license, see the accompanying
|
||||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||||
/*
|
//
|
||||||
Copyright (c) 2009 Dave Gamble
|
// This header now redirects to the canonical cJSON at src/cJSON.h + src/hush_cJSON.h.
|
||||||
|
// The old duplicate (2009 Dave Gamble fork) has been removed as part of cJSON deduplication.
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
//
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* Copyright © 2014-2019 The SuperNET Developers. *
|
|
||||||
* *
|
|
||||||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at *
|
|
||||||
* the top-level directory of this distribution for the individual copyright *
|
|
||||||
* holder information and the developer policies on copyright and licensing. *
|
|
||||||
* *
|
|
||||||
* Unless otherwise agreed in a custom licensing agreement, no part of the *
|
|
||||||
* SuperNET software, including this file may be copied, modified, propagated *
|
|
||||||
* or distributed except according to the terms contained in the LICENSE file *
|
|
||||||
* *
|
|
||||||
* Removal or modification of this copyright notice is prohibited. *
|
|
||||||
* *
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
#ifndef cJSON__ccih
|
#ifndef cJSON__ccih
|
||||||
#define cJSON__ccih
|
#define cJSON__ccih
|
||||||
|
|
||||||
#include <stdio.h>
|
#include "../../cJSON.h"
|
||||||
#include <stdlib.h>
|
#include "../../hush_cJSON.h"
|
||||||
#include <stdint.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <float.h>
|
|
||||||
#include <memory.h>
|
|
||||||
|
|
||||||
#include "../crypto777/OS_portable.h"
|
|
||||||
|
|
||||||
|
#ifndef SATOSHIDEN
|
||||||
#define SATOSHIDEN ((uint64_t)100000000L)
|
#define SATOSHIDEN ((uint64_t)100000000L)
|
||||||
#define dstr(x) ((double)(x) / SATOSHIDEN)
|
#define dstr(x) ((double)(x) / SATOSHIDEN)
|
||||||
#define MAX_JSON_FIELD 4096 // on the big side
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* cJSON Types: */
|
|
||||||
#define cJSON_False 0
|
|
||||||
#define cJSON_True 1
|
|
||||||
#define cJSON_NULL 2
|
|
||||||
#define cJSON_Number 3
|
|
||||||
#define cJSON_String 4
|
|
||||||
#define cJSON_Array 5
|
|
||||||
#define cJSON_Object 6
|
|
||||||
|
|
||||||
#define is_cJSON_Null(json) ((json) != 0 && ((json)->type & 0xff) == cJSON_NULL)
|
|
||||||
#define is_cJSON_Array(json) ((json) != 0 && ((json)->type & 0xff) == cJSON_Array)
|
|
||||||
#define is_cJSON_String(json) ((json) != 0 && ((json)->type & 0xff) == cJSON_String)
|
|
||||||
#define is_cJSON_Number(json) ((json) != 0 && ((json)->type & 0xff) == cJSON_Number)
|
|
||||||
#define is_cJSON_Object(json) ((json) != 0 && ((json)->type & 0xff) == cJSON_Object)
|
|
||||||
#define is_cJSON_True(json) ((json) != 0 && ((json)->type & 0xff) == cJSON_True)
|
|
||||||
#define is_cJSON_False(json) ((json) != 0 && ((json)->type & 0xff) == cJSON_False)
|
|
||||||
|
|
||||||
#define cJSON_IsReference 256
|
|
||||||
|
|
||||||
/* The cJSON structure: */
|
|
||||||
typedef struct cJSON {
|
|
||||||
struct cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
|
|
||||||
struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
|
|
||||||
|
|
||||||
int32_t type; /* The type of the item, as above. */
|
|
||||||
|
|
||||||
char *valuestring; /* The item's string, if type==cJSON_String */
|
|
||||||
int64_t valueint; /* The item's number, if type==cJSON_Number */
|
|
||||||
double valuedouble; /* The item's number, if type==cJSON_Number */
|
|
||||||
|
|
||||||
char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
|
|
||||||
uint32_t cjsonid;
|
|
||||||
} cJSON;
|
|
||||||
|
|
||||||
typedef struct cJSON_Hooks {
|
|
||||||
void *(*malloc_fn)(size_t sz);
|
|
||||||
void (*free_fn)(void *ptr);
|
|
||||||
} cJSON_Hooks;
|
|
||||||
|
|
||||||
/* Supply malloc, realloc and free functions to cJSON */
|
|
||||||
extern void cJSON_InitHooks(cJSON_Hooks* hooks);
|
|
||||||
|
|
||||||
|
|
||||||
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */
|
|
||||||
extern cJSON *cJSON_Parse(const char *value);
|
|
||||||
/* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */
|
|
||||||
extern char *cJSON_Print(cJSON *item);
|
|
||||||
/* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */
|
|
||||||
extern char *cJSON_PrintUnformatted(cJSON *item);
|
|
||||||
/* Delete a cJSON entity and all subentities. */
|
|
||||||
extern void cJSON_Delete(cJSON *c);
|
|
||||||
|
|
||||||
/* Returns the number of items in an array (or object). */
|
|
||||||
extern int cJSON_GetArraySize(cJSON *array);
|
|
||||||
/* Retrieve item number "item" from array "array". Returns NULL if unsuccessful. */
|
|
||||||
extern cJSON *cJSON_GetArrayItem(cJSON *array,int32_t item);
|
|
||||||
/* Get item "string" from object. Case insensitive. */
|
|
||||||
extern cJSON *cJSON_GetObjectItem(cJSON *object,const char *string);
|
|
||||||
|
|
||||||
/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
|
|
||||||
extern const char *cJSON_GetErrorPtr(void);
|
|
||||||
|
|
||||||
/* These calls create a cJSON item of the appropriate type. */
|
|
||||||
extern cJSON *cJSON_CreateNull(void);
|
|
||||||
extern cJSON *cJSON_CreateTrue(void);
|
|
||||||
extern cJSON *cJSON_CreateFalse(void);
|
|
||||||
extern cJSON *cJSON_CreateBool(int32_t b);
|
|
||||||
extern cJSON *cJSON_CreateNumber(double num);
|
|
||||||
extern cJSON *cJSON_CreateString(const char *string);
|
|
||||||
extern cJSON *cJSON_CreateArray(void);
|
|
||||||
extern cJSON *cJSON_CreateObject(void);
|
|
||||||
|
|
||||||
/* These utilities create an Array of count items. */
|
|
||||||
extern cJSON *cJSON_CreateIntArray(int64_t *numbers,int32_t count);
|
|
||||||
extern cJSON *cJSON_CreateFloatArray(float *numbers,int32_t count);
|
|
||||||
extern cJSON *cJSON_CreateDoubleArray(double *numbers,int32_t count);
|
|
||||||
extern cJSON *cJSON_CreateStringArray(char **strings,int32_t count);
|
|
||||||
|
|
||||||
/* Append item to the specified array/object. */
|
|
||||||
extern void cJSON_AddItemToArray(cJSON *array, cJSON *item);
|
|
||||||
extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item);
|
|
||||||
/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */
|
|
||||||
extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
|
|
||||||
extern void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item);
|
|
||||||
|
|
||||||
/* Remove/Detatch items from Arrays/Objects. */
|
|
||||||
extern cJSON *cJSON_DetachItemFromArray(cJSON *array,int32_t which);
|
|
||||||
extern void cJSON_DeleteItemFromArray(cJSON *array,int32_t which);
|
|
||||||
extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string);
|
|
||||||
extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string);
|
|
||||||
|
|
||||||
/* Update array items. */
|
|
||||||
extern void cJSON_ReplaceItemInArray(cJSON *array,int32_t which,cJSON *newitem);
|
|
||||||
extern void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
|
|
||||||
|
|
||||||
/* Duplicate a cJSON item */
|
|
||||||
extern cJSON *cJSON_Duplicate(cJSON *item,int32_t recurse);
|
|
||||||
/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will
|
|
||||||
need to be released. With recurse!=0, it will duplicate any children connected to the item.
|
|
||||||
The item->next and ->prev pointers are always zero on return from Duplicate. */
|
|
||||||
|
|
||||||
/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */
|
|
||||||
extern cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int32_t require_null_terminated);
|
|
||||||
|
|
||||||
extern void cJSON_Minify(char *json);
|
|
||||||
|
|
||||||
/* Macros for creating things quickly. */
|
|
||||||
#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
|
|
||||||
#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
|
|
||||||
#define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
|
|
||||||
#define cJSON_AddBoolToObject(object,name,b) cJSON_AddItemToObject(object, name, cJSON_CreateBool(b))
|
|
||||||
#define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
|
|
||||||
#define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
|
|
||||||
|
|
||||||
struct destbuf { char buf[MAX_JSON_FIELD]; };
|
|
||||||
|
|
||||||
/* When assigning an integer value, it needs to be propagated to valuedouble too. */
|
|
||||||
#define cJSON_SetIntValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val))
|
|
||||||
#define jfieldstr get_cJSON_fieldname
|
|
||||||
|
|
||||||
char *cJSON_str(cJSON *json);
|
|
||||||
char *jstr(cJSON *json,char *field);
|
|
||||||
char *jprint(cJSON *json,int32_t freeflag);
|
|
||||||
int32_t jint(cJSON *json,char *field);
|
|
||||||
uint32_t juint(cJSON *json,char *field);
|
|
||||||
char *jstri(cJSON *json,int32_t i);
|
|
||||||
int32_t jinti(cJSON *json,int32_t i);
|
|
||||||
uint32_t juinti(cJSON *json,int32_t i);
|
|
||||||
uint64_t j64bitsi(cJSON *json,int32_t i);
|
|
||||||
double jdoublei(cJSON *json,int32_t i);
|
|
||||||
double jdouble(cJSON *json,char *field);
|
|
||||||
cJSON *jobj(cJSON *json,char *field);
|
|
||||||
cJSON *jarray(int32_t *nump,cJSON *json,char *field);
|
|
||||||
cJSON *jitem(cJSON *array,int32_t i);
|
|
||||||
uint64_t j64bits(cJSON *json,char *field);
|
|
||||||
void jadd(cJSON *json,char *field,cJSON *item);
|
|
||||||
void jaddstr(cJSON *json,char *field,char *str);
|
|
||||||
void jaddnum(cJSON *json,char *field,double num);
|
|
||||||
void jadd64bits(cJSON *json,char *field,uint64_t nxt64bits);
|
|
||||||
void jaddi(cJSON *json,cJSON *item);
|
|
||||||
void jaddistr(cJSON *json,char *str);
|
|
||||||
void jaddinum(cJSON *json,double num);
|
|
||||||
void jaddi64bits(cJSON *json,uint64_t nxt64bits);
|
|
||||||
void jdelete(cJSON *object,char *string);
|
|
||||||
cJSON *jduplicate(cJSON *json);
|
|
||||||
int32_t jnum(cJSON *obj,char *field);
|
|
||||||
|
|
||||||
bits256 jbits256(cJSON *json,char *field);
|
|
||||||
bits256 jbits256i(cJSON *json,int32_t i);
|
|
||||||
void jaddbits256(cJSON *json,char *field,bits256 hash);
|
|
||||||
void jaddibits256(cJSON *json,bits256 hash);
|
|
||||||
void copy_cJSON(struct destbuf *dest,cJSON *obj);
|
|
||||||
void copy_cJSON2(char *dest,int32_t maxlen,cJSON *obj);
|
|
||||||
cJSON *gen_list_json(char **list);
|
|
||||||
int32_t extract_cJSON_str(char *dest,int32_t max,cJSON *json,char *field);
|
|
||||||
|
|
||||||
void free_json(cJSON *json);
|
|
||||||
int64_t _conv_cJSON_float(cJSON *json);
|
|
||||||
int64_t conv_cJSON_float(cJSON *json,char *field);
|
|
||||||
int64_t get_cJSON_int(cJSON *json,char *field);
|
|
||||||
void add_satoshis_json(cJSON *json,char *field,uint64_t satoshis);
|
|
||||||
uint64_t get_satoshi_obj(cJSON *json,char *field);
|
|
||||||
|
|
||||||
int32_t get_API_int(cJSON *obj,int32_t val);
|
|
||||||
uint32_t get_API_uint(cJSON *obj,uint32_t val);
|
|
||||||
uint64_t get_API_nxt64bits(cJSON *obj);
|
|
||||||
double get_API_float(cJSON *obj);
|
|
||||||
char *get_cJSON_fieldname(cJSON *obj);
|
|
||||||
void ensure_jsonitem(cJSON *json,char *field,char *value);
|
|
||||||
int32_t in_jsonarray(cJSON *array,char *value);
|
|
||||||
char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params,int32_t timeout);
|
|
||||||
uint64_t calc_nxt64bits(const char *str);
|
|
||||||
int32_t expand_nxt64bits(char *str,uint64_t nxt64bits);
|
|
||||||
char *nxt64str(uint64_t nxt64bits);
|
|
||||||
char *nxt64str2(uint64_t nxt64bits);
|
|
||||||
cJSON *addrs_jsonarray(uint64_t *addrs,int32_t num);
|
|
||||||
int32_t myatoi(char *str,int32_t range);
|
|
||||||
void cJSON_register(cJSON *item);
|
|
||||||
void cJSON_unregister(cJSON *item);
|
|
||||||
|
|
||||||
char *stringifyM(char *str);
|
|
||||||
#define replace_backslashquotes unstringify
|
|
||||||
char *unstringify(char *str);
|
|
||||||
#define jtrue cJSON_CreateTrue
|
|
||||||
#define jfalse cJSON_CreateFalse
|
|
||||||
|
|
||||||
#define jfieldname get_cJSON_fieldname
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ bool check_pprevnotarizedht();
|
|||||||
#include "hush_globals.h"
|
#include "hush_globals.h"
|
||||||
#include "hush_utils.h"
|
#include "hush_utils.h"
|
||||||
#include "hush_curve25519.h"
|
#include "hush_curve25519.h"
|
||||||
#include "hush_cJSON.c"
|
#include "hush_cJSON.h"
|
||||||
#include "hush_bitcoind.h"
|
#include "hush_bitcoind.h"
|
||||||
#include "hush_pax.h"
|
#include "hush_pax.h"
|
||||||
#include "hush_notary.h"
|
#include "hush_notary.h"
|
||||||
|
|||||||
@@ -25,10 +25,21 @@
|
|||||||
/* cJSON */
|
/* cJSON */
|
||||||
/* JSON parser in C. */
|
/* JSON parser in C. */
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "cJSON.h"
|
#include "cJSON.h"
|
||||||
#include "hush_cJSON.h"
|
#include "hush_cJSON.h"
|
||||||
#include "cJSON.c"
|
|
||||||
|
// External dependencies (defined in hush_utils.h, compiled in hush_impl.cpp)
|
||||||
|
#ifndef SATOSHIDEN
|
||||||
|
#define SATOSHIDEN ((uint64_t)100000000L)
|
||||||
|
#define dstr(x) ((double)(x) / SATOSHIDEN)
|
||||||
|
#endif
|
||||||
|
long _stripwhite(char *buf, int accept);
|
||||||
|
char *clonestr(char *str);
|
||||||
|
int32_t decode_hex(uint8_t *bytes, int32_t n, char *hex);
|
||||||
|
char *bits256_str(char hexstr[65], bits256 x);
|
||||||
|
int32_t safecopy(char *dest, char *src, long len);
|
||||||
|
|
||||||
#ifndef DBL_EPSILON
|
#ifndef DBL_EPSILON
|
||||||
#define DBL_EPSILON 2.2204460492503131E-16
|
#define DBL_EPSILON 2.2204460492503131E-16
|
||||||
Reference in New Issue
Block a user