44    cadlen = 
sizeof(*sv_addr);
 
   48    cc = recvfrom(sock, (
char*)str->
buf, str->
bufsz, 0, (
struct sockaddr*)sv_addr, (
socklen_t*)&cadlen);
 
   50    if (cc>=0) str->
vldsz = cc;
 
 
   78    if (str->
vldsz<0) str->
vldsz = (int)strlen((
const char*)str->
buf);
 
   79    cc = sendto(sock, (
char*)str->
buf, str->
vldsz, 0, (
struct sockaddr*)sv_addr, 
sizeof(*sv_addr));
 
 
  105    cc = sendto(sock, (
char*)str->
buf, (
int)strlen((
const char*)str->
buf), 0, (
struct sockaddr*)sv_addr, 
sizeof(*sv_addr));
 
 
  139    if (cc>=0) str->
vldsz = cc;
 
 
  159    struct sockaddr_in  addr;
 
  160    memset(&addr, 0, 
sizeof(
struct sockaddr_in));
 
  162    if (buf.buf==NULL) 
return addr;
 
  165    while (buf.buf[i]!=
'\0' && buf.buf[i]!=
':') i++;
 
  168    port = atoi((
char*)&buf.buf[i+1]);
 
 
  220    cadlen = (int)sv_addr->ai_addrlen;
 
  224    cc = recvfrom(sock, (
char*)str->
buf, str->
bufsz, 0, sv_addr->ai_addr, &cadlen);
 
  226    if (cc>=0) str->
vldsz = cc;
 
 
  255    if (str->
vldsz<0) str->
vldsz = (int)strlen((
const char*)str->
buf);
 
  256    cc = sendto(sock, (
char*)str->
buf, str->
vldsz, 0, sv_addr->ai_addr, (
int)sv_addr->ai_addrlen);
 
 
  285    cc = recv(sock, (
char*)str->
buf, str->
bufsz, 0);
 
  287    if (cc>=0) str->
vldsz = cc;
 
 
  311    if (str->
vldsz<0) str->
vldsz = (int)strlen((
const char*)str->
buf);
 
  312    cc = send(sock, (
char*)str->
buf, str->
vldsz, 0);
 
 
  347    if (cc>=0) str->
vldsz = cc;
 
 
  379    if (cc>=0) str->
vldsz = cc;
 
 
  406    if (mod!=NULL && mod->
buf!=NULL) modon = 
TRUE;
 
  408    if (modon) memset(mod->
buf, 0, mod->
vldsz);
 
  425    if (sz>size && modon) {
 
 
  459    if (mod!=NULL && mod->
buf!=NULL) modon = 
TRUE;
 
  461    if (modon) memset(mod->
buf, 0, mod->
vldsz);
 
  478    if (sz>size && modon) {
 
 
  506    cc = sendto(sock, (
char*)str->
buf, (
int)strlen((
const char*)str->
buf), 0, sv_addr->ai_addr, (
int)sv_addr->ai_addrlen);
 
 
  530    cc = send(sock, (
char*)str->
buf, (
int)strlen((
const char*)str->
buf), 0);
 
 
  555    cc = send(sock, (
char*)buf.
buf, (
int)strlen((
const char*)buf.
buf), 0);
 
 
  605    while (sb->datano==0) {
 
 
  695        if (port!=0) 
snprintf(hostport, 
LBUF-1, 
"%s:%d", host, port);
 
 
  726        while (buf.
buf[i]!=
'\0' && buf.
buf[i]!=
':') i++;
 
  727        if (buf.
buf[i]!=
'\0') *port = (
unsigned short)atoi((
char*)&buf.
buf[i+1]);
 
  735        while (hostport.
buf[i]!=
'\0' && hostport.
buf[i]!=
':') i++;
 
  736        hostport.
buf[i] = 
'\0';
 
  737        hostport.
vldsz  = (int)strlen((
char*)hostport.
buf);
 
 
  764    if (protocol!=NULL) {
 
 
  809    Buffer item1, item2, item3, item4, wrk;
 
  815    if (sport   !=NULL) *sport    = 0;
 
  823    if (strstr((
char*)url.
buf, 
"://")!=NULL) {
 
  827        if (protocol!=NULL) {
 
  829            protocol->
buf[protocol->
vldsz-1] = 
'\0';
 
  838    if (item2.
buf!=NULL) {
 
  840        if (item3.
buf==NULL) {
 
  852    if (item4.
buf!=NULL && sport!=NULL) {
 
  853        *sport = (
unsigned short)atoi((
char*)item4.
buf);
 
  857    if (item1.
buf!=NULL) {
 
  863    if (item3.
buf!=NULL) {
 
  864        if (srvfqdn!=NULL) *srvfqdn = item3;
 
  873    if (srvurl!=NULL) *srvurl = wrk;
 
 
  887    if (key==NULL) 
return buf;
 
  893        unsigned char* val_enc = 
encode_urlenc((
unsigned char*)val, -1);
 
 
  906    if (buf==NULL || key==NULL) 
return;
 
  913        unsigned char* val_enc = 
encode_urlenc((
unsigned char*)val, -1);
 
 
  963    tag.
buf[0] = mode & 0x0f;            
 
  964    tag.
buf[1] = mode & 0xf0;            
 
  982    if (!cc) 
return FALSE;
 
 
 1015    unsigned char mthd, kind;
 
 1016    Buffer   tmp, tag, enc, buf;
 
 1019    if (mode==NULL) 
return buf;
 
 1023    kind = *mode & 0x0f;                
 
 1024    mthd = *mode & 0xf0;                
 
 1032    if (mthd==tag.
buf[1]) {                
 
 1054    *mode = (
unsigned int)tag.
buf[0];    
 
 
 1121    for (i=0; i<len; i++) {
 
 1126            if (sz>=pos) 
return i;
 
 1131        if (sz>=pos) 
return i;
 
 
 1160                    if (buf[j+1]==0x00) 
return ret;
 
 1177    if (ret.
buf==NULL) 
return ret;
 
 1180    while (i<sz && j<len) {
 
 1183                for (k=0; k<(int)buf[j+1]; k++) ret.
buf[i++] = 0x00;
 
 1188        else ret.
buf[i++] = buf[j++];
 
 1191    if (i==sz) ret.
vldsz = sz;
 
 
 1204    if (ret.
buf==NULL) 
return ret;
 
 1208        ret.
buf[i] = buf[j];
 
 1212            while (buf[j]==0x00 && j<len) {
 
 1216            ret.
buf[i+1] = (
unsigned char)k;
 
 
 1292    if (rb==NULL) 
return NULL;
 
 1293    if (rb->
buf==NULL) 
return NULL;
 
 1294    if (sz>rb->
datasz) 
return NULL;
 
 1298    if (rb->
spoint + sz <= rb->bufsz) {
 
 
 1337    if (lp==NULL) 
return NULL;
 
 1342    while(lt!=NULL && lt->ldat.key.buf!=NULL) {
 
 1346    if (nn==0) 
return NULL;
 
 1350    if (ret==NULL) 
return NULL;
 
 1351    memset(buf, 0, 
sizeof(
Buffer)*mx);
 
 1354    while(lp!=NULL && lp->ldat.key.buf!=NULL) {
 
 1356        buf->
state = mx - nn;
 
 
 1384    if (lp==NULL) 
return NULL;
 
 1388    while(lt!=NULL && lt->ldat.val.buf!=NULL) {
 
 1392    if (nn==0) 
return NULL;
 
 1396    if (ret==NULL) 
return NULL;
 
 1397    memset(buf, 0, 
sizeof(
Buffer)*mx);
 
 1400    while(lp!=NULL && lp->ldat.val.buf!=NULL) {
 
 1402        buf->
state = mx - nn;
 
 
 1484    if (buf.
buf==NULL) 
return NULL;
 
 1487    while(buf.
buf[i]!=
'\0' && i<buf.
vldsz) {
 
 1493        else if (i+1<buf.
vldsz  && buf.
buf[i+1]==
'\0') n++;
 
 1494        else if (i+1==buf.
vldsz || buf.
buf[i+1]==
'\0') n++;
 
 1500    if (dim==NULL) 
return NULL;
 
 1501    memset(dim, 0, 
sizeof(
Buffer)*n);
 
 1504    for (m=0; m<n-1; m++) {
 
 1511        if (mode==
ON) cnt += fwd;
 
 1514        for (i=0; i<cnt; i++) {
 
 1515            dim[m].
buf[i] = buf.
buf[nxt+i];
 
 1520        if (mode==
ON) nxt += cnt;
 
 1521        else          nxt += cnt + fwd;
 
 1526    for (i=0; i<buf.
vldsz-nxt; i++) {
 
 1527        dim[n-1].
buf[i] = buf.
buf[nxt+i];
 
 
 1547    if (dim==NULL) 
return buf;
 
 1552    for (i=0; i<nn; i++) {
 
 
 1572    if (dim==NULL || *dim==NULL) 
return;
 
 1578    for (i=0; i<nn; i++) {
 
 
 1605    if (buf.
buf==NULL || n<=0) 
return NULL;
 
 1608    if (line.
buf==NULL) 
return NULL;
 
 1612    if (packline==NULL) 
return NULL;
 
 
 1630    if (buf.
buf==NULL || *ptr<0) 
return NULL;
 
 1631    if (*ptr>=buf.
vldsz) 
return NULL;
 
 1634    if (line.
buf==NULL) 
return NULL;
 
 1638    if (packline==NULL) 
return NULL;
 
 
 1703    if (lp==NULL || value==NULL) 
return FALSE;
 
 1708    if (bp!=NULL && bp->
state>=nm) {
 
 
 1779    if (lp==NULL || value==NULL) 
return FALSE;
 
 1788    if (bp!=NULL && bp->
state>=nm) {
 
 
 1825    WIN32_FIND_DATAA FindFileData;
 
 1834    hFind = FindFirstFileA((LPCSTR)(buf.
buf), &FindFileData);
 
 1835    if (hFind!=INVALID_HANDLE_VALUE) {
 
 1838            if (strcmp(
".", FindFileData.cFileName) && strcmp(
"..", FindFileData.cFileName)) { 
 
 1840                if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) fkind = 1;    
 
 1844                if (ln!=NULL) ln->ldat.lv = fkind;
 
 1845                if (lp==NULL) lp = ln;
 
 1848        } 
while (FindNextFileA(hFind, &FindFileData));
 
 1867        while (dir != NULL ){
 
 1868            if (strcmp(
".", dir->d_name) && strcmp(
"..", dir->d_name)) { 
 
 1870                if (dir->d_type==DT_DIR) fkind = 1; 
 
 1874                if (ln!=NULL) ln->ldat.lv = fkind;
 
 1875                if (lp==NULL) lp = ln;
 
 1890        tList* lo = ln->next;
 
 1892            if (strcmp((
char*)ln->ldat.val.buf, (
char*)lo->ldat.val.buf)>0) {
 
 
 1907    if (lp==NULL) 
return NULL;
 
 1911        if (lt->ldat.lv==1) {
 
 
 1925    if (dirn==NULL) 
return;
 
 1930        if (lt->ldat.lv==1) 
rmdir((
char*)lt->ldat.val.buf);
 
 1931        else unlink((
char*)lt->ldat.val.buf);
 
 
 1943    if (path==NULL) 
return;
 
 1945    int count = path->
vldsz - 1;
 
 1947        if (path->
buf[count]==
'.') {
 
 1948            path->
buf[count] = 
'\0';
 
 1949            path->
vldsz = (int)strlen((
char*)path->
buf);
 
 
 1962    if (path==NULL) 
return;
 
 1964    int count = path->
vldsz - 1;
 
 1966        if (path->
buf[count]==
'.') {
 
 1967            path->
buf[count] = 
'\0';
 
 1968            path->
vldsz = (int)strlen((
char*)path->
buf);
 
 1973        else if (path->
buf[count]==
'/' || path->
buf[count]==
'\\') {
 
 
 1993片方が絶対パスでもう片方が相対パスの場合,結果は不正確になる.
 
 1998    if (src.
buf==NULL || dst.
buf==NULL) 
return rlt; 
 
 1999    if (src.
buf[0]==
'\0') {
 
 2011    char a = path_a.
buf[0];
 
 2012    char b = path_b.
buf[0];
 
 2013    while (a==b && a!=
'\0') {
 
 2025    char c = path_a.
buf[h];
 
 2028        c = path_a.
buf[++h];
 
 2037        for (j=0; j<n; j++) {
 
 
 2059    if (fname==NULL || fname->
buf==NULL) 
return;
 
 
 2108            if (pp==fnd) pp = fnd->prev;
 
 
 2135    if (path==NULL) 
return list;
 
 2151            else if (fn.
vldsz>=keylen) {
 
 2152                fn.
buf[keylen] = 
'\0';
 
 2157        if (list==NULL) list = pp;
 
 
 2178    if (name==NULL) 
return NULL;
 
 2179    if (lp==NULL) 
return NULL;
 
 2183        if (!
strcasecmp((
char*)lp->ldat.key.buf, name)) {
 
 2184            return (
char*)lp->ldat.val.buf;
 
 
Buffer encode_base64_Buffer(Buffer buf)
バイナリデータ buf.bufの buf.vldszバイトを Base64にエンコード する
 
Buffer get_line_Buffer(Buffer str, int n)
複数行の文字列バッファから任意の行を取り出す.
 
Buffer make_Buffer(int sz)
Buffer型変数のバッファ部をつくり出す.
 
int read_Buffer2_format_fp(Buffer *key, Buffer *buf, FILE *fp)
ファイル fp から 2つのBuffer型変数の keyと bufを読み込む.
 
int cat_b2Buffer(void *src, Buffer *dst, int len)
任意のバイナリデータsrcを Buffer型変数dstへ lenバイト catする.
 
void clear_Buffer(Buffer *str)
Buffer型変数 のバッファ部を 0クリアする.
 
void free_Buffer(Buffer *buf)
Buffer型変数のバッファ部を解放する
 
Buffer init_Buffer()
初期化したBuffer型変数を返す.
 
void rewrite_Buffer_bychar(Buffer *buf, const char frm, const char toc)
buf.buf中の文字 frmを tocで置き換える
 
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する.
 
Buffer * new_Buffer(int sz)
空のBuffer型変数を生成する.
 
int copy_Buffer(Buffer *src, Buffer *dst)
Buffer型変数 srcから dstへバッファをコピーする.
 
Buffer get_seq_data_Buffer(Buffer str, int *ptr)
複数行の文字列バッファ内の行データをシーケンシャルに取り出す.
 
int save_Buffer2_format_fp(Buffer key, Buffer buf, FILE *fp)
ファイル fp へ 2つのBuffer型変数 keyと bufを書き込む
 
int copy_b2Buffer(void *src, Buffer *dst, int len)
任意のバイナリデータsrcを Buffer型変数dstへ lenバイト copyする
 
Buffer awk_Buffer(Buffer str, char cc, int n)
Buffer文字列に対する awk.
 
#define copy_s2Buffer(src, dst)
copy_b2Buffer()
 
#define make_Buffer_str(str)
set_Buffer()
 
#define replace_sBuffer(buf, f, t)
replace_sBuffer()
 
#define cat_s2Buffer(src, dst)
cat_b2Buffer()
 
#define make_Buffer_bystr(str)
set_Buffer()
 
#define JBXL_ARGS_ERROR
不正な引数(NULLなど)
 
#define JBXL_TOOLS_BUFSZ_ERROR
バッファ(データ格納)部の大きさが足りない
 
#define JBXL_XTOOLS_RUNLEN2_ERROR
Run Length データに 0x00, 0x00 が存在する(連長圧縮のデータではないのでは?)
 
#define JBXL_NET_SEND_ERROR
データの送信エラー
 
#define JBXL_NET_RECV_ERROR
データの受信エラー
 
#define JBXL_MALLOC_ERROR
メモリ確保エラー
 
#define JBXL_NET_BUF_ERROR
受信バッファにデータは存在するはずだが,原因不明の理由により獲得に失敗した
 
#define JBXL_XTOOLS_RUNLEN_ERROR
Run Length データが 0x00 で終わっている
 
#define JBXL_TOOLS_BUF_ERROR
バッファ(データ格納)部の領域がない
 
int udp_recv_wait_sockaddr_in(int sock, char *rmsg, int size, struct sockaddr_in *sv_addr, int tm)
use udp_recv_wait()
 
int tcp_recv_wait(int sock, char *mesg, int sz, int tm)
 
struct sockaddr_in get_sockaddr_in(char *hostname, unsigned short cport)
 
int udp_recv_wait(int sock, char *rmsg, int size, struct addrinfo *sv_addr, int tm)
 
int bufsz
確保してあるバッファの大きさ - 1.
 
int vldsz
データの長さ.バイナリデータの場合も使用可能.文字列の場合は 0x00 を含まない.
 
int state
変数の状態を表す.正常は JBXL_NORMAL
 
unsigned char * buf
バッファの先頭へのポインタ.str[bufsz]は必ず 0x00となる.
 
int datasz
保存されているデータの全体の長さ
 
int epoint
バッファデータの終点+1 (データの追加点)
 
tList * dup_tList(tList *pp)
リストを複製する.
 
tList * new_tList_anchor_node(void)
リスト用の ANCHORノードを動的に生成.
 
tList * add_tList_node_bydata(tList *pp, tList_data ldat)
データ(ldat)からリスト用ノードを生成し(new),それを指定したリストの後ろに追加.
 
tList * awk_Buffer_tList(Buffer buf, char cc)
Buffer 中の文字列を区切り文字で区切って,各項目をリストのキー部に入れて返す.
 
tList * cawk_Buffer_tList(Buffer buf, char cc)
Buffer 中の文字列を区切り文字で区切って,各項目をリストのキー部に入れて返す.連続文字列対応.
 
void del_all_tList(tList **pp)
リストの全ノードの削除.ポインタ ppのノードを含むリスト全体を削除する.
 
tList * del_tList(tList **pp)
指定したリストノード以降のリストを削除.
 
tList * find_tList_end(tList *pl)
リストの最後のノードを探す.
 
tList * add_tList_end(tList *pp, tList *pt)
リストppの最後に リストptを追加する.
 
tList * strncasecmp_tList(tList *pl, const char *key, int len, int no)
char* 型変数によるノードのサーチ.大文字小文字を無視する
 
tList * swap_tList_node(tList *pp1, tList *pp2)
pp1ノード と pp2ノードを入れ替える.
 
tList * del_tList_node(tList **node)
リスト用のノードを削除.
 
tList * awk_tList(char *str, char cc)
文字列を区切り文字で区切って,各項目をリストのキー部に入れて返す.
 
#define make_tList_data_str(k, v)
make_tList_data_bystr()
 
#define add_tList_node_str(p, k, v)
add_tList_node_bystr()
 
#define TLIST_ANCHOR_NODE
アンカーノード