JunkBox_Lib 1.10.1
|
汎用共通ヘッダ More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | Parameter32 |
struct | Parameter64 |
Macros | |
#define | _INCLUDE_POSIX_SOURCE |
#define | __EXTENSIONS__ |
#define | _CRT_SECURE_NO_WARNINGS |
#define | DllExport |
#define | DllImport |
#define | LOG_PERROR 0 |
#define | Sleep(t) usleep((t)*1000) |
usleep() | |
#define | MAXBUFSZ 4194304 |
4M | |
#define | BUFSZ2M 2087152 |
2M | |
#define | HHHBUFSZ 2087152 |
2M | |
#define | BUFSZ1M 1048576 |
1M | |
#define | HHBUFSZ 1048576 |
1M | |
#define | HBUFSZ 524288 |
512K | |
#define | RECVBUFSZ 262144 |
256K | |
#define | LLLBUFSZ 131072 |
128K | |
#define | LLBUFSZ 65536 |
64K | |
#define | LBUFSZ 32768 |
32K | |
#define | BUFSZ 16384 |
16K | |
#define | MBUFSZ 8192 |
8K | |
#define | SBUFSZ 4096 |
4K | |
#define | L_4096 4096 |
#define | L_2048 2048 |
#define | LFRAME 2048 |
#define | L_1024 1024 |
#define | LBUF 1024 |
#define | L_512 512 |
#define | LMESG 512 |
#define | L_256 256 |
#define | LPATH 256 |
#define | LDATA 256 |
#define | L_128 128 |
#define | LNAME 128 |
#define | LMDATA 128 |
#define | LPASS 128 |
$6$ -> 98文字 | |
#define | L_64 64 |
#define | LMNAME 64 |
#define | LSDATA 64 |
#define | LGUID 40 |
16*2 + 4(-) + 1('\0') = 37 以上の 4の倍数 | |
#define | LUUID 36 |
16*2 + 1('\0') = 33 以上の 4の倍数 | |
#define | L_32 32 |
#define | LADDR 32 |
#define | LADDR6 128 |
#define | LSNAME 32 |
#define | L_16 16 |
#define | L_ID 16 |
#define | L_8 8 |
#define | L_OCT 8 |
#define | LEN_REAL 32 |
15*2 + '\0' + 1(予備) | |
#define | LEN_INT 22 |
log 2^64 + '\0' + 1(予備) | |
#define | LEN_IPADDR 17 |
strlen("AAA.BBB.CCC.DDD") + '\0' + 1(予備) | |
#define | LEN_IPADDR6 41 |
strlen("1111:2222:333:4444:5555:6666:7777:8888") + '\0' + 1(予備) | |
#define | LEN_PORT 7 |
strlen("65536") + '\0' + 1(予備) | |
#define | LEN_IPPORT 23 |
strlen("AAA.BBB.CCC.DDD:65536") + '\0' + 1(予備) | |
#define | STRLEN_GUID 36 |
GUID の長さ | |
#define | WORK_FILENAME_LEN 16 |
#define | PI 3.1415926535897932385 |
#define | PI15 4.7123889803846898577 |
#define | PI2 6.2831853071795864769 |
#define | PI_DIV2 1.5707963267948966192 |
#define | PI_DIV2_3 4.7123889803846898577 |
#define | PI_DIV3 1.0471975511965977462 |
#define | PI_DIV3_2 2.0943951023931954923 |
#define | PI_DIV4 0.78539816339744830962 |
#define | PI_DIV6 0.52359877559829887308 |
#define | LN_10 2.3025850929940456840 |
#define | EXP_1 2.71828182845904523536 |
#define | DEGREE2RAD 0.0174532925199432957692 |
#define | RAD2DEGREE 57.2957795130823208768 |
#define | SQROOT_05 0.707106781186547524401 |
#define | SQROOT_2 1.4142135623730950488 |
#define | SQROOT_3 1.7320508075688772935 |
#define | SQROOT_5 2.2360679774997896964 |
#define | SQROOT_7 2.6457513110645905905 |
#define | SINTMAX 2147483647 |
#define | SINTMIN -2147483647 |
#define | UINTMAX 4294967295 |
#define | SWORDMAX 32767 |
#define | SWORDMIN -32768 |
#define | UWORDMAX 65535 |
#define | RAND_MAX 2147483647 |
#define | FALSE 0 |
#define | TRUE 1 |
#define | ON 1 |
#define | OFF 0 |
#define | OK 1 |
#define | NG 0 |
#define | YES 1 |
#define | NO 0 |
#define | CRLF "\r\n" |
#define | Max(x, y) (((x)<(y)) ? (y):(x)) |
#define | Min(x, y) (((x)>(y)) ? (y):(x)) |
#define | Sign(x) (((x)>=0) ? (1):(-1)) |
#define | Loop while(1) |
#define | Xabs(x) (((x)>=0) ? (x):(-(x))) |
#define | getBit(x, n) ((sByte)((*(x+(n)/8)>>(7+(n)/8*8-(n)))&0x01)) |
#define | setBit(x, n, i) ((i)?(*(x+(n)/8)|=(0x80>>((n)-(n)/8*8))):(*((x)+(n)/8)&=~(0x80>>((n)-(n)/8*8)))) |
#define | checkBit(dat, bit) (((dat)&(bit))==(bit)) |
#define | maskBit(dat, bit) ((dat)&(0xff>>(8-(bit)))) |
#define | UNUSED(x) (void)((x)) |
#define | Frand() (rand()/((double)RAND_MAX+1.0)) |
#define | Drand(x) ((int)(rand()/((double)RAND_MAX+1.0)*((x)+1))) |
#define | LDrand(x) ((long int)(rand()/((double)RAND_MAX+1.0)*((x)+1))) |
#define | Error(s) {perror(s); return -1;} |
#define | JBXL_ON 1 |
#define | JBXL_OFF 0 |
#define | JBXL_OK 1 |
#define | JBXL_NG 0 |
#define | JBXL_YES 1 |
#define | JBXL_NO 0 |
#define | JBXL_TRUE 1 |
#define | JBXL_FALSE 0 |
#define | JBXL_Max(x, y) (((x)<(y)) ? (y):(x)) |
#define | JBXL_Min(x, y) (((x)>(y)) ? (y):(x)) |
#define | JBXL_Sign(x) (((x)>=0) ? (1):(-1)) |
#define | JBXL_EPS 1.0e-6 |
#define | JBXL_3D_FORMAT_NONE 0 |
#define | JBXL_3D_FORMAT_DAE 1 |
#define | JBXL_3D_FORMAT_OBJ 2 |
#define | JBXL_3D_FORMAT_FBX 3 |
#define | JBXL_3D_FORMAT_GLTF 4 |
#define | JBXL_3D_FORMAT_GLB 5 |
#define | JBXL_3D_FORMAT_STL 8 |
#define | JBXL_3D_FORMAT_STL_A 8 |
ASCII. | |
#define | JBXL_3D_FORMAT_STL_B 9 |
Binary. | |
#define | JBXL_3D_ENGINE_NONE 0 |
#define | JBXL_3D_ENGINE_UNITY 1 |
#define | JBXL_3D_ENGINE_UE 2 |
#define | JBXL_TEXTURE_UN_KNOWN 0 |
#define | JBXL_TEXTURE_MOON 3 |
#define | JBXL_TEXTURE_DICOM 4 |
#define | JBXL_TEXTURE_USERSET 5 |
#define | JBXL_TEXTURE_CT 16 |
0x0010 CT (Moon) | |
#define | JBXL_TEXTURE_JPEG 32 |
0x0020 | |
#define | JBXL_TEXTURE_JPG 32 |
#define | JBXL_TEXTURE_TIFF 48 |
0x0030 | |
#define | JBXL_TEXTURE_PNG 64 |
0x0040 | |
#define | JBXL_TEXTURE_TGA 80 |
0x0050 | |
#define | JBXL_TEXTURE_JP2K 96 |
0x0060 | |
#define | JBXL_TEXTURE_RAS 112 |
0x0070 SUN RASTER 8bit | |
Typedefs | |
typedef unsigned char | uByte |
1Byte | |
typedef char | sByte |
1Byte | |
typedef unsigned short | uWord |
2Byte | |
typedef short | sWord |
2Byte | |
typedef unsigned int | uDWord |
4Byte | |
typedef int | sDWord |
4Byte | |
#define BUFSZ 16384 |
Definition at line 138 of file common.h.
Referenced by gz_decode_data(), gz_decode_fp(), and restore_protocol_contents().
#define checkBit | ( | dat, | |
bit ) (((dat)&(bit))==(bit)) |
Definition at line 260 of file common.h.
Referenced by read_user_data(), read_wsg_file(), read_wsg_file_rb(), and write_ct_file().
#define CRLF "\r\n" |
Definition at line 241 of file common.h.
Referenced by json_inverse_parse(), xml_close_node_Buffer(), and xml_open_node_Buffer().
#define Drand | ( | x | ) | ((int)(rand()/((double)RAND_MAX+1.0)*((x)+1))) |
#define FALSE 0 |
Definition at line 223 of file common.h.
Referenced by _search_key_json_obj(), _tcp_server_bind(), _tcp_server_bind_setopt(), _tcp_server_socket(), _tcp_server_socket_setopt(), _udp_server_socket(), _udp_server_socket_setopt(), add_xml_content_area(), bvh_parse_hierarchy(), check_auth(), check_match_tTree(), check_match_xml(), check_passwd(), check_server_spki(), chk_RZxy(), command_KEYEX(), command_PASSWD(), command_USERID(), decomp_hostport(), decomp_url(), dump_http_header(), ex_strncasecmp(), ex_strncaservscmp(), ex_strncmp(), ex_strnrvscmp(), extract_tTar(), file_exist(), find_match_tTree(), find_match_xml(), gen_CRYPT_SharedKey(), get_mime_filename(), get_protocol_header_list_seq(), get_sdp_body_list(), get_xml_content_bystr(), get_xml_node(), get_xml_node_bystr(), http_proxy_header_analyze(), init_LDAP_Host(), is_big_endian(), is_gz_data(), is_header_continue(), is_host_in_list(), is_http_header_field(), is_ipaddr_num_in_list(), is_little_endian(), is_same_network(), is_same_network_num(), is_same_network_num(), is_same_sockaddr(), is_same_sockaddr(), is_smtp_onecommand(), isinctri(), isnot_xml_name(), isNull(), isText_Buffer(), llsd_xml_contain_key(), METHODDEF(), print_errfile(), print_logfile(), read_Buffer2_format_fp(), rebuild_http_Buffer(), recv_http_Buffer(), recv_http_chunked(), recv_http_content(), recv_http_file(), recv_http_header(), replace_item_tList_node(), replace_sBuffer_file(), replace_sdp_invite_addr(), replace_sip_contact_dstipport(), replace_tTree_node(), replace_value_tList_node(), replace_xml_content(), replace_xml_content_bystr(), return_exist_node(), save_Buffer2_format_fp(), save_Buffer_file(), save_Buffer_format_fp(), save_Buffer_tList_file(), save_Buffer_tList_fp(), save_spki_with_ipaddr(), save_tagged_Buffer(), search_key_json_obj(), seek_ringBuffer(), set_item_tList_node(), set_value_tList_node(), set_xml_attr(), set_xml_attr_bystr(), set_xml_content(), set_xml_content_bystr(), set_xml_end_node(), set_xml_end_node_bystr(), set_xml_node(), set_xml_node_bystr(), smtp_check_dot(), ssl_tcp_recv_Buffer_tosize(), ssl_tcp_recv_Buffer_tosize_wait(), tcp_recv_Buffer_tosize(), tcp_recv_Buffer_tosize_wait(), xml_parse_seq(), and xml_parse_start_node().
#define getBit | ( | x, | |
n ) ((sByte)((*(x+(n)/8)>>(7+(n)/8*8-(n)))&0x01)) |
Definition at line 258 of file common.h.
Referenced by encode_base64(), and to_bin64().
#define JBXL_TEXTURE_JP2K 96 |
Definition at line 326 of file common.h.
Referenced by get_graphic_extension().
#define JBXL_TEXTURE_JPEG 32 |
Definition at line 321 of file common.h.
Referenced by get_graphic_extension().
#define JBXL_TEXTURE_PNG 64 |
Definition at line 324 of file common.h.
Referenced by get_graphic_extension().
#define JBXL_TEXTURE_RAS 112 |
Definition at line 327 of file common.h.
Referenced by get_graphic_extension().
#define JBXL_TEXTURE_TGA 80 |
Definition at line 325 of file common.h.
Referenced by get_graphic_extension().
#define JBXL_TEXTURE_TIFF 48 |
Definition at line 323 of file common.h.
Referenced by get_graphic_extension().
#define L_32 32 |
Definition at line 161 of file common.h.
Referenced by get_chunked_size().
#define L_OCT 8 |
Definition at line 168 of file common.h.
Referenced by get_graphic_extension().
#define LADDR 32 |
Definition at line 162 of file common.h.
Referenced by make_Buffer_bychar().
#define LBUF 1024 |
Definition at line 146 of file common.h.
Referenced by bvh_get_seq_data(), check_auth(), command_KEYEX(), command_USERID(), comp_hostport(), decomp_url(), del_sip_record_route(), del_sip_via(), encode_mime_string(), fgets_mstream_Buffer(), get_Buffer_join_tList(), get_mime_filename(), get_protocol_header_list_seq(), gz_decode_fp(), insert_sip_record_route(), insert_sip_via(), join_Buffer_dim(), read_tList_fp(), recv_mesg_until_end(), replace_sip_contact(), replace_sip_contact_dstipport(), replace_sip_via(), send_http_res_file(), set_http_host_header(), ssl_get_cert_info(), ssl_recv_lines_Buffer(), ssl_recv_mstream_Buffer(), ssl_tcp_recv_lines_Buffer(), ssl_tcp_recv_mstream_Buffer(), tcp_recv_lines_Buffer(), tcp_recv_mstream_Buffer(), udp_hole_punching(), udp_hole_punching(), and udp_hole_punching_sockaddr_in().
#define LDATA 256 |
Definition at line 151 of file common.h.
Referenced by dtostr(), dtostr_ts(), ftostr(), ftostr_ts(), itostr(), itostr_ts(), lltostr(), lltostr_ts(), ltostr(), ltostr_ts(), ulltostr(), ulltostr_ts(), ultostr(), and ultostr_ts().
#define LDrand | ( | x | ) | ((long int)(rand()/((double)RAND_MAX+1.0)*((x)+1))) |
#define LEN_INT 22 |
Definition at line 171 of file common.h.
Referenced by cat_i2Buffer(), copy_i2Buffer(), ins_i2Buffer(), json_append_array_int_val(), json_append_obj_int_val(), replace_sdp_invite_addr(), set_http_host_header(), set_max_forwards(), and set_sip_contents().
#define LEN_IPADDR 17 |
Definition at line 172 of file common.h.
Referenced by _get_localip_bydest(), get_ipaddr_byname(), get_mynetaddr(), and to_address_char().
#define LEN_IPADDR6 41 |
Definition at line 173 of file common.h.
Referenced by _get_localip_bydest(), get_ipaddr_byname(), get_mynetaddr(), and to_address_char().
#define LEN_REAL 32 |
Definition at line 170 of file common.h.
Referenced by cat_r2Buffer(), copy_r2Buffer(), ins_r2Buffer(), json_append_array_real_val(), and json_append_obj_real_val().
#define LGUID 40 |
Definition at line 159 of file common.h.
Referenced by uuid2guid().
#define LMDATA 128 |
Definition at line 154 of file common.h.
Referenced by xml_inverse_parse().
#define LNAME 128 |
Definition at line 153 of file common.h.
Referenced by _get_hostname(), comp_url(), dicom_header(), get_hostname_bynum(), get_hostname_bystr(), get_myipaddr(), numbering_name(), and send_command_recv_ans().
#define Loop while(1) |
Definition at line 256 of file common.h.
Referenced by get_mime_filename(), and recv_http_header().
#define LPASS 128 |
Definition at line 155 of file common.h.
Referenced by get_passwd().
#define LSDATA 64 |
Definition at line 158 of file common.h.
Referenced by json_inverse_parse(), json_inverse_parse_opt(), and llsd_bin_get_length().
#define Max | ( | x, | |
y ) (((x)<(y)) ? (y):(x)) |
Definition at line 247 of file common.h.
Referenced by cut_object(), cut_str(), disp_image(), euclid_distance(), grab_WSGraph(), out_round(), read_wsg_file(), read_wsg_file_rb(), read_xxx_file(), recv_wait_twin(), set_color(), setWindow(), tcp_relay(), to2d(), to_address_num(), to_address_num8(), triangle(), write_ct_file(), write_ras_file(), and write_ras_file_obit().
#define Min | ( | x, | |
y ) (((x)>(y)) ? (y):(x)) |
Definition at line 250 of file common.h.
Referenced by copy_WSGraph(), cut_object(), cut_str(), disp_image(), euclid_distance(), gauss_mask(), grab_WSGraph(), imask(), median(), out_round(), print_tiff_ifd_indiv(), set_color(), setWindow(), simple_web_proxy(), to_address_num(), to_address_num8(), to_bin64(), and triangle().
#define OFF 0 |
Definition at line 231 of file common.h.
Referenced by _udp_server_socket(), _udp_server_socket_setopt(), bin2int_DER(), chk_RZxy(), dicom_header(), disp_img(), get_myipaddr(), init_DRBound(), init_IRBound(), json_parse_prop(), out_round(), pack_char_len(), rebuild_http_Buffer(), replace_value_tList(), restore_sdp_body(), send_http_file(), set_protocol_header(), set_wdat(), smtp_check_dot(), sphere(), to_address_num(), to_address_num8(), and write_img().
#define ON 1 |
Definition at line 230 of file common.h.
Referenced by _udp_server_socket(), _udp_server_socket_setopt(), bin2int_DER(), box(), check_auth(), circle(), decompline_Buffer_dim(), dicom_header(), get_myipaddr(), json_parse_prop(), local2world(), out_round(), pack_char_len(), pool(), print_protocol_header(), restore_protocol_header(), send_http_header(), set_http_host_header(), set_protocol_header(), set_RZxy(), set_sip_contents(), set_value_tList(), simple_web_proxy(), smtp_check_dot(), sphere(), ssl_client_socket(), to_address_num(), to_address_num8(), torus(), triangle(), and www2browser_relay().
#define PI 3.1415926535897932385 |
#define RECVBUFSZ 262144 |
Definition at line 134 of file common.h.
Referenced by fgets_mstream(), gz_decode_gzfp(), gz_encode_file(), gz_encode_gzfp(), recv_http_chunked(), recv_http_chunked_remain(), recv_http_closed(), recv_http_content(), recv_http_file(), recv_http_header(), recv_mesg_until_end(), restore_protocol_header(), simple_web_proxy(), ssl_recv_mstream(), ssl_recv_mstream_Buffer(), ssl_tcp_recv_Buffer_tosize(), ssl_tcp_recv_Buffer_tosize_wait(), ssl_tcp_recv_mstream(), ssl_tcp_recv_mstream_Buffer(), tcp_recv_Buffer_tosize(), tcp_recv_Buffer_tosize_wait(), tcp_recv_crypt_Buffer(), tcp_recv_mstream(), tcp_recv_mstream_Buffer(), tcp_relay(), udp_recv_crypt_Buffer(), udp_recv_crypt_Buffer_sockaddr_in(), and www2browser_relay().
#define setBit | ( | x, | |
n, | |||
i ) ((i)?(*(x+(n)/8)|=(0x80>>((n)-(n)/8*8))):(*((x)+(n)/8)&=~(0x80>>((n)-(n)/8*8)))) |
Definition at line 259 of file common.h.
Referenced by decode_base64(), encode_base64(), from_bin64(), randbit(), and randbit_Buffer().
#define Sign | ( | x | ) | (((x)>=0) ? (1):(-1)) |
#define SINTMAX 2147483647 |
Definition at line 204 of file common.h.
Referenced by disp_image(), gauss_mask(), imask(), and init_IRBound().
#define TRUE 1 |
Definition at line 226 of file common.h.
Referenced by _tcp_server_bind(), _tcp_server_bind_setopt(), _tcp_server_socket(), _tcp_server_socket_setopt(), _udp_server_socket(), _udp_server_socket_setopt(), add_xml_content_area(), bvh_parse_hierarchy(), check_auth(), check_match_tTree(), check_match_xml(), check_passwd(), check_server_spki(), chk_RZxy(), command_KEYEX(), command_USERID(), decomp_hostport(), decomp_url(), dump_http_header(), ex_strncasecmp(), ex_strncaservscmp(), ex_strncmp(), ex_strnrvscmp(), extract_tTar(), file_exist(), find_match_tTree(), find_match_xml(), gen_CRYPT_SharedKey(), get_double_key_json_val(), get_key_json_val(), get_key_sister_json_val(), get_protocol_header_list_seq(), get_tiff_ifd(), http_proxy_header_analyze(), is_big_endian(), is_gz_data(), is_header_continue(), is_host_in_list(), is_http_header_field(), is_ipaddr_num_in_list(), is_little_endian(), is_same_network_num(), is_same_network_num(), is_same_sockaddr(), is_same_sockaddr(), is_smtp_onecommand(), isinctri(), isnot_xml_name(), isNull(), llsd_xml_contain_key(), METHODDEF(), open_ldap_connection(), print_errfile(), print_logfile(), read_Buffer2_format_fp(), read_jpeg_file(), read_ldap_config(), rebuild_http_Buffer(), recv_http_Buffer(), recv_http_chunked(), recv_http_content(), recv_http_file(), recv_http_header(), replace_item_tList_node(), replace_sdp_invite_addr(), replace_sip_contact_dstipport(), replace_value_tList_node(), replace_xml_content(), return_exist_node(), save_Buffer2_format_fp(), save_Buffer_file(), save_Buffer_format_fp(), save_Buffer_tList_fp(), save_spki_with_ipaddr(), save_tagged_Buffer(), seek_ringBuffer(), set_item_tList_node(), set_value_tList_node(), set_xml_attr(), set_xml_content(), set_xml_node(), simple_web_proxy(), smtp_check_dot(), ssl_tcp_recv_Buffer_tosize(), ssl_tcp_recv_Buffer_tosize_wait(), tcp_recv_Buffer_tosize(), tcp_recv_Buffer_tosize_wait(), write_jpeg_file(), write_jpeg_mem(), xml_parse(), xml_parse_seq(), and xml_parse_start_node().
#define UNUSED | ( | x | ) | (void)((x)) |
Definition at line 264 of file common.h.
Referenced by bvh_get_seq_data(), command_BYE(), command_CRYPT(), command_HELLO(), command_KEYEX(), command_PASSWD(), command_USERID(), dicom_header(), draw_shape_polygon(), extract_tTar_file(), fgets_Buffer(), file_from_to(), fp_from_to(), init_rand(), METHODDEF(), read_cmn_file(), read_cmn_header(), read_ct_data(), read_dicom_file(), read_file(), read_jp2k_file(), read_lines_Buffer(), read_ras_data(), read_ras_file(), read_shape_index_file(), read_shape_main_file(), read_user_data(), read_xxx_file(), send_http_file(), send_http_res_file(), sigterm_child(), and temp_filename().
#define WORK_FILENAME_LEN 16 |
Definition at line 179 of file common.h.
Referenced by save_http_xml().
#define Xabs | ( | x | ) | (((x)>=0) ? (x):(-(x))) |
Definition at line 257 of file common.h.
Referenced by newton_method(), paint(), setWindow(), unit_ivector(), unit_vector(), and write_ras_file_obit().