91int  gen_CRYPT_SharedKey(
int keyex, 
Buffer spki, 
Buffer* shdkey, 
void* ptr)
 
   93    if (spki.
buf==NULL || shdkey==NULL)  
return FALSE;
 
   97        *shdkey = get_DHsharedkey(spki, dhkey);     
 
   99    else if (keyex==SSL_RSA) {                      
 
  112int   udp_send_crypt_Buffer_sockaddr_in(
int sock, 
Buffer* data,  
struct sockaddr_in* sv, 
Buffer* key, EVP_CIPHER* cipher)
 
  119    if (key!=NULL && cipher!=NULL) {
 
  120        buf = encode_EVPAPI_Buffer(*data, *key, cipher);
 
  132int  udp_recv_crypt_Buffer_sockaddr_in(
int sock, 
Buffer* data, 
struct sockaddr_in* sv, 
Buffer* key, EVP_CIPHER* cipher)
 
  143    if (key!=NULL && cipher!=NULL) {
 
  144        Buffer dec = decode_EVPAPI_Buffer(buf, *key, cipher);
 
  162int   udp_send_crypt_Buffer(
int sock, 
Buffer* data,  
struct addrinfo* sv, 
Buffer* key, EVP_CIPHER* cipher)
 
  169    if (key!=NULL && cipher!=NULL) {
 
  170        buf = encode_EVPAPI_Buffer(*data, *key, cipher);
 
  182int  udp_recv_crypt_Buffer(
int sock, 
Buffer* data, 
struct addrinfo* sv, 
Buffer* key, EVP_CIPHER* cipher)
 
  193    if (key!=NULL && cipher!=NULL) {
 
  194        Buffer dec = decode_EVPAPI_Buffer(buf, *key, cipher);
 
  208int  tcp_send_crypt_Buffer(
int sock, 
Buffer* data, 
Buffer* key, EVP_CIPHER* cipher)
 
  215    if (key!=NULL && cipher!=NULL) {
 
  216        buf = encode_EVPAPI_Buffer(*data, *key, cipher);
 
  228int  tcp_recv_crypt_Buffer(
int sock, 
Buffer* data, 
Buffer* key, EVP_CIPHER* cipher)
 
  239    if (key!=NULL && cipher!=NULL) {
 
  240        Buffer dec = decode_EVPAPI_Buffer(buf, *key, cipher);
 
  257    if (key==NULL || cipher==NULL) 
return buf;
 
  259    buf = decode_EVPAPI_Buffer(data, *key, cipher);
 
  267    if (key==NULL || cipher==NULL) 
return buf;
 
  269    buf = encode_EVPAPI_Buffer(data, *key, cipher);
 
  298int  tcp_send_crypt_mesg(
int sock, 
char* mesg, 
Buffer* key, EVP_CIPHER* cipher)
 
  306    if (key!=NULL && cipher!=NULL) {
 
  308        enc = encode_EVPAPI_Buffer(buf, *key, cipher);
 
  351int  tcp_send_crypt_sBuffer(
int sock, 
Buffer* mesg, 
Buffer* key, EVP_CIPHER* cipher)
 
  359    if (key!=NULL && cipher!=NULL) {
 
  360        enc = encode_EVPAPI_Buffer(*mesg, *key, cipher);
 
  391Buffer  get_plain_message(
char* mesg, 
Buffer* key, EVP_CIPHER* cipher)
 
  397    if (key==NULL || cipher==NULL) 
return buf;
 
  402        buf = decode_EVPAPI_Buffer(dec, *key, cipher);
 
  429    if (key==NULL || cipher==NULL) 
return buf;
 
  434        buf = decode_EVPAPI_Buffer(dec, *key, cipher);
 
  455Buffer  get_crypt_message(
char* mesg, 
Buffer* key, EVP_CIPHER* cipher)
 
  460    if (key==NULL || cipher==NULL) 
return buf;
 
  462    enc = encode_EVPAPI_Buffer(buf, *key, cipher);
 
  491    if (key==NULL || cipher==NULL) 
return buf;
 
  493    enc = encode_EVPAPI_Buffer(buf, *key, cipher);
 
  524int  check_server_spki(
Buffer ipaddr, 
Buffer spki, 
char* filename)
 
  531    fp = fopen(filename, 
"rb");
 
  533        buf = read_spki_with_ipaddr(ipaddr, fp);
 
  545        save_spki_with_ipaddr(ipaddr, spki, fp);
 
  569int  save_spki_with_ipaddr(
Buffer ipa, 
Buffer pki, FILE* fp)
 
  573    if (fp==NULL) 
return FALSE;
 
  601    if (ipa.
buf==NULL) 
return pki;
 
  645EVP_CIPHER* init_EVPAPI_Buffer(
int type)
 
  647    EVP_CIPHER* cipher = NULL;
 
  649    if (type==SSL_AES128CBC) {
 
  650        cipher = (EVP_CIPHER*)EVP_aes_128_cbc();
 
  652    else if (type==SSL_3DES3CBC) {
 
  653        cipher = (EVP_CIPHER*)EVP_des_ede3_cbc();
 
  678    if (shdkey.
buf==NULL || cipher==NULL) 
return dec;
 
  680    iv  = (
unsigned char*)&(shdkey.
buf[shdkey.
vldsz - SSL_IV_SIZE]);
 
  682#if OPENSSL_VERSION_NUMBER < 0x10101000L 
  683    ctx = (EVP_CIPHER_CTX*)malloc(
sizeof(EVP_CIPHER_CTX));  
 
  684    memset(ctx, 0, 
sizeof(EVP_CIPHER_CTX));
 
  685    EVP_CIPHER_CTX_init(ctx);
 
  687    ctx = EVP_CIPHER_CTX_new();                             
 
  688    EVP_CIPHER_CTX_reset(ctx);
 
  691    EVP_DecryptInit_ex(ctx, cipher, NULL, shdkey.
buf, iv);
 
  694    if (dec.
buf==NULL) 
return dec;
 
  696    EVP_DecryptUpdate(ctx, dec.
buf, &sz, buf.
buf, buf.
vldsz);
 
  697    EVP_DecryptFinal_ex(ctx, &(dec.
buf[sz]), &ss);
 
  701#if OPENSSL_VERSION_NUMBER < 0x10101000L 
  702    EVP_CIPHER_CTX_cleanup(ctx);
 
  724    int  i, len, ss=0, sz;
 
  731    if (shdkey.
buf==NULL || cipher==NULL) 
return enc;
 
  733    iv  = (
unsigned char*)&(shdkey.
buf[shdkey.
vldsz - SSL_IV_SIZE]);
 
  735#if OPENSSL_VERSION_NUMBER < 0x10101000L 
  736    ctx = (EVP_CIPHER_CTX*)malloc(
sizeof(EVP_CIPHER_CTX));  
 
  737    memset(ctx, 0, 
sizeof(EVP_CIPHER_CTX));
 
  738    EVP_CIPHER_CTX_init(ctx);
 
  740    ctx = EVP_CIPHER_CTX_new();                             
 
  741    EVP_CIPHER_CTX_reset(ctx);
 
  744    EVP_EncryptInit_ex(ctx, cipher, NULL, shdkey.
buf, iv);
 
  747    enc = 
make_Buffer(len + EVP_CIPHER_CTX_block_size(ctx));
 
  748    if (enc.
buf==NULL) 
return enc;
 
  750    for (i=0; i<len/SSL_ENC_BLCKSZ; i++) {
 
  751        EVP_EncryptUpdate(ctx, &(enc.
buf[ss]), &sz, &(buf.
buf[i*SSL_ENC_BLCKSZ]), SSL_ENC_BLCKSZ);
 
  754    if (len%SSL_ENC_BLCKSZ!=0) {
 
  755        EVP_EncryptUpdate(ctx, &(enc.
buf[ss]), &sz, &(buf.
buf[i*SSL_ENC_BLCKSZ]), len%SSL_ENC_BLCKSZ);
 
  758    EVP_EncryptFinal_ex(ctx, &(enc.
buf[ss]), &sz);
 
  761#if OPENSSL_VERSION_NUMBER < 0x10101000L 
  762    EVP_CIPHER_CTX_cleanup(ctx);
 
  773void   free_EVP_CIPHER(EVP_CIPHER** p_cipher)
 
  775    if (p_cipher==NULL || *p_cipher==NULL) 
return;
 
  809    SSL_load_error_strings();
 
  826SSL_CTX*  ssl_client_setup(
char* ca)
 
  830#if OPENSSL_VERSION_NUMBER < 0x10101000L 
  831    ssl_ctx = SSL_CTX_new(SSLv23_client_method());
 
  833    ssl_ctx = SSL_CTX_new(TLS_client_method());
 
  835    if (ssl_ctx==NULL) 
return NULL;
 
  838    if (ca!=NULL) SSL_CTX_load_verify_locations(ssl_ctx, ca, NULL);
 
  861SSL*  ssl_client_socket(
int sock, SSL_CTX* ssl_ctx, 
int mode)
 
  863    if (ssl_ctx==NULL) 
return NULL;
 
  865    SSL* ssl = SSL_new(ssl_ctx);
 
  871    int ret = SSL_set_fd(ssl, sock);
 
  878    ret = SSL_connect(ssl);
 
  886        long lrt = SSL_get_verify_result(ssl);
 
  887        if (lrt!=X509_V_OK) {
 
  912SSL_CTX*  ssl_server_setup(
char* crt_fn, 
char* key_fn, 
char* chn_fn)
 
  918#if OPENSSL_VERSION_NUMBER < 0x10101000L 
  919    ssl_ctx = SSL_CTX_new(SSLv23_server_method());
 
  921    ssl_ctx = SSL_CTX_new(TLS_server_method());
 
  923    if (ssl_ctx==NULL) 
return NULL;
 
  926    if (crt_fn!=NULL && key_fn!=NULL) {
 
  928            ret = SSL_CTX_use_certificate_file(ssl_ctx, crt_fn, SSL_FILETYPE_PEM);
 
  931            ret = ssl_read_fullchain_cert_file(ssl_ctx, crt_fn);
 
  935            ret = SSL_CTX_use_PrivateKey_file(ssl_ctx, key_fn, SSL_FILETYPE_PEM);
 
  938        if (ret==1 && chn_fn!=NULL) {
 
  939            ret = ssl_add_chain_file(ssl_ctx, chn_fn);
 
  943            SSL_CTX_free(ssl_ctx);
 
  965int  ssl_add_chain_file(SSL_CTX* ssl_ctx, 
char* file)
 
  968    if (file==NULL) 
return ret;
 
  970    BIO* bio = BIO_new(BIO_s_file());
 
  971    if (bio==NULL) 
return ret;
 
  973    BIO_read_filename(bio, file);
 
  974    X509* x509 = PEM_read_bio_X509(bio, NULL, NULL, NULL);
 
  976        ret = SSL_CTX_add_extra_chain_cert(ssl_ctx, x509);
 
  977        x509 = PEM_read_bio_X509(bio, NULL, NULL, NULL);
 
  995int  ssl_read_fullchain_cert_file(SSL_CTX* ssl_ctx, 
char* file)
 
  998    if (file==NULL) 
return ret;
 
 1003    bio = BIO_new(BIO_s_file());
 
 1004    if (bio==NULL) 
return ret;
 
 1005    BIO_read_filename(bio, file);
 
 1008    x509 = PEM_read_bio_X509(bio, NULL, NULL, NULL);
 
 1010        ret = SSL_CTX_use_certificate(ssl_ctx, x509);
 
 1014        x509 = PEM_read_bio_X509(bio, NULL, NULL, NULL);
 
 1016            ret = SSL_CTX_add_extra_chain_cert(ssl_ctx, x509);
 
 1017            x509 = PEM_read_bio_X509(bio, NULL, NULL, NULL);
 
 1027#define  SSL_ACCEPT_COUNT_MAX  10 
 1042SSL*  ssl_server_socket(
int sock, SSL_CTX* ssl_ctx)
 
 1044    if (ssl_ctx==NULL) 
return NULL;
 
 1045    int cnt_max = SSL_ACCEPT_COUNT_MAX;
 
 1047    SSL* ssl = SSL_new(ssl_ctx);
 
 1053    int ret = SSL_set_fd(ssl, sock);
 
 1060    SSL_set_accept_state(ssl);
 
 1062        ret = SSL_accept(ssl);
 
 1063        ret = SSL_get_error(ssl, ret);
 
 1065    } 
while (cnt<=cnt_max && (ret==SSL_ERROR_WANT_READ || ret==SSL_ERROR_WANT_WRITE || ret==SSL_ERROR_SYSCALL));
 
 1067    if (ret==SSL_ERROR_SSL || cnt>cnt_max) {
 
 1068        if (ret!=SSL_ERROR_SSL) ssl_close(ssl);
 
 1083void  ssl_close(SSL* ssl)
 
 1104tList*  ssl_get_cert_info(SSL* ssl)
 
 1113    pp = (
char*)SSL_get_cipher(ssl);
 
 1116    pp = (
char*)SSL_get_cipher_version(ssl);
 
 1119    x509 = SSL_get_peer_certificate(ssl); 
 
 1120    if (x509==NULL) 
return lt;
 
 1122    bio = BIO_new(BIO_s_mem());
 
 1128    X509_NAME_print_ex(bio, X509_get_subject_name(x509), 0, XN_FLAG_RFC2253);
 
 1129    BIO_gets(bio, buf, 
LBUF);
 
 1132    X509_NAME_print_ex(bio, X509_get_issuer_name(x509), 0, XN_FLAG_RFC2253);
 
 1133    BIO_gets(bio, buf, 
LBUF);
 
 1136    ASN1_TIME_print(bio, X509_get_notBefore(x509));
 
 1137    BIO_gets(bio, buf, 
LBUF);
 
 1140    ASN1_TIME_print(bio, X509_get_notAfter(x509));
 
 1141    BIO_gets(bio, buf, 
LBUF);
 
 1171int  ssl_recv(SSL* ssl, 
char* rmsg, 
int size)
 
 1177    memset(rmsg, 0, size);
 
 1178    cc = SSL_read(ssl, rmsg, size-1);
 
 1202int  ssl_send(SSL* ssl, 
char* smsg, 
int size)
 
 1208    if (size<=0) size = strlen(smsg);
 
 1209    cc = SSL_write(ssl, smsg, size);
 
 1239int  ssl_recv_wait(
int sock, SSL* ssl, 
char* mesg, 
int sz, 
int tm)
 
 1247        cc = ssl_recv(ssl, mesg, sz);
 
 1271int  ssl_send_mesgln(SSL* ssl, 
char* mesg)
 
 1278    sz = strlen(mesg) + 3;    
 
 1279    buf = (
char*)malloc(sz);
 
 1282    strncpy(buf, mesg, sz);
 
 1283    strncat(buf, 
"\r\n", 2);
 
 1284    cc = ssl_send(ssl, buf, strlen(buf));
 
 1324int  ssl_recv_mstream(
int sock, SSL* ssl, 
char* mesg, 
int sz, 
mstream* sb, 
int tm)
 
 1333    if (sb->buf==NULL) {
 
 1338    while (sb->datano==0) {
 
 1339        cc = ssl_recv_wait(sock, ssl, mesg, sz, tm);
 
 1340        if (cc<=0) 
return cc;
 
 1347    if (strlen((
const char*)pp)>=(
unsigned int)sz) {
 
 1348        memcpy(mesg, pp, sz-1);
 
 1352    memcpy(mesg, pp, strlen((
const char*)pp));
 
 1355    return strlen(mesg);
 
 1376int  ssl_recv_Buffer(SSL* ssl, 
Buffer* str)
 
 1386    cc = SSL_read(ssl, str->
buf, str->
bufsz-1);
 
 1387    if (cc>=0) str->
vldsz = cc;
 
 1406int  ssl_send_Buffer(SSL* ssl, 
Buffer* str)
 
 1412    if (str->
vldsz<0) str->
vldsz = strlen((
const char*)str->
buf);
 
 1413    cc = SSL_write(ssl, str->
buf, str->
vldsz);
 
 1440int  ssl_recv_Buffer_wait(
int sock, SSL* ssl, 
Buffer* str, 
int tm)
 
 1448    cc = ssl_recv_wait(sock, ssl, (
char*)str->
buf, str->
bufsz, tm);
 
 1449    if (cc>=0) str->
vldsz = cc;
 
 1467int  ssl_send_sBuffer(SSL* ssl, 
Buffer* str)
 
 1473    cc = SSL_write(ssl, str->
buf, strlen((
const char*)str->
buf));
 
 1492int  ssl_send_sBufferln(SSL* ssl, 
Buffer* str)
 
 1501    cc = SSL_write(ssl, buf.
buf, strlen((
const char*)buf.
buf));
 
 1539int  ssl_recv_mstream_Buffer(
int sock, SSL* ssl, 
Buffer* mesg, 
mstream* sb, 
int tm)
 
 1548    if (sb->buf==NULL) {
 
 1553    while (sb->datano==0) {
 
 1554        cc = ssl_recv_Buffer_wait(sock, ssl, mesg, tm);
 
 1595int  ssl_recv_lines_Buffer(
int sock, SSL* ssl, 
Buffer* mesg, 
int tm)
 
 1603    cc = ssl_recv_Buffer_wait(sock, ssl, &buf, tm);
 
 1608        cc = ssl_recv_Buffer_wait(sock, ssl, &buf, tm);
 
 1643int  ssl_tcp_recv(
int sock, SSL* ssl, 
char* rmsg, 
int size)
 
 1648    memset(rmsg, 0, size);
 
 1650    if (ssl!=NULL) cc = SSL_read(ssl, rmsg, size-1);
 
 1651    else           cc = recv(sock, rmsg, size-1, 0);
 
 1676int  ssl_tcp_send(
int sock, SSL* ssl, 
char* smsg, 
int size)
 
 1682    if (size<=0) size = strlen(smsg);
 
 1683    if (ssl!=NULL) cc = SSL_write(ssl, smsg, size);
 
 1684    else           cc = send(sock, smsg, size, 0);
 
 1714int  ssl_tcp_recv_wait(
int sock, SSL* ssl, 
char* mesg, 
int sz, 
int tm)
 
 1721        cc = ssl_tcp_recv(sock, ssl, mesg, sz);
 
 1747int  ssl_tcp_send_mesgln(
int sock, SSL* ssl, 
char* mesg)
 
 1754    sz = strlen(mesg) + 3;    
 
 1755    buf = (
char*)malloc(sz);
 
 1758    strncpy(buf, mesg, sz);
 
 1759    strncat(buf, 
"\r\n", 2);
 
 1760    cc = ssl_tcp_send(sock, ssl, buf, strlen(buf));
 
 1801int  ssl_tcp_recv_mstream(
int sock, SSL* ssl, 
char* mesg, 
int sz, 
mstream* sb, 
int tm)
 
 1809    if (sb->buf==NULL) {
 
 1814    while (sb->datano==0) {
 
 1815        cc = ssl_tcp_recv_wait(sock, ssl, mesg, sz, tm);
 
 1816        if (cc<=0) 
return cc;
 
 1823    if (strlen((
const char*)pp)>=(
unsigned int)sz) {
 
 1824        memcpy(mesg, pp, sz-1);
 
 1828    memcpy(mesg, pp, strlen((
const char*)pp));
 
 1831    return strlen(mesg);
 
 1849int  ssl_tcp_recv_Buffer(
int sock, SSL* ssl, 
Buffer* str)
 
 1859    if (ssl!=NULL) cc = SSL_read(ssl, str->
buf, str->
bufsz-1);
 
 1860    else           cc = recv(sock, str->
buf, str->
bufsz-1, 0);
 
 1862    if (cc>=0) str->
vldsz = cc;
 
 1881int  ssl_tcp_send_Buffer(
int sock, SSL* ssl, 
Buffer* str)
 
 1887    if (str->
vldsz<0) str->
vldsz = strlen((
const char*)str->
buf);
 
 1889        cc = SSL_write(ssl, str->
buf, str->
vldsz);
 
 1892        cc = send(sock, str->
buf, str->
vldsz, 0);
 
 1920int  ssl_tcp_recv_Buffer_wait(
int sock, SSL* ssl, 
Buffer* str, 
int tm)
 
 1927    cc = ssl_tcp_recv_wait(sock, ssl, (
char*)str->
buf, str->
bufsz, tm);
 
 1928    if (cc>=0) str->
vldsz = cc;
 
 1951int  ssl_tcp_recv_Buffer_tosize(
int sock, SSL* ssl, 
Buffer* str, 
Buffer* mod, 
int size)
 
 1957    if (mod!=NULL && mod->
buf!=NULL) modon = 
TRUE;
 
 1959    if (modon) memset(mod->
buf, 0, mod->
vldsz);
 
 1964        cc = ssl_tcp_recv_Buffer(sock, ssl, &buf);
 
 1976    if (sz>size && modon) {
 
 2006int  ssl_tcp_recv_Buffer_tosize_wait(
int sock, SSL* ssl, 
Buffer* str, 
Buffer* mod, 
int size, 
int tm)
 
 2012    if (mod!=NULL && mod->
buf!=NULL) modon = 
TRUE;
 
 2014    if (modon) memset(mod->
buf, 0, mod->
vldsz);
 
 2019        cc = ssl_tcp_recv_Buffer_wait(sock, ssl, &buf, tm);
 
 2031    if (sz>size && modon) {
 
 2052int  ssl_tcp_send_sBuffer(
int sock, SSL* ssl, 
Buffer* str)
 
 2058    if (ssl!=NULL) cc = SSL_write(ssl, str->
buf, strlen((
const char*)str->
buf));
 
 2059    else           cc = send(sock, str->
buf, strlen((
const char*)str->
buf), 0);
 
 2079int  ssl_tcp_send_sBufferln(
int sock, SSL* ssl, 
Buffer* str)
 
 2089    if (ssl!=NULL) cc = SSL_write(ssl, buf.
buf, strlen((
const char*)buf.
buf));
 
 2090    else           cc = send(sock, buf.
buf, strlen((
const char*)buf.
buf), 0);
 
 2128int  ssl_tcp_recv_mstream_Buffer(
int sock, SSL* ssl, 
Buffer* mesg, 
mstream* sb, 
int tm)
 
 2136    if (sb->buf==NULL) {
 
 2141    while (sb->datano==0) {
 
 2142        cc = ssl_tcp_recv_Buffer_wait(sock, ssl, mesg, tm);
 
 2182int  ssl_tcp_recv_lines_Buffer(
int sock, SSL* ssl, 
Buffer* mesg, 
int tm)
 
 2190    cc = ssl_tcp_recv_Buffer_wait(sock, ssl, &buf, tm);
 
 2195        cc = ssl_tcp_recv_Buffer_wait(sock, ssl, &buf, tm);
 
Buffer encode_base64_Buffer(Buffer buf)
バイナリデータ buf.bufの buf.vldszバイトを Base64にエンコード する
 
Buffer make_Buffer(int sz)
Buffer型変数のバッファ部をつくり出す.
 
void clear_Buffer(Buffer *str)
Buffer型変数 のバッファ部を 0クリアする.
 
void free_Buffer(Buffer *buf)
Buffer型変数のバッファ部を解放する
 
Buffer init_Buffer()
初期化したBuffer型変数を返す.
 
Buffer dup_Buffer(Buffer buf)
Buffer型変数のコピーをつくる.
 
Buffer decode_base64_Buffer(Buffer str)
strのバッファを Base64からデコードする
 
int cat_Buffer(Buffer *src, Buffer *dst)
Buffer変数 srcから dstへバッファを catする.
 
int copy_Buffer(Buffer *src, Buffer *dst)
Buffer型変数 srcから dstへバッファをコピーする.
 
int copy_b2Buffer(void *src, Buffer *dst, int len)
任意のバイナリデータsrcを Buffer型変数dstへ lenバイト copyする
 
#define copy_s2Buffer(src, dst)
copy_b2Buffer()
 
#define bincmp_Buffer(a, b)
cmp_Buffer()
 
#define strcmp_Buffer(a, b)
cmp_Buffer()
 
#define cat_s2Buffer(src, dst)
cat_b2Buffer()
 
#define make_Buffer_bystr(str)
set_Buffer()
 
#define JBXL_ARGS_ERROR
不正な引数(NULLなど)
 
#define JBXL_SSL_RECV_ERROR
SSL 受信エラー
 
#define JBXL_NET_BUFSZ_ERROR
受信バッファの長さが足りない.はみ出したデータは捨てられた
 
#define JBXL_SSL_SEND_ERROR
SSL 送信エラー
 
#define JBXL_MALLOC_ERROR
メモリ確保エラー
 
#define JBXL_NET_BUF_ERROR
受信バッファにデータは存在するはずだが,原因不明の理由により獲得に失敗した
 
#define JBXL_NET_RECV_TIMEOUT
受信タイムアウト
 
int recv_wait(int sock, int tm)
 
#define tcp_send_mesg(s, m)
 
int bufsz
確保してあるバッファの大きさ - 1.
 
int vldsz
データの長さ.バイナリデータの場合も使用可能.文字列の場合は 0x00 を含まない.
 
int state
変数の状態を表す.正常は JBXL_NORMAL
 
unsigned char * buf
バッファの先頭へのポインタ.str[bufsz]は必ず 0x00となる.
 
#define add_tList_node_str(p, k, v)
add_tList_node_bystr()