Compare commits

...

20 Commits

Author SHA1 Message Date
void_sora
5697dcdfb4 update 2024-12-19 08:41:49 -08:00
void_sora
3430231d1b update 2024-07-30 04:11:44 +08:00
Your Name
85a4c67256 update AWSM library to libsm.so 2024-06-04 11:50:28 +08:00
void_sora
983ef35471 update 2024-05-30 03:55:22 +08:00
void_sora
355a51f01d update 2024-05-30 03:22:48 +08:00
Your Name
0b268960ff update 2024-05-30 03:19:53 +08:00
void_sora
10d62cf634 update 2024-05-29 22:30:26 +08:00
void_sora
d9f277c5e8 update 2024-05-23 12:26:11 +08:00
void_sora
0f5d02d5a9 update AWSM.h doc 2024-04-23 16:03:39 +08:00
void_sora
8be0af5639 rebase 2024-04-23 11:01:16 +08:00
void_sora
753cf13ac4 update INParam Check 2024-04-23 10:53:49 +08:00
void_sora
021ca1c1d2 Merge branch 'develop' of http://gitlab.anweitech.com/void_sora/AW-Sm-Rpc into develop 2024-03-30 15:15:00 +08:00
void_sora
7458b66358 update 2024-03-30 15:14:46 +08:00
void_sora
c2521bb736 update 2024-03-30 15:12:37 +08:00
void_sora
2218319590 update 2024-03-30 13:55:27 +08:00
void_sora
7a29718e68 v1.0.3 fix connect localhost 2024-03-28 16:46:08 +08:00
void_sora
e7fc9bf478 v1.0.3 fix connect localhost 2024-03-28 16:44:59 +08:00
void_sora
f34539f561 update Prot change to 60006 & add no-block reconnect 2024-03-07 16:21:55 +08:00
Void_Sora
99a3575e2b update string end zero 2024-02-01 16:34:14 +08:00
Void_Sora
7cd8ba0d1e update GetHwCode 2024-01-18 15:56:18 +08:00
83 changed files with 19635 additions and 0 deletions

12
.gitignore vendored Normal file
View File

@ -0,0 +1,12 @@
Makefile.in
build*
.vscode
lib
test
.idea
*.a
*.so
cmake-build*
.DS_Store
*.cache
CMakeLists.txt.user

21
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,21 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/AWSM/include",
"${workspaceFolder}/AWSMServer/include",
"${workspaceFolder}/utils/AWSMProtobuf/include",
"${workspaceFolder}/utils/VSClock/include",
"${workspaceFolder}/utils/VSConfig/include",
"${workspaceFolder}/utils/ZMQLayout/include"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}

7
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"files.associations": {
"awsdf.h": "c",
"sdf.h": "c",
"sdf_dev_manage.h": "c"
}
}

BIN
AWSM/AWSMClientTest Executable file

Binary file not shown.

23
AWSM/CMakeLists.txt Normal file
View File

@ -0,0 +1,23 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
PROJECT(smrpc)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -O3")
AUX_SOURCE_DIRECTORY(${PROJECT_SOURCE_DIR}/src src_list)
#ADD_EXECUTABLE(${PROJECT_NAME} ${src_list} ${PROJECT_SOURCE_DIR}/SMtest.c)
ADD_LIBRARY(${PROJECT_NAME} SHARED ${src_list})
SET_TARGET_PROPERTIES(smrpc PROPERTIES OUTPUT_NAME "sm")
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME}
PRIVATE
${PROJECT_SOURCE_DIR}/include)
TARGET_LINK_LIBRARIES(${PROJECT_NAME}
PRIVATE
stdc++
VSClock
VSConfig
ZMQLayout
AWSMProtobuf
)

373
AWSM/SMtest.c Normal file
View File

@ -0,0 +1,373 @@
#include <stdio.h>
#include <string.h>
#include "AWSM.h"
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#define CP printf("[%s:%d]\n", __FILE__, __LINE__);
#define add_error(str) sprintf(ERROR_list + strlen(ERROR_list), "%s 0x%02x\n", #str, rv)
#define show(str)\
printf("%s_len = %d\n%s = {", #str, str##_len, #str);\
for(int i=0; i < str##_len; i++)\
printf(" 0x%02x,", str[i]);\
printf("};\n\n")
#define title(str) printf("/***** %s *****/\n", #str)
#define SUCCESS 0
#define CryptKey 0
#define SignKey 1
unsigned char EccPrikey[] =
{
0xa9,0x28,0xa3,0xc2,0x79,0xf1,0x12,0x78,0x4e,0x6b,0x0c,0x59,0xb7,0x22,0xce,0x60,
0xa7,0x70,0x3b,0x93,0x94,0xf0,0xe5,0x93,0x9f,0x7d,0x88,0xfb,0xaf,0xd7,0x98,0xbe
};
/*
{
0x64,0xfa,0xf7,0x68,0x63,0x9c,0xe1,0xeb,0x02,0x46,0x18,0xec,0x01,0x36,0x36,0xc5,
0xeb,0x4e,0x2f,0x36,0xe7,0x51,0x2b,0x3c,0x9c,0x0c,0xbf,0x04,0x01,0x3e,0x52,0x8b
};
*/
unsigned char EccPubkey[] =
{
0x84,0xb1,0xbd,0x45,0x06,0x19,0x9e,0xdb,0x0b,0x50,0x88,0xdf,0xc4,0x89,0x74,0xab,
0x03,0x31,0x54,0x4b,0x8b,0xf0,0xdf,0x84,0x75,0x31,0x4e,0x05,0xb5,0x16,0xf8,0x2d,
0x5d,0x4e,0xc9,0x98,0x22,0x22,0x44,0xfd,0x6d,0x93,0xd3,0xf6,0x6b,0xd9,0x74,0x33,
0x6a,0x4a,0x59,0xe3,0xda,0xfd,0x6a,0x80,0xc9,0x72,0xab,0x55,0xbc,0x20,0xf1,0x1b
};
/*
{
0x6c,0x59,0xe3,0xd8,0xdc,0xd0,0xfd,0xe8,0x3a,0x1c,0x67,0x8b,0xef,0x8a,0x7e,0x41,
0x65,0x0d,0x04,0xc0,0xf8,0xf1,0x0f,0x06,0x00,0x6b,0x12,0x71,0x71,0xb2,0xfa,0x89,
0x51,0xec,0xe0,0x8e,0x15,0x1e,0xb9,0xef,0x5e,0x74,0xed,0xe8,0xb6,0xdb,0xdc,0xb6,
0x4f,0x61,0x7e,0xb9,0x62,0xa8,0xb4,0x67,0x3c,0x16,0x97,0xc0,0x4d,0x5b,0x32,0x2b
};
*/
int main(int argc, char* argv[])
{
int rv = 0;
char ERROR_list[2048];
memset(ERROR_list, 0, sizeof ERROR_list);
/**/
title(Device_Init);
rv = Device_Init();
printf("Device_Init rv = 0x%02x\n", rv);
if(rv != SUCCESS) return 0;
/**/
/*/
title(Clear_Device_App);
Clear_Device_App();
return;
/**/
/*/
unsigned int RetryCount=0;
rv = Verify_Application_PIN("111111", &RetryCount);
printf("rv = 0x%02x RetryCount = %d\n", rv, RetryCount);
rv = Unlock_Application_PIN("AdminPin", "UserPin", &RetryCount);
printf("rv = 0x%02x RetryCount = %d\n", rv, RetryCount);
rv = Verify_Application_PIN("111111", &RetryCount);
printf("rv = 0x%02x RetryCount = %d\n", rv, RetryCount);
rv = Verify_Application_PIN("UserPin", &RetryCount);
printf("rv = 0x%02x RetryCount = %d\n", rv, RetryCount);
rv = Change_Application_PIN("UserPin", "1111111", RetryCount);
printf("rv = 0x%02x RetryCount = %d\n", rv, RetryCount);
rv = Verify_Application_PIN("1111111", &RetryCount);
printf("rv = 0x%02x RetryCount = %d\n", rv, RetryCount);
rv = Verify_Application_PIN("UserPin", &RetryCount);
printf("rv = 0x%02x RetryCount = %d\n", rv, RetryCount);
rv = Change_Application_PIN("1111111", "UserPin", RetryCount);
printf("rv = 0x%02x RetryCount = %d\n", rv, RetryCount);
rv = Verify_Application_PIN("UserPin", &RetryCount);
printf("rv = 0x%02x RetryCount = %d\n", rv, RetryCount);
/**/
unsigned char random[20];
unsigned int random_len = 16;
title(Generate_Rand);
rv = Generate_Rand(random, random_len);
if(rv != SUCCESS) add_error(Generate_Rand);
else printf("Generate_Rand SUCCESS\n\n");
show(random);
unsigned char Hash_Data[35];
unsigned int Hash_Data_len = 32;
title(Generate_Hash);
rv = Generate_Hash(random, random_len, Hash_Data, &Hash_Data_len, EccPubkey, SGD_SM3);
if(rv != SUCCESS) add_error(Generate_Hash);
else printf("Generate_Hash SUCCESS\n\n");
show(Hash_Data);
title(Generate_Hash);
rv = Generate_Hash(random, random_len, Hash_Data, &Hash_Data_len, NULL, SGD_SM3);
if(rv != SUCCESS) add_error(Generate_Hash);
else printf("Generate_Hash SUCCESS\n\n");
show(Hash_Data);
unsigned char Sign_Data[65];
unsigned int Sign_Data_len = 65;
title(Generate_SignData_ExtPrikey);
rv = Generate_SignData_ExtPrikey(EccPrikey, Hash_Data, Hash_Data_len, Sign_Data, &Sign_Data_len);
if(rv != SUCCESS) add_error(Generate_SignData_ExtPrikey);
show(Sign_Data);
title(Verify_SignData_ExtPubkey);
rv = Verify_SignData_ExtPubkey(EccPubkey, Hash_Data, Hash_Data_len, Sign_Data, Sign_Data_len);
if(rv != SUCCESS) add_error(Verify_SignData_ExtPubkey);
else printf("Verify_SignData_ExtPubkey SUCCESS\n\n");
unsigned char vkek_in[1024];
unsigned int vkek_in_len = 16;
title(Generate_Rand);
rv = Generate_Rand(vkek_in, vkek_in_len);
if(rv != SUCCESS) add_error(Generate_Rand);
else printf("Generate_Rand SUCCESS\n\n");
unsigned char ECC_Encrypt_Data[1024];
unsigned int ECC_Encrypt_Data_len = 1024;
title(SM2_3_Encrypt_ExtPubkey);
rv = SM2_3_Encrypt_ExtPubkey(EccPubkey, vkek_in, vkek_in_len, ECC_Encrypt_Data, &ECC_Encrypt_Data_len);
if(rv != SUCCESS) add_error(SM2_3_Encrypt_ExtPubkey);
show(ECC_Encrypt_Data);
unsigned char vkek_out[1024];
unsigned int vkek_out_len = 16;
title(SM2_3_Decrypt_ExtPrikey);
rv = SM2_3_Decrypt_ExtPrikey(EccPrikey, ECC_Encrypt_Data, ECC_Encrypt_Data_len, vkek_out, &vkek_out_len);
if(rv != SUCCESS) add_error(SM2_3_Decrypt_ExtPrikey);
show(vkek_in);
show(vkek_out);
//unsigned char KeyValue[16] = { 0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38 };
unsigned char KeyValue[16] = { 0 };
unsigned int Key_len = 16;
unsigned char IV[16] = { 0 };
unsigned char EncryptData[200];
unsigned int EncryptData_len = 200;
unsigned char DecryptData[200];
unsigned int DecryptData_len = 200;
unsigned char in[64];
unsigned int in_len = 64;
title(Generate_Rand);
rv = Generate_Rand(in, in_len);
if(rv != SUCCESS) add_error(Generate_Rand);
show(in);
title(SM1_Encrypt);
rv = SM1_Encrypt(P_AlG_ECB, IV, KeyValue, Key_len, in, in_len, EncryptData, &EncryptData_len);
if(rv != SUCCESS) add_error(SM1_Encrypt);
show(EncryptData);
title(SM1_Decrypt);
rv = SM1_Decrypt(P_AlG_ECB, IV, KeyValue, Key_len, EncryptData, EncryptData_len, DecryptData, &DecryptData_len);
if(rv != SUCCESS) add_error(SM1_Decrypt);
show(DecryptData);
memset(EncryptData, 0, sizeof EncryptData);
EncryptData_len = 200;
memset(DecryptData, 0, sizeof DecryptData);
DecryptData_len= 200;
title(SM4_Encrypt);
rv = SM4_Encrypt(P_AlG_OFB, IV, KeyValue, Key_len, in, in_len, EncryptData, &EncryptData_len);
if(rv != SUCCESS) add_error(SM4_Encrypt);
show(EncryptData);
title(SM4_Decrypt);
rv = SM4_Decrypt(P_AlG_OFB, IV, KeyValue, Key_len, EncryptData, EncryptData_len, DecryptData, &DecryptData_len);
if(rv != SUCCESS) add_error(SM4_Decrypt);
show(DecryptData);
unsigned char hw_code[23] = { 0 };
title(Get_Hwcode);
rv = Get_Hwcode(hw_code);
if(rv != SUCCESS) add_error(Get_Hwcode);
printf("hw_code rv = %02x is: %s\n\n", rv, hw_code);
unsigned char DevInfo[2048] = { 0 };
title(Get_DevInfo);
rv = Get_DevInfo(hw_code);
if(rv != SUCCESS) add_error(Get_DevInfo);
printf("DevInfo rv = %02x is: %s\n\n", rv, DevInfo);
unsigned char Publickey[65];
unsigned char Publickey_len = 64;
/*/
title(Generate_ECCKeyPair);
rv = Generate_ECCKeyPair();
if(rv != SUCCESS) add_error(Generate_ECCKeyPair);
else printf("Generate_ECCKeyPair SUCCESS\n\n");
/**/
memset(Publickey, 0, sizeof Publickey);
title(Export_publickey);
rv = Export_publickey(CryptKey, Publickey);
if (rv != SUCCESS) add_error(Export_publickey);
else { show(Publickey); }
title(Export_publickey);
rv = Export_publickey(SignKey, Publickey);
if(rv != SUCCESS) add_error(Export_publickey);
else { show(Publickey); }
unsigned char SignTure[65];
unsigned int SignTure_len = 65;
title(Generate_SignData_IntPrikey);
rv = Generate_SignData_IntPrikey(Hash_Data, Hash_Data_len, SignTure, &SignTure_len);
if(rv != SUCCESS) add_error(Generate_SignData_IntPrikey);
show(SignTure);
title(Verify_SignData_ExtPubkey);
rv = Verify_SignData_ExtPubkey(Publickey, Hash_Data, Hash_Data_len, SignTure, SignTure_len);
if(rv != SUCCESS) add_error(Verify_SignData_ExtPubkey);
else printf("Verify_SignData_ExtPubkey SUCCESS\n\n");
memset(vkek_in, 0, sizeof vkek_in);
memset(vkek_out, 0, sizeof vkek_out);
memset(ECC_Encrypt_Data, 0, sizeof ECC_Encrypt_Data);
vkek_in_len = 128;
vkek_out_len = 512;
ECC_Encrypt_Data_len = 1024;
title(Generate_Rand);
rv = Generate_Rand(vkek_in, vkek_in_len);
if(rv != SUCCESS) add_error(Generate_Rand);
else printf("Generate_Rand SUCCESS\n\n");
title(SM2_3_Encrypt_ExtPubkey);
rv = SM2_3_Encrypt_ExtPubkey(Publickey, vkek_in, vkek_in_len, ECC_Encrypt_Data, &ECC_Encrypt_Data_len);
if(rv != SUCCESS) add_error(SM2_3_Encrypt_ExtPubkey);
show(ECC_Encrypt_Data);
title(SM2_3_Decrypt_IntPrikey);
rv = SM2_3_Decrypt_IntPrikey(ECC_Encrypt_Data, ECC_Encrypt_Data_len, vkek_out, &vkek_out_len);
if(rv != SUCCESS) add_error(SM2_3_Decrypt_IntPrikey);
show(vkek_in);
show(vkek_out);
memset(Publickey, 0, sizeof Publickey);
title(Export_publickey);
rv = Export_publickey(CryptKey, Publickey);
if(rv != SUCCESS) add_error(Export_publickey);
show(Publickey);
title(Generate_Rand);
rv = Generate_Rand(vkek_in, vkek_in_len);
if(rv != SUCCESS) add_error(Generate_Rand);
else printf("Generate_Rand SUCCESS\n\n");
title(SM2_3_Encrypt_ExtPubkey);
rv = SM2_3_Encrypt_ExtPubkey(Publickey, vkek_in, vkek_in_len, ECC_Encrypt_Data, &ECC_Encrypt_Data_len);
if(rv != SUCCESS) add_error(SM2_3_Encrypt_ExtPubkey);
show(ECC_Encrypt_Data);
title(SM2_3_Decrypt_IntCryptPrikey);
rv = SM2_3_Decrypt_IntCryptPrikey(ECC_Encrypt_Data, ECC_Encrypt_Data_len, vkek_out, &vkek_out_len);
if(rv != SUCCESS) add_error(SM2_3_Decrypt_IntCryptPrikey);
show(vkek_in);
show(vkek_out);
unsigned char ans[2049];
unsigned int ans_len = 2049;
char temp_data1[] = "asdddasdasdwaccdcqwwedacawe\0";
unsigned int temp_data1_len = 29;
title(Import_Certificate);
rv = Import_Certificate(1, temp_data1, temp_data1_len);
if(rv != SUCCESS) add_error(Import_Certificate);
char temp_data2[] = "xcvzxcvkehuuxcaw\0";
unsigned int temp_data2_len = 18;
title(Import_Certificate);
rv = Import_Certificate(2, temp_data2, temp_data2_len);
if(rv != SUCCESS) add_error(Import_Certificate);
char *temp_data3 = (char *)malloc(sizeof(char) * (2048 + 1));
memset(temp_data3, 0, sizeof(char) * (2048 + 1));
unsigned int temp_data3_len = 2048;
title(Import_Certificate);
rv = Import_Certificate(3, temp_data3, temp_data3_len);
if(rv != SUCCESS) add_error(Import_Certificate);
free(temp_data3);
// char temp_data4[] = "fkeubckhaugwmksndksahiuahcww\0";
// unsigned int temp_data4_len = strlen(temp_data4) + 1;
// title(Import_Certificate);
// rv = Import_Certificate(4, temp_data4, temp_data4_len);
// if(rv != SUCCESS) add_error(Import_Certificate);
title(Export_Certificate);
rv = Export_Certificate(1, ans, &ans_len);
if(rv != SUCCESS) add_error(Export_Certificate);
printf("ans = %s\n\n", ans);
title(Export_Certificate);
rv = Export_Certificate(2, ans, &ans_len);
if(rv != SUCCESS) add_error(Export_Certificate);
printf("ans = %s\n\n", ans);
title(Export_Certificate);
rv = Export_Certificate(3, ans, &ans_len);
if(rv != SUCCESS) add_error(Export_Certificate);
printf("ans = %s\n\n", ans);
// title(Export_Certificate);
// rv = Export_Certificate(4, ans, &ans_len);
// if(rv != SUCCESS) add_error(Export_Certificate);
// printf("ans = %s\n\n", ans);
// title(Device_Status);
// rv = Device_Status();
// if(rv != SUCCESS) add_error(Device_Status);
// else printf("Device_Status SUCCESS\n\n");
// unsigned char temp_data5[] = "vkek";
// unsigned char temp_data6[] = "keyvision";
// title(Set_SM);
// rv = Set_SM(temp_data5, sizeof(temp_data5), temp_data6, sizeof(temp_data6));
// if(rv != SUCCESS) add_error(Set_SM);
// else printf("Set_SM SUCCESS\n\n");
// unsigned char *ans1 = malloc(64);
// unsigned int ans1Len = 64;
// unsigned char *ans2 = malloc(64);
// unsigned int ans2Len = 64;
// title(Get_SM);
// rv = Get_SM(&ans1, &ans1Len, &ans2, &ans2Len);
// if(rv != SUCCESS) add_error(Get_SM);
// else printf("Set_SM SUCCESS\n\n");
// printf("ans1 = %s\n\n", ans1);
// printf("ans2 = %s\n\n", ans2);
Close_Device();
printf("%s",ERROR_list);
//system("pause");
return 0;
}

380
AWSM/include/AWSM.h Normal file
View File

@ -0,0 +1,380 @@
#ifndef __AWSM_H__
#define __AWSM_H__
// PIN<49>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
#define ADMIN_TYPE 0
#define USER_TYPE 1
#define ECCPRIVATEKEYBITLENGTH 256
#define ECCPRIVATEKEYLENGTH 32
//<2F><EFBFBD><E3B7A8>־
// SM1
#define SGD_SM1_ECB 0x00000101
#define SGD_SM1_CBC 0x00000102
#define SGD_SM1_CFB 0x00000104
#define SGD_SM1_OFB 0x00000108
#define SGD_SM1_MAC 0x00000110
// SM4
#define SGD_SMS4_ECB 0x00000401
#define SGD_SMS4_CBC 0x00000402
#define SGD_SMS4_CFB 0x00000404
#define SGD_SMS4_OFB 0x00000408
// AES
#define SGD_AES128_ECB 0x00000801
#define SGD_AES128_CBC 0x00000802
#define SGD_AES128_CFB 0x00000804
#define SGD_AES128_OFB 0x00000808
#define SGD_AES192_ECB 0x00000811
#define SGD_AES192_CBC 0x00000812
#define SGD_AES192_CFB 0x00000814
#define SGD_AES192_OFB 0x00000818
#define SGD_AES256_ECB 0x00000821
#define SGD_AES256_CBC 0x00000822
#define SGD_AES256_CFB 0x00000824
#define SGD_AES256_OFB 0x00000828
// DES
#define SGD_DES_ECB 0x00001001
#define SGD_DES_CBC 0x00001002
#define SGD_DES_CFB 0x00001004
#define SGD_DES_OFB 0x00001008
// 3DES_2KEY
#define SGD_D3DES_ECB 0x00001011
#define SGD_D3DES_CBC 0x00001012
#define SGD_D3DES_CFB 0x00001014
#define SGD_D3DES_OFB 0x00001018
// 3DES_3KEY
#define SGD_T3DES_ECB 0x00001021
#define SGD_T3DES_CBC 0x00001022
#define SGD_T3DES_CFB 0x00001024
#define SGD_T3DES_OFB 0x00001028
//<2F>ǶԳ<C7B6>
#define SGD_RSA 0x00010000
#define SGD_SM2_1 0x00020100 // <20><>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD>
#define SGD_SM2_2 0x00020200 // <20><>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Կ<EFBFBD><D4BF><EFBFBD><EFBFBD>Э<EFBFBD><D0AD>
#define SGD_SM2_3 0x00020400 // <20><>Բ<EFBFBD><D4B2><EFBFBD>߼<EFBFBD><DFBC><EFBFBD><EFBFBD>
//<2F>Ӵ<EFBFBD><D3B4><EFBFBD><E3B7A8>־
#define SGD_SM3 0x00000001
#define SGD_SHA1 0x00000002
#define SGD_SHA256 0x00000004
#define SKF_USE_ENCDEC 0x01 //<2F><><EFBFBD>ڼ<EFBFBD><DABC>ܽ<EFBFBD><DCBD><EFBFBD>
#define SKF_USE_SIGVER 0x02 //<2F><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>֤
/**
* @enum
*/
enum PerformanceAlgMode
{
P_AlG_ECB,
P_AlG_CBC,
P_AlG_CFB,
P_AlG_OFB
};
enum EccKeyPairType
{
CryptKey,
SignatureKey
};
/**
* @brief
*
* @return int 0
*/
int Device_Init();
/**
* @brief
*
* @param IP IP
* @return int 0
*/
int Device_Init_IP(unsigned char *IP);
// int Unlock_Application_PIN(unsigned char *AdminPin, unsigned char *NewUserPIN, unsigned int *RetryCount);
// int Change_Application_PIN(unsigned char *Old, unsigned char *New, unsigned int *RetryCount);
// int Verify_Application_PIN(unsigned char *PIN, unsigned int *RetryCount);
/**
* @brief
*
* @param iKeyNum 使
* @return int 0
*/
int Device_Init_KeyNum(int iKeyNum);
/**
* @brief
*
* @param SourceData
* @param SourceDataLen
* @param HashData
* @param HashDataLen
* @param EccPublickey
* @param HashType SGD_SM3
* @return int 0
*/
int Generate_Hash(unsigned char *SourceData, unsigned int SourceDataLen, unsigned char *HashData, unsigned int *HashDataLen, unsigned char *EccPublickey, unsigned int HashType);
/**
* @brief
*
* @param ucRandom
* @param ulRandomLen
* @return int 0
*/
int Generate_Rand(unsigned char *ucRandom, unsigned int ulRandomLen);
/**
* @brief
*
* @param SignData
* @param SignDataLen
* @param EccSignBlobData
* @param EccSignBlobDatalen
* @return int 0
*/
int Generate_SignData_IntPrikey(unsigned char *SignData, unsigned int SignDataLen, unsigned char *EccSignBlobData, unsigned int *EccSignBlobDatalen);
/**
* @brief
*
* @param EccPrikey
* @param SignData
* @param SignDataLen
* @param EccSignBlobData
* @param EccSignBlobDataLen
* @return int 0
*/
int Generate_SignData_ExtPrikey(unsigned char *EccPrikey, unsigned char *SignData, unsigned int SignDataLen, unsigned char *EccSignBlobData, unsigned int *EccSignBlobDataLen);
/**
* @brief
*
* @param EccPublickey
* @param SignatureData
* @param SignDataLen
* @param EccSignBlobData
* @param EccSignBlobDataLen
* @return int 0
*/
int Verify_SignData_ExtPubkey(unsigned char *EccPublickey, unsigned char *SignatureData, unsigned int SignDataLen, unsigned char *EccSignBlobData, unsigned int EccSignBlobDataLen);
/**
* @brief
*
* @param EPublickey
* @param InData
* @param InDataLen
* @param ECCCIPPHERData
* @param ECCCIPPHERDataLen
* @return int 0
*/
int SM2_3_Encrypt_ExtPubkey(unsigned char *EPublickey, unsigned char *InData, unsigned int InDataLen, unsigned char *ECCCIPPHERData, unsigned int *ECCCIPPHERDataLen);
/**
* @brief
*
* @param EPrikey
* @param ECCCIPPHERData
* @param ECCCIPPHERDataLen
* @param OutData
* @param OutDataLen
* @return int 0
*/
int SM2_3_Decrypt_ExtPrikey(unsigned char *EPrikey, unsigned char *ECCCIPPHERData, unsigned int ECCCIPPHERDataLen, unsigned char *OutData, unsigned int *OutDataLen);
/**
* @brief
*
* @param ECCCIPPHERData
* @param ECCCIPPHERDataLen
* @param OutData
* @param OutDataLen
* @return int 0
*/
int SM2_3_Decrypt_IntPrikey(unsigned char *ECCCIPPHERData, unsigned int ECCCIPPHERDataLen, unsigned char *OutData, unsigned int *OutDataLen);
/**
* @brief
*
* @param ECCCIPPHERData
* @param ECCCIPPHERDataLen
* @param OutData
* @param OutDataLen
* @return int 0
*/
int SM2_3_Decrypt_IntCryptPrikey(unsigned char *ECCCIPPHERData, unsigned int ECCCIPPHERDataLen, unsigned char *OutData, unsigned int *OutDataLen);
/**
* @brief SM1加密
*
* @param AlgMode enum PerformanceAlgMode
* @param pIv IV
* @param Key Key
* @param KeyLen Key长度
* @param InData
* @param InDataLen
* @param OutData
* @param OutDataLen
* @return int 0
*/
int SM1_Encrypt(
const int AlgMode, unsigned char *pIv, unsigned char *Key, unsigned int KeyLen,
unsigned char *InData, unsigned int InDataLen, unsigned char *OutData, unsigned int *OutDataLen);
/**
* @brief SM1解密
*
* @param AlgMode enum PerformanceAlgMode
* @param pIv IV
* @param Key Key
* @param KeyLen Key长度
* @param InData
* @param InDataLen
* @param OutData
* @param OutDataLen
* @return int 0
*/
int SM1_Decrypt(
const int AlgMode, unsigned char *pIv, unsigned char *Key, unsigned int KeyLen,
unsigned char *InData, unsigned int InDataLen, unsigned char *OutData, unsigned int *OutDataLen);
/**
* @brief SM4加密
*
* @param AlgMode enum PerformanceAlgMode
* @param pIv IV
* @param Key Key
* @param KeyLen Key长度
* @param InData
* @param InDataLen
* @param OutData
* @param OutDataLen
* @return int 0
*/
int SM4_Encrypt(
const int AlgMode, unsigned char *pIv, unsigned char *Key, unsigned int KeyLen,
unsigned char *InData, unsigned int InDataLen, unsigned char *OutData, unsigned int *OutDataLen);
/**
* @brief SM4解密
*
* @param AlgMode enum PerformanceAlgMode
* @param pIv IV
* @param Key Key
* @param KeyLen Key长度
* @param InData
* @param InDataLen
* @param OutData
* @param OutDataLen
* @return int 0
*/
int SM4_Decrypt(
const int AlgMode, unsigned char *pIv, unsigned char *Key, unsigned int KeyLen,
unsigned char *InData, unsigned int InDataLen, unsigned char *OutData, unsigned int *OutDataLen);
/**
* @brief
*
* @return int 0
*/
int Generate_ECCKeyPair();
/**
* @brief
*
* @param KeyPairtype enum EccKeyPairType
* @param publickey
* @return int 0
*/
int Export_publickey(unsigned int KeyPairtype, unsigned char *publickey);
/**
* @brief
*
* @param KeyPairtype enum EccKeyPairType
* @param Privatkey
* @param Publickey
* @return int 0
*/
int Import_ECCKeyPair(unsigned int KeyPairtype, unsigned char *Privatkey, unsigned char *Publickey);
// int Import_ECCKeyPair_Ciphertext(unsigned char *KeyPairCiphertext, unsigned int KeyPairCiphertextLen);
/**
* @brief
*
* @param CerType
* @param InData
* @param InDataLen
* @return int 0
*/
int Import_Certificate(unsigned int CerType, char *InData, unsigned int InDataLen);
/**
* @brief
*
* @param CerType
* @param OutData
* @param OutDataLen
* @return int 0
*/
int Export_Certificate(unsigned int CerType, char *OutData, unsigned int *OutDataLen);
/**
* @brief
*
* @param FileName
* @param InData
* @param InDataLen
* @return int 0
*/
int ImportFile(char* FileName, char *InData, int InDataLen);
/**
* @brief
*
* @param FileName
* @param OutData
* @param OutDataLen
* @return int 0
*/
int ExportFile(char *FileName, char *OutData, int *OutDataLen);
/**
* @brief HWCode
*
* @param HwCode HWCode缓冲区
* @return int 0
*/
int Get_Hwcode(unsigned char *HwCode);
/**
* @brief
*
* @param DevInfo
* @return int 0
*/
int Get_DevInfo(unsigned char *DevInfo);
// int Device_Status();
/**
* @brief
*
*/
void Close_Device();
// void Clear_Device_App();
#endif

1252
AWSM/src/AWSM.c Normal file

File diff suppressed because it is too large Load Diff

92
AWSMServer/AWSMServer.c Normal file
View File

@ -0,0 +1,92 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "VSConfig.h"
#include "ZMQLayout.h"
#include "AWSMCall.h"
#define CallXXX(XXX, XXXLEN) \
if(psZMQBuf->iBufLen > (XXXLEN) && !strncmp(psZMQBuf->pcBuf, (#XXX), (XXXLEN))) \
{ \
psReply = Call##XXX (psZMQBuf->pcBuf + (XXXLEN), psZMQBuf->iBufLen - (XXXLEN)); \
}
static char pcAddress[512] = "tcp://localhost:60006";
int main()
{
int rv = AWSMCallInit();
if(rv) { printf("rv = %x", rv); return 0; }
static char pcIP[128] = "localhost";
static char pcPort[32] = "60006";
VSConfig_s psConfig[] =
VSConfigStart
VSConfigString("IP", pcIP, 128, "IP")
VSConfigString("Port", pcPort, 32, "Port")
VSConfigEnd
if(!VSConfig(psConfig, "../config/AWSMRPC.conf") || !VSConfig(psConfig, "/etc/awconfig/AWSMRPC.conf"))
snprintf(pcAddress, 512, "tcp://%s:%s", pcIP, pcPort);
printf("%s\n", pcAddress);
pZMQ_s psZMQ = ZMQServerInit(pcAddress);
if(!psZMQ) { printf("ZMQServerInit fail\n"); return 0; }
int iCnt = 0;
pZMQBuf_s psZMQBuf = NULL;
pAWSMProtobuf_s psReply = NULL;
while(1)
{
psZMQBuf = ZMQRecv(psZMQ, -1);
if(!psZMQBuf) { printf("ZMQRecv fail\n"); break; }
CallXXX(Hash, 4)
else CallXXX(Rand, 4)
else CallXXX(SignatureByIntPrikey, 20)
else CallXXX(SignatureByExtPrikey, 20)
else CallXXX(VerifySignature, 15)
else CallXXX(SM2EncryptByExtPubKey, 21)
else CallXXX(SM2DecryptByExtPrikey, 21)
else CallXXX(SM2DecryptByIntPrikey, 21)
else CallXXX(SM2DecryptByIntCryptPrikey, 26)
else CallXXX(SM1Encrypt, 10)
else CallXXX(SM1Decrypt, 10)
else CallXXX(SM4Encrypt, 10)
else CallXXX(SM4Decrypt, 10)
else CallXXX(GenerateECCKeyPair, 18)
else CallXXX(ExportPubkey, 12)
else CallXXX(ImportKeyPair, 13)
else CallXXX(ImportCertificate, 17)
else CallXXX(ExportCertificate, 17)
else CallXXX(ImportFile, 10)
else CallXXX(ExportFile, 10)
else CallXXX(GetHwcode, 9)
else CallXXX(GetDevInfo, 10)
if(psReply)
{
ZMQSend(psZMQ, psReply->pcBuf, psReply->iBufLen);
AWSMProtobufDestroy(psReply); psReply = NULL;
}
else
{
ZMQSend(psZMQ, "{ \"code\":501, \"msg\"=\"Unknow method\" }", 38);
}
ZMQBufDestroy(psZMQBuf); psZMQBuf = NULL;
}
ZMQDestroy(psZMQ);
AWSMCallDestroy();
return 0;
}

26
AWSMServer/CMakeLists.txt Normal file
View File

@ -0,0 +1,26 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
PROJECT(AWSMServer)
AUX_SOURCE_DIRECTORY(${PROJECT_SOURCE_DIR}/src src_list)
ADD_EXECUTABLE(${PROJECT_NAME} ${src_list} ${PROJECT_SOURCE_DIR}/AWSMServer.c)
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME}
PRIVATE
${PROJECT_SOURCE_DIR}/include)
TARGET_LINK_DIRECTORIES(${PROJECT_NAME}
PRIVATE
${CMAKE_SOURCE_DIR}/lib
)
TARGET_LINK_LIBRARIES(${PROJECT_NAME}
PUBLIC
pthread
m
server-sm
stdc++
VSConfig
VSClock
ZMQLayout
AWSMProtobuf)

222
AWSMServer/include/AWSDF.h Normal file
View File

@ -0,0 +1,222 @@
/**
*
*
* sm1对称加密算法sm2签名加密算法sm3杂凑算法sm4对称加密算法
*
* @author void_sora
* @date 2021/02/20
* @version 0.9
*/
#ifndef __AWSDF_H__
#define __AWSDF_H__
#include "sdf.h"
#include "sdf_dev_manage.h"
// // PIN<49>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
// #define ADMIN_TYPE 0
// #define USER_TYPE 1
// //<2F><EFBFBD><E3B7A8>־
// // SM1
// #define SGD_SM1_ECB 0x00000101
// #define SGD_SM1_CBC 0x00000102
// #define SGD_SM1_CFB 0x00000104
// #define SGD_SM1_OFB 0x00000108
// #define SGD_SM1_MAC 0x00000110
// // SM4
// #define SGD_SMS4_ECB 0x00000401
// #define SGD_SMS4_CBC 0x00000402
// #define SGD_SMS4_CFB 0x00000404
// #define SGD_SMS4_OFB 0x00000408
// // AES
// #define SGD_AES128_ECB 0x00000801
// #define SGD_AES128_CBC 0x00000802
// #define SGD_AES128_CFB 0x00000804
// #define SGD_AES128_OFB 0x00000808
// #define SGD_AES192_ECB 0x00000811
// #define SGD_AES192_CBC 0x00000812
// #define SGD_AES192_CFB 0x00000814
// #define SGD_AES192_OFB 0x00000818
// #define SGD_AES256_ECB 0x00000821
// #define SGD_AES256_CBC 0x00000822
// #define SGD_AES256_CFB 0x00000824
// #define SGD_AES256_OFB 0x00000828
// // DES
// #define SGD_DES_ECB 0x00001001
// #define SGD_DES_CBC 0x00001002
// #define SGD_DES_CFB 0x00001004
// #define SGD_DES_OFB 0x00001008
// // 3DES_2KEY
// #define SGD_D3DES_ECB 0x00001011
// #define SGD_D3DES_CBC 0x00001012
// #define SGD_D3DES_CFB 0x00001014
// #define SGD_D3DES_OFB 0x00001018
// // 3DES_3KEY
// #define SGD_T3DES_ECB 0x00001021
// #define SGD_T3DES_CBC 0x00001022
// #define SGD_T3DES_CFB 0x00001024
// #define SGD_T3DES_OFB 0x00001028
// //<2F>ǶԳ<C7B6>
// #define SGD_RSA 0x00010000
// #define SGD_SM2_1 0x00020100 // <20><>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD>
// #define SGD_SM2_2 0x00020200 // <20><>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Կ<EFBFBD><D4BF><EFBFBD><EFBFBD>Э<EFBFBD><D0AD>
// #define SGD_SM2_3 0x00020400 // <20><>Բ<EFBFBD><D4B2><EFBFBD>߼<EFBFBD><DFBC><EFBFBD><EFBFBD>
// //<2F>Ӵ<EFBFBD><D3B4><EFBFBD><E3B7A8>־
// #define SGD_SM3 0x00000001
// #define SGD_SHA1 0x00000002
// #define SGD_SHA256 0x00000004
// #define SKF_USE_ENCDEC 0x01 //<2F><><EFBFBD>ڼ<EFBFBD><DABC>ܽ<EFBFBD><DCBD><EFBFBD>
// #define SKF_USE_SIGVER 0x02 //<2F><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>֤
/**
* @enum
*/
enum PerformanceAlgMode
{
P_AlG_ECB,
P_AlG_CBC,
P_AlG_CFB,
P_AlG_OFB
};
enum SDFEccKeyPairType
{
SDFEncryptKey,
SDFSignatureKey
};
/**
* @struct AWSDF隐式结构
*/
typedef struct AWSDF_S AWSDF_s, *pAWSDF_s;
/**
* @struct AWSDF方法结结构体
*/
typedef struct AWSDF_F
{
pAWSDF_s (*Malloc)();
void (*Free)(pAWSDF_s spAWSDF);
int (*Create)(pAWSDF_s spAWSDF, unsigned char *AdminPIN, unsigned char *PIN, unsigned int ContainerCount);
int (*Open)(pAWSDF_s spAWSDF, unsigned char *PIN);
int (*Close)(pAWSDF_s spAWSDF);
int (*Destroy)(pAWSDF_s spAWSDF, unsigned char *AdminPIN, unsigned char *UserPIN);
int (*GetContainerCount)(pAWSDF_s spAWSDF);
int (*ChangePIN)(pAWSDF_s spAWSDF, unsigned char *OldPIN, unsigned char *NewPIN);
int (*UnlockPIN)(pAWSDF_s spAWSDF);
int (*GenerateRandom)(pAWSDF_s spAWSDF, unsigned char *Random, unsigned int RandomLen);
int (*GenerateHash)(pAWSDF_s spAWSDF, unsigned char *SourceData, unsigned int SourceDataLen, unsigned char *Hash, unsigned int *HashLen, unsigned char *Publickey);
int (*GetHwcode)(pAWSDF_s spAWSDF, unsigned char *HwCode, unsigned int *HwCodeLen);
int (*GetDevInfo)(pAWSDF_s spAWSDF, unsigned char *DevInfo, unsigned int *DevInfoLen);
int (*FreeData)(unsigned char *Data);
int (*FileInit)(pAWSDF_s spAWSDF, char *FileName, unsigned int FileSize);
int (*GetFileNameList)(pAWSDF_s spAWSDF, char *FileList, unsigned int *FileListSize);
int (*FileWrite)(pAWSDF_s spAWSDF, char *FileName, unsigned int Offset, unsigned char *Data, unsigned int DataLen);
int (*FileRead)(pAWSDF_s spAWSDF, unsigned char *FileName, unsigned int Offset, unsigned char *Data, unsigned int *DataLen);
int (*FileDestroy)(pAWSDF_s spAWSDF, unsigned char *FileName);
int (*GenerateEccKeyPair)(pAWSDF_s spAWSDF, unsigned char *Prikey, unsigned char *Pubkey);
int (*ResetContainerEccKeyPair)(pAWSDF_s spAWSDF, unsigned int ContainerNumber);
int (*ImportPlaintextContainerECCKeyPair)(
pAWSDF_s spAWSDF, unsigned int ContainerNumber, unsigned int KeyPairtype,
unsigned char *Prikey, unsigned char *Pubkey);
int (*ImportContainerECCKeyPair)(
pAWSDF_s spAWSDF, unsigned int ContainerNumber,
unsigned char *KeyPairCiphertext, unsigned int KeyPairCiphertextLen);
int (*ExportContainerPubkey)(pAWSDF_s spAWSDF, unsigned int ContainerNumber, unsigned int KeyPairtype, unsigned char *Pubkey);
int (*GenerateSignatureExt)(
pAWSDF_s spAWSDF, unsigned char *Prikey,
unsigned char *Data, unsigned int DataLen, unsigned char *Signature, unsigned int *SignatureLen);
int (*GenerateSignatureInt)(
pAWSDF_s spAWSDF, unsigned int ContainerNumber,
unsigned char *Data, unsigned int DataLen, unsigned char *Signature, unsigned int *SignatureLen);
int (*VerifySignatureExt)(
pAWSDF_s spAWSDF, unsigned char *Pubkey,
unsigned char *Data, unsigned int DataLen, unsigned char *Signature, unsigned int SignatureLen);
int (*VerifySignatureInt)(
pAWSDF_s spAWSDF, unsigned int ContainerNumber,
unsigned char *Data, unsigned int DataLen, unsigned char *Signature, unsigned int SignatureLen);
int (*SM2EncryptExt)(
pAWSDF_s spAWSDF, unsigned char *Pubkey,
unsigned char *Data, unsigned int DataLen, unsigned char *Ciphertext, unsigned int *CiphertextLen);
int (*SM2EncryptInt)(
pAWSDF_s spAWSDF, unsigned int ContainerNumber, unsigned int KeyPairtype,
unsigned char *Data, unsigned int DataLen, unsigned char *Ciphertext, unsigned int *CiphertextLen);
int (*SM2DecryptExt)(
pAWSDF_s spAWSDF, unsigned char *PriKey,
unsigned char *Ciphertext, unsigned int CiphertextLen, unsigned char *Data, unsigned int *DataLen);
int (*SM2DecryptInt)(
pAWSDF_s spAWSDF, unsigned int ContainerNumber, unsigned int KeyPairtype,
unsigned char *Ciphertext, unsigned int CiphertextLen, unsigned char *Data, unsigned int *DataLen);
int (*SM1Encrypt)(
pAWSDF_s spAWSDF, int AlgMode, unsigned char *pIv, unsigned char *Key,
unsigned char *Data, unsigned int DataLen, unsigned char *Ciphertext, unsigned int *CiphertextLen);
int (*SM1Decrypt)(
pAWSDF_s spAWSDF, int AlgMode, unsigned char *pIv, unsigned char *Key,
unsigned char *Ciphertext, unsigned int CiphertextLen, unsigned char *Data, unsigned int *DataLen);
int (*SM4Encrypt)(
pAWSDF_s spAWSDF, int AlgMode, unsigned char *pIv, unsigned char *Key,
unsigned char *Data, unsigned int DataLen, unsigned char *Ciphertext, unsigned int *CiphertextLen);
int (*SM4Decrypt)(
pAWSDF_s spAWSDF, int AlgMode, unsigned char *pIv, unsigned char *Key,
unsigned char *Ciphertext, unsigned int CiphertextLen, unsigned char *Data, unsigned int *DataLen);
}AWSDF_f, *pAWSDF_f;
pAWSDF_f AWSDFFunInit();
void AWSDFFunDestroy(pAWSDF_f fpAWSDF);
#endif

View File

@ -0,0 +1,66 @@
#ifndef __AWSMCALL_H__
#define __AWSMCALL_H__
#include "AWSM.pb-c.h"
typedef struct AWSMProtobuf_S
{
char *pcBuf;
int iBufLen;
}AWSMProtobuf_s, *pAWSMProtobuf_s;
void AWSMProtobufDestroy(pAWSMProtobuf_s);
int AWSMCallInit();
void AWSMCallDestroy();
pAWSMProtobuf_s CallInit(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallDestroy(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallHash(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallRand(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallSignatureByIntPrikey(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallSignatureByExtPrikey(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallVerifySignature(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallSM2EncryptByExtPubKey(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallSM2DecryptByExtPrikey(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallSM2DecryptByIntPrikey(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallSM2DecryptByIntCryptPrikey(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallSM1Encrypt(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallSM1Decrypt(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallSM4Encrypt(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallSM4Decrypt(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallGenerateECCKeyPair(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallExportPubkey(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallImportKeyPair(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallImportCertificate(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallExportCertificate(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallImportFile(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallExportFile(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallGetHwcode(const char *pcProtoBuf, const int iProtoBufLen);
pAWSMProtobuf_s CallGetDevInfo(const char *pcProtoBuf, const int iProtoBufLen);
#endif

46
AWSMServer/include/base_type.h Executable file
View File

@ -0,0 +1,46 @@
#ifndef __BASE_TYPE_DEF_H__
#define __BASE_TYPE_DEF_H__ 1
#ifdef _WIN32
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
//#define WIN32_LEAN_AND_MEAN
#include <windows.h>
typedef HANDLE HDEV;
#define __func__ __FUNCTION__
#else /* linux */
#include <stdbool.h>
#include <stddef.h>
#ifdef DRIVER_SDKEY
typedef int HDEV;
#endif
typedef void* HANDLE;
typedef short BOOL;
#define _GNU_SOURCE
#define __USE_GNU
#endif
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned long ULONG;
typedef unsigned char BYTE;
typedef char * LPSTR;
typedef unsigned long DWORD;
typedef unsigned char * PBYTE;
typedef int INT_PTR;
#define NULL_PTR ((void *)0)
//#include <xchar.h>
#endif /* __BASE_TYPE_DEF_H__ */

126
AWSMServer/include/sdf.h Executable file
View File

@ -0,0 +1,126 @@
#ifndef __SDF_FUNC_H__
#define __SDF_FUNC_H__
#include <base_type.h>
#include <sdf_type.h>
#ifdef __cplusplus
extern "C" {
#endif
/*device manage*/
int SDF_OpenDevice(void **phDeviceHandle);
int SDF_CloseDevice(void *hDeviceHandle);
int SDF_OpenSession(void *hDeviceHandle, void **phSessionHandle);
int SDF_CloseSession(void *hSessionHandle);
//int SDF_SecLock(void *hSessionHandle, unsigned int time);
//int SDF_SecUnlock(void *hSessionHandle);
int SDF_GetDeviceInfo(void *hSessionHandle, DEVICEINFO *pstDeviceInfo);
int SDF_GenerateRandom(void *hSessionHandle, unsigned int uiLength, unsigned char * pucRandom);
int SDF_GetPrivateKeyAccessRight(void *hSessionHandle, unsigned int uiKeyIndex, unsigned char *pucPassword, unsigned int uiPwdLength);
int SDF_ReleasePrivateKeyAccessRight(void *hSessionHandle, unsigned int uiKeyIndex);
/*key manage*/
int SDF_ExportSignPublicKey_RSA(void *hSessionHandle, unsigned int uiKeyIndex, RSArefPublicKey *pucPublicKey);
int SDF_ExportEncPublicKey_RSA(void *hSessionHandle, unsigned int uiKeyIndex, RSArefPublicKey *pucPublicKey);
int SDF_GenerateKeyPair_RSA(void *hSessionHandle, unsigned int uiKeyBits, RSArefPublicKey *pucPublicKey, RSArefPrivateKey *pucPrivateKey);
int SDF_GenerateKeyWithIPK_RSA(void *hSessionHandle, unsigned int uiIPKIndex, unsigned int uiKeyBits,
unsigned char *pucKey, unsigned int *puiKeyLength, void **phKeyHandle);
int SDF_GenerateKeyWithEPK_RSA(void *hSessionHandle, unsigned int uiKeyBits, RSArefPublicKey *pucPublicKey,
unsigned char *pucKey, unsigned int *puiKeyLength, void **phKeyHandle);
int SDF_ImportKeyWithISK_RSA(void *hSessionHandle, unsigned int uiISKIndex, unsigned char *pucKey,
unsigned int puiKeyLength, void **phKeyHandle);
int SDF_ExchangeDigitEnvelopeBaseOnRSA(void *hSessionHandle, unsigned int uiKeyIndex, RSArefPublicKey *pucPublicKey,
unsigned char *pucDEInput, unsigned int uiDELength, unsigned char *pucDEOutput, unsigned int *puiDELength);
int SDF_ExportSignPublicKey_ECC(void *hSessionHandle, unsigned int uiKeyIndex, ECCrefPublicKey *pucPublicKey);
int SDF_ExportEncPublicKey_ECC(void *hSessionHandle, unsigned int uiKeyIndex, ECCrefPublicKey *pucPublicKey);
int SDF_GenerateKeyPair_ECC(void *hSessionHandle, unsigned int uiAlgID, unsigned int uiKeyBits,
ECCrefPublicKey *pucPublicKey, ECCrefPrivateKey *pucPrivateKey);
int SDF_GenerateKeyWithIPK_ECC(void *hSessionHandle, unsigned int uiIPKIndex, unsigned int uiKeyBits,
ECCCipher *pucKey, void **phKeyHandle);
int SDF_GenerateKeyWithEPK_ECC(void *hSessionHandle, unsigned int uiKeyBits, unsigned int uiAlgID,
ECCrefPublicKey *pucPublicKey, ECCCipher *pucKey, void **phKeyHandle);
int SDF_ImportKeyWithISK_ECC(void *hSessionHandle, unsigned int uiISKIndex, ECCCipher *pucKey, void **phKeyHandle);
int EVDF_ExportKeyWithEPK_ECC(void *hSessionHandle, void *hKeyHandle, ECCrefPublicKey *pucPublicKey, ECCCipher *pucKey);
int SDF_GenerateAgreementDataWithECC(void *hSessionHandle, unsigned int uiISKIndex, unsigned int uiKeyBits, unsigned char *pucSponsorID,
unsigned int uiSponsorIDLength, ECCrefPublicKey *pucSponsorPublicKey, ECCrefPublicKey *pucSponsorTmpPublicKey, void **phAgreementHandle);
int SDF_GenerateKeyWithECC(void *hSessionHandle, unsigned char *pucResponseID, unsigned int uiResponseIDLength,
ECCrefPublicKey *pucResponsePublicKey, ECCrefPublicKey *pucResponseTmpPublicKey, void *hAgreementHandle, void **phKeyHandle);
int SDF_GenerateAgreementDataAndKeyWithECC(void *hSessionHandle, unsigned int uiISKIndex, unsigned int uiKeyBits, unsigned char *pucResponseID,
unsigned int uiResponseIDLength, unsigned char *pucSponsorID, unsigned int uiSponsorIDLength, ECCrefPublicKey *pucSponsorPublicKey,
ECCrefPublicKey *pucSponsorTmpPublicKey, ECCrefPublicKey *pucResponsePublicKey, ECCrefPublicKey *pucResponseTmpPublicKey, void **phKeyHandle);
int SDF_ExchangeDigitEnvelopeBaseOnECC(void *hSessionHandle, unsigned int uiKeyIndex, unsigned int uiAlgID,
ECCrefPublicKey*pucPublicKey, ECCCipher *pucEncDataIn, ECCCipher *pucEncDataOut);
int SDF_GenerateKeyWithKEK(void *hSessionHandle, unsigned int uiKeyBits, unsigned int uiAlgID, unsigned int uiKEKIndex,
unsigned char * pucKey, unsigned int * puiKeyLength, void * *phKeyHandle);
int SDF_ImportKeyWithKEK(void *hSessionHandle, unsigned int uiAlgID, unsigned int uiKEKIndex, unsigned char * pucKey, unsigned int puiKeyLength, void * *phKeyHandle);
int EVDF_ImportKeyWithSessionKey(void *hSessionHandle, unsigned int uiAlgID, void *hSessionKeyHandle, unsigned char * pucKey, unsigned int puiKeyLength, void * *phKeyHandle);
int EVDF_SetKey(void *hSessionHandle, unsigned char *pucKey, unsigned int uiKeyLength, void **phKeyHandle);
int SDF_ImportKey(void *hSessionHandle, unsigned char *pucKey, unsigned int uiKeyLength, void **phKeyHandle);
int SDF_DestroyKey(void *hSessionHandle, void *hKeyHandle);
/*asym*/
int SDF_ExternalPublicKeyOperation_RSA(void *hSessionHandle, RSArefPublicKey *pucPublicKey, unsigned char *pucDataInput,
unsigned int uiInputLength, unsigned char *pucDataOutput, unsigned int *puiOutputLength);
int SDF_ExternalPrivateKeyOperation_RSA(void *hSessionHandle, RSArefPrivateKey *pucPrivateKey, unsigned char *pucDataInput,
unsigned int uiInputLength, unsigned char *pucDataOutput, unsigned int *puiOutputLength);
int SDF_InternalPublicKeyOperation_RSA(void *hSessionHandle, unsigned int uiKeyIndex, unsigned char *pucDataInput,
unsigned int uiInputLength, unsigned char *pucDataOutput, unsigned int *puiOutputLength);
int SDF_InternalPrivateKeyOperation_RSA(void *hSessionHandle, unsigned int uiKeyIndex, unsigned char *pucDataInput,
unsigned int uiInputLength, unsigned char *pucDataOutput, unsigned int *puiOutputLength);
int SDF_ExternalSign_ECC(void *hSessionHandle, unsigned int uiAlgID, ECCrefPrivateKey *pucPrivateKey,
unsigned char *pucData, unsigned int uiDataLength, ECCSignature *pucSignature);
int SDF_ExternalVerify_ECC(void *hSessionHandle, unsigned int uiAlgID, ECCrefPublicKey *pucPublicKey,
unsigned char *pucDataInput, unsigned int uiInputLength, ECCSignature *pucSignature);
int SDF_InternalSign_ECC(void *hSessionHandle, unsigned int uiISKIndex, unsigned char *pucData,
unsigned int uiDataLength, ECCSignature *pucSignature);
int SDF_InternalVerify_ECC(void *hSessionHandle, unsigned int uiIPKIndex, unsigned char *pucData,
unsigned int uiDataLength, ECCSignature *pucSignature);
int SDF_ExternalEncrypt_ECC(void *hSessionHandle, unsigned int uiAlgID, ECCrefPublicKey *pucPublicKey,
unsigned char *pucData, unsigned int uiDataLength, ECCCipher *pucEncData);
int SDF_ExternalDecrypt_ECC(void *hSessionHandle, unsigned int uiAlgID, ECCrefPrivateKey *pucPrivateKey,
ECCCipher *pucEncData , unsigned char *pucData, unsigned int *puiDataLength);
int SDF_InternalEncrypt_ECC(void *hSessionHandle, unsigned int uiIPKIndex,unsigned char *pucData,
unsigned int uiDataLength, ECCCipher *pucEncData);
int SDF_InternalDecrypt_ECC(void *hSessionHandle, unsigned int uiISKIndex, ECCCipher *pucEncData ,
unsigned char *pucData, unsigned int *puiDataLength);
/*symm*/
int SDF_Encrypt(void *hSessionHandle, void *hKeyHandle, unsigned int uiAlgID, unsigned char *pucIV,
unsigned char *pucData, unsigned int uiDataLength, unsigned char *pucEncData, unsigned int *puiEncDataLength);
int SDF_Decrypt(void *hSessionHandle, void *hKeyHandle, unsigned int uiAlgID, unsigned char *pucIV,
unsigned char *pucEncData, unsigned int uiEncDataLength, unsigned char *pucData, unsigned int *puiDataLength);
int SDF_CalculateMAC(void *hSessionHandle, void *hKeyHandle, unsigned int uiAlgID, unsigned char *pucIV,
unsigned char *pucData, unsigned int uiDataLength, unsigned char *pucMAC, unsigned int *puiMACLength);
/* hash */
int SDF_HashInit(void *hSessionHandle, unsigned int uiAlgID, ECCrefPublicKey *pucPublicKey,
unsigned char *pucID, unsigned int uiIDLength);
int SDF_HashUpdate(void *hSessionHandle, unsigned char *pucData, unsigned int uiDataLength);
int EVDF_HashUpdateWithKey(void *hSessionHandle, void *hKeyHandle, unsigned int uiKeyFormat);
int SDF_HashFinal(void *hSessionHandle, unsigned char *pucHash, unsigned int *puiHashLength);
int EVDF_HMACInit(void *hSessionHandle, unsigned int uiAlgID, unsigned char *pucKey, unsigned int uiKeyLength);
int EVDF_HMACUpdate(void *hSessionHandle, unsigned char *pucData, unsigned int uiDataLength);
int EVDF_HMACFinal(void *hSessionHandle, unsigned char *pucHMAC, unsigned int *puiHMACLength);
/* file */
int SDF_CreateFile(void *hSessionHandle, unsigned char *pucFileName, unsigned int uiNameLen, unsigned int uiFileSize);
int SDF_ReadFile(void *hSessionHandle, unsigned char *pucFileName, unsigned int uiNameLen,
unsigned int uiOffset, unsigned int *puiFileLength, unsigned char *pucBuffer);
int SDF_WriteFile(void *hSessionHandle, unsigned char *pucFileName, unsigned int uiNameLen,
unsigned int uiOffset, unsigned int uiFileLength, unsigned char *pucBuffer);
int SDF_DeleteFile(void *hSessionHandle, unsigned char *pucFileName, unsigned int uiNameLen);
int EVDF_EnumFiles(void *hSessionHandle, char *szFileList, unsigned int *puiSize);
#define SDF_ExportKeyWithEPK_ECC EVDF_ExportKeyWithEPK_ECC
#define SDF_ImportKeyWithSessionKey EVDF_ImportKeyWithSessionKey
#define SDF_SetKey EVDF_SetKey
#define SDF_HashUpdateWithKey EVDF_HashUpdateWithKey
#ifdef __cplusplus
};
#endif
#endif /*__SDF_FUNC_H__*/

View File

@ -0,0 +1,67 @@
#ifndef __SDF_DEV_MANAGE_H__
#define __SDF_DEV_MANAGE_H__
#include <base_type.h>
#include <sdf_type.h>
#ifdef __cplusplus
extern "C" {
#endif
int EVDF_CreateKeyPair_ECC(void *hSessionHandle, unsigned int uiSignFlag, unsigned int uiKeyIndex, ECCrefPublicKey *pucPublicKey);
int EVDF_ImportKeyPair_ECC(void *hSessionHandle, unsigned int uiSignFlag, unsigned int uiKeyIndex, ECCrefPublicKey *pucPublicKey, ECCrefPrivateKey *pucPrivateKey);
int EVDF_ImportEncKeyPair_ECC(void *hSessionHandle, unsigned int uiKeyIndex, PENVELOPEDKEYBLOB pBlob);
int EVDF_DeleteInternalKeyPair_ECC (void *hSessionHandle, unsigned int uiSignFlag, unsigned int uiKeyIndex, char *AdminPIN);
int EVDF_CreateKeyPair_RSA(void *hSessionHandle, unsigned int uiSignFlag, unsigned int uiKeyIndex, unsigned int uiBitLen, RSArefPublicKey *pucPublicKey);
int EVDF_ImportKeyPair_RSA(void *hSessionHandle, unsigned int uiSignFlag, unsigned int uiKeyIndex, RSArefPrivateKey *pucPrivateKey);
int EVDF_ImportEncKeyPair_RSA (void *hSessionHandle, unsigned int uiKeyIndex, unsigned int ulSymmAlgID, unsigned char *pbWrappedKey,
unsigned int ulWrappedKeyLen, unsigned char *pbEncryptedData, unsigned int ulEncryptedDataLen);
int EVDF_DeleteInternalKeyPair_RSA (void *hSessionHandle, unsigned int uiSignFlag,unsigned int uiKeyIndex, char *AdminPIN);
int EVDF_CreateKEK(void *hSessionHandle, unsigned int uiKeyIndex, unsigned int uiKeyBits);
int EVDF_ImportKEK(void *hSessionHandle, unsigned int uiKeyIndex, unsigned char *pucKey, unsigned int uiKeyBits);
int EVDF_DeleteInternalKEK (void *hSessionHandle, unsigned int uiKeyIndex, char *AdminPIN);
int EVDF_GetPINInfo(void *hSessionHandle, unsigned int uiKeyIndex, unsigned int uiPINType,
unsigned int *puiMaxRetryCount, unsigned int *puiRemainRetryCount);
int EVDF_ChangePIN(void *hSessionHandle, unsigned int uiKeyIndex, unsigned int uiPINType,
char *OldPIN, char *NewPIN, unsigned int *puiRetry);
int EVDF_UnlockPIN(void *hSessionHandle, unsigned int uiKeyIndex, char *AdminPIN, char *NewUserPIN, unsigned int *puiRetry);
int EVDF_GetKeySlotInfo(void *hSessionHandle, unsigned int uiKeyIndex, SlotKeyInfo *pInfo);
int EVDF_GetFirmwareVersion(void *hSessionHandle, unsigned char *pstFirmInfo);
int EVDF_InternalECCDecrypt(void *hSessionHandle, unsigned int uiKeyIndex, unsigned int uiAlgID, ECCCipher *pucEncData, unsigned char *pucData, unsigned int *puiDataLength);
/**
* Initialize the file system and set root key & admin pin & user pin
* @arg hSessionHandle A pointer to the handle of session
* @arg AdminPin A pointer to the admin pin and be verified in cos(if no file system initialized in cos, not be verified)
* @arg pucRootKey A pointer to the rootkey to be set, if NULL create rootkey using random data in cos
* @arg uiKeyBits the bits size of rootkey
* @arg NewAdminPin A pointer to the new admin pin
* @arg NewUserPIN A pointer to the nw user pin
*
* Initialize root key, admin pin, user pin, and file system.
*
* @return error code or 0.
*/
int EVDF_InitKeyFileSystem(void *hSessionHandle, char *AdminPin, unsigned char *pucRootKey, unsigned int uiKeyBits, char *NewAdminPin, char*NewUserPIN);
int EVDF_RestoreFactorySetting(void *hSessionHandle, char *AdminPin);
//int SDF_KeyDistributionPrepare(void *hSessionHandle, char *AdminPin, unsigned char ucStoreKeyNum, unsigned char ucRestoreKeyNum);
//int SDF_KeyDistributionStore(void *hSessionHandle, char *AdminPin, unsigned char ucStoreKeyIndex);
//int SDF_KeyDistributionRestore(void *hSessionHandle, char *AdminPin, unsigned char ucRestoreKeyIndex);
#define SDF_CreateKeyPair_ECC EVDF_CreateKeyPair_ECC
#define SDF_ImportKeyPair_ECC EVDF_ImportKeyPair_ECC
#define SDF_CreateKeyPair_RSA EVDF_CreateKeyPair_RSA
#define SDF_ImportKeyPair_RSA EVDF_ImportKeyPair_RSA
#define SDF_CreateKEK EVDF_CreateKEK
#define SDF_ImportKEK EVDF_ImportKEK
#define SDF_GetPINInfo EVDF_GetPINInfo
#define SDF_ChangePIN EVDF_ChangePIN
#define SDF_UnlockPIN EVDF_UnlockPIN
#define SDF_GetKeySlotInfo EVDF_GetKeySlotInfo
#define SDF_GetFirmwareVersion EVDF_GetFirmwareVersion
#define SDF_InitKeyFileSystem EVDF_InitKeyFileSystem
#define SDF_RestoreFactorySetting EVDF_RestoreFactorySetting
#ifdef __cplusplus
};
#endif
#endif /*__SDF_DEV_MANAGE_H__*/

251
AWSMServer/include/sdf_type.h Executable file
View File

@ -0,0 +1,251 @@
#ifndef __SDF_TYPE_DEF_H__
#define __SDF_TYPE_DEF_H__
typedef struct DeviceInfo_st{
unsigned char IssuerName[40];
unsigned char DeviceName[16];
unsigned char DeviceSerial[16];
unsigned int DeviceVersion;
unsigned int StandardVersion;
unsigned int AsymAlgAbility[2];
unsigned int SymAlgAbility;
unsigned int HashAlgAbility;
unsigned int BufferSize;
}DEVICEINFO;
/* RSA */
#define RSAref_MAX_BITS 2048
#define RSAref_MAX_LEN ((RSAref_MAX_BITS + 7) / 8)
#define RSAref_MAX_PBITS ((RSAref_MAX_BITS + 1) / 2)
#define RSAref_MAX_PLEN ((RSAref_MAX_PBITS + 7) / 8)
typedef struct RSArefPublicKey_st
{
unsigned int bits;
unsigned char m[RSAref_MAX_LEN];
unsigned char e[RSAref_MAX_LEN];
}RSArefPublicKey;
typedef struct RSArefPrivateKey_st
{
unsigned int bits;
unsigned char m[RSAref_MAX_LEN];
unsigned char e[RSAref_MAX_LEN];
unsigned char d[RSAref_MAX_LEN];
unsigned char prime[2][RSAref_MAX_PLEN];
unsigned char pexp[2][RSAref_MAX_PLEN];
unsigned char coef[RSAref_MAX_PLEN];
}RSArefPrivateKey;
/* ECC */
#define ECCref_MAX_BITS 512
#define ECCref_MAX_LEN ((ECCref_MAX_BITS + 7) / 8)
typedef struct ECCrefPublicKey_st
{
unsigned int bits;
unsigned char x[ECCref_MAX_LEN];
unsigned char y[ECCref_MAX_LEN];
}ECCrefPublicKey;
typedef struct ECCrefPrivateKey_st
{
unsigned int bits;
unsigned char K[ECCref_MAX_LEN];
}ECCrefPrivateKey;
typedef struct ECCCipher_st
{
unsigned char x[ECCref_MAX_LEN];
unsigned char y[ECCref_MAX_LEN];
unsigned char M[32];
unsigned int L;
unsigned char C[1];
}ECCCipher;
typedef struct ECCSignature_st
{
unsigned char r[ECCref_MAX_LEN];
unsigned char s[ECCref_MAX_LEN];
}ECCSignature;
/*ecc enveloped key struct*/
#define ECC_MAX_XCOORDINATE_BITS_LEN 512
#define ECC_MAX_YCOORDINATE_BITS_LEN ECC_MAX_XCOORDINATE_BITS_LEN
#define ECC_MAX_MODULUS_BITS_LEN ECC_MAX_XCOORDINATE_BITS_LEN
typedef struct eccpubkeyblob_st
{
unsigned int BitLen;
unsigned char XCoordinate[ECC_MAX_XCOORDINATE_BITS_LEN/8];
unsigned char YCoordinate[ECC_MAX_YCOORDINATE_BITS_LEN/8];
}ECCPUBLICKEYBLOB, *PECCPUBLICKEYBLOB;
typedef struct ecccipherblob_st
{
unsigned char XCoordinate[ECC_MAX_XCOORDINATE_BITS_LEN/8];
unsigned char YCoordinate[ECC_MAX_XCOORDINATE_BITS_LEN/8];
unsigned char Hash[32];
unsigned int CipherLen;
unsigned char Cipher[128];
}ECCCIPHERBLOB, *PECCCIPHERBLOB;
typedef struct SDF_ENVELOPEDKEYBLOB{
unsigned long ulAsymmAlgID;
unsigned long ulSymmAlgID;
ECCCIPHERBLOB ECCCipherBlob;
ECCPUBLICKEYBLOB PubKey;
unsigned char cbEncryptedPrikey[64];
}ENVELOPEDKEYBLOB, *PENVELOPEDKEYBLOB;
typedef struct SlotKeyInfo_st
{
unsigned int slot_key_index;
unsigned int rsa_sign_key_flag;
unsigned int rsa_enc_key_flag;
unsigned int ecc_sign_key_flag;
unsigned int ecc_enc_key_flag;
}SlotKeyInfo;
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define ADMIN_TYPE 1
#define USER_TYPE 0
#define SDF_MAX_PWD_LEN 0x20
#define SDF_MAX_KEY_INDEX 0x0F
#define SDF_MAX_FILE_LEN 0x4000
#define SDF_MODE_RSA_2048 0x800
#define SDF_MODE_RSA_1024 0x400
#define SDF_MODE_ECC_512 0x200
#define SDF_MODE_ECC_256 0x100
#define SDF_ALGO_KEY_LEN_MASK 0x0F00
#define SGD_SLOT_KEY_EXIST_MASK 0x80000000
#define SDF_FILE_NAME_MAX_LEN 128
#define SDF_FILE_MAX_COUNT 16
/* algorithm */
#define SGD_SM1 0x00000100
#define SGD_SM1_ECB 0x00000101
#define SGD_SM1_CBC 0x00000102
#define SGD_SM1_CFB 0x00000104
#define SGD_SM1_OFB 0x00000108
#define SGD_SM1_MAC 0x00000110
#define SGD_SSF33 0x00000200
#define SGD_SSF33_ECB 0x00000201
#define SGD_SSF33_CBC 0x00000202
#define SGD_SSF33_CFB 0x00000204
#define SGD_SSF33_OFB 0x00000208
#define SGD_SSF33_MAC 0x00000210
#define SGD_SMS4 0x00000400
#define SGD_SMS4_ECB 0x00000401
#define SGD_SMS4_CBC 0x00000402
#define SGD_SMS4_CFB 0x00000404
#define SGD_SMS4_OFB 0x00000408
#define SGD_SMS4_MAC 0x00000410
#define SGD_SM6 0x00000600
#define SGD_SM6_ECB 0x00000601
#define SGD_SM6_CBC 0x00000602
#define SGD_SM6_CFB 0x00000604
#define SGD_SM6_OFB 0x00000608
#define SGD_SM6_MAC 0x00000610
#define SGD_AES 0x80000200
#define SGD_AES_ECB 0x80000201
#define SGD_AES_CBC 0x80000202
#define SGD_AES_CFB 0x80000204
#define SGD_AES_OFB 0x80000208
#define SGD_AES_MAC 0x80000210
#if 0
#define SGD_RSA 0x00010000
#define SGD_SM2 0x00020000
#define SGD_SM2_1 0x00020100
#define SGD_SM2_2 0x00020200
#define SGD_SM2_3 0x00020400
#else//V_GMT0006
#define SGD_RSA 0x00010000
#define SGD_SM2 0x00020000
#define SGD_SM2_1 0x00020200
#define SGD_SM2_2 0x00020400
#define SGD_SM2_3 0x00020800
#endif
#define SGD_SM3 0x00000001
#define SGD_SHA1 0x00000002
#define SGD_SHA256 0x00000004
#define SGD_SHA512 0x00000008
#define SGD_SHA0 0x00000010
#define SGD_SHA224 0x00000020
#define SGD_SHA384 0x00000040
/* return value */
#define SDR_OK 0x00000000
#define SDR_BASE 0x01000000
#define SDR_UNKNOWERR SDR_BASE + 0x00000001
#define SDR_NOTSUPPORT SDR_BASE + 0x00000002
#define SDR_COMMFAIL SDR_BASE + 0x00000003
#define SDR_HARDFAIL SDR_BASE + 0x00000004
#define SDR_OPENDEVICE SDR_BASE + 0x00000005
#define SDR_OPENSESSION SDR_BASE + 0x00000006
#define SDR_PARDENY SDR_BASE + 0x00000007
#define SDR_KEYNOTEXIT SDR_BASE + 0x00000008
#define SDR_ALGNOTSUPPORT SDR_BASE + 0x00000009
#define SDR_ALGMODNOTSUPPORT SDR_BASE + 0x0000000A
#define SDR_PKOPERR SDR_BASE + 0x0000000B
#define SDR_SKOPERR SDR_BASE + 0x0000000C
#define SDR_SIGNERR SDR_BASE + 0x0000000D
#define SDR_VERIFYERR SDR_BASE + 0x0000000E
#define SDR_SYMOPERR SDR_BASE + 0x0000000F
#define SDR_STEPERR SDR_BASE + 0x00000010
#define SDR_FILESIZEERR SDR_BASE + 0x00000011
#define SDR_FILENOEXIST SDR_BASE + 0x00000012
#define SDR_FILEOFSERR SDR_BASE + 0x00000013
#define SDR_KEYTYPEERR SDR_BASE + 0x00000014
#define SDR_KEYERR SDR_BASE + 0x00000015
#define SDR_ENCDATAERR SDR_BASE + 0x00000016
#define SDR_RANDERR SDR_BASE + 0x00000017
#define SDR_PRKRERR SDR_BASE + 0x00000018
#define SDR_MACERR SDR_BASE + 0x00000019
#define SDR_FILEEXISTS SDR_BASE + 0x0000001A
#define SDR_FILEWERR SDR_BASE + 0x0000001B
#define SDR_NOBUFFER SDR_BASE + 0x0000001C
#define SDR_INARGERR SDR_BASE + 0x0000001D
#define SDR_OUTARGERR SDR_BASE + 0x0000001E
#define SDR_LENGTHERR SDR_BASE + 0x0000001F
#define SDR_HANDLEINVALID SDR_BASE + 0x00000020
#define SDR_PARLOCK SDR_BASE + 0x00000021
#define SDR_DEVINITERR SDR_BASE + 0x00000022
/*
* Management account module
*/
#define MAX_MANAGER_COUNT 8
enum UMG_ui_user_type {
OPERATOR_ACCOUNT = 0,
MGR_ACCOUNT = 1,
};
typedef struct DeviceStatus_st{
unsigned int InitStatus;
unsigned int ManagerCount;
unsigned int ManagerExist[MAX_MANAGER_COUNT];
unsigned int ManagerLogin[MAX_MANAGER_COUNT];
unsigned int OperatorExist;
unsigned int OperatorLogin;
}DEVICESTATUS;
#endif /*__SDF_TYPE_DEF_H__*/

1219
AWSMServer/src/AWSMCall.c Normal file

File diff suppressed because it is too large Load Diff

23
CMakeLists.txt Normal file
View File

@ -0,0 +1,23 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
PROJECT(AWSMRPC)
OPTION(SUBPROJECT "Using SubProject" ON)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
INCLUDE_DIRECTORIES(
PUBLIC
${CMAKE_SOURCE_DIR}/utils)
LINK_DIRECTORIES(${PROJECT_NAME}
PUBLIC
${CMAKE_SOURCE_DIR}/lib)
ADD_SUBDIRECTORY(utils/VSConfig)
ADD_SUBDIRECTORY(utils/VSClock)
ADD_SUBDIRECTORY(utils/ZMQLayout)
ADD_SUBDIRECTORY(utils/AWSMProtobuf)
ADD_SUBDIRECTORY(AWSMServer)
ADD_SUBDIRECTORY(AWSM)

Binary file not shown.

BIN
lib-gnueabihf/libsm.so Executable file

Binary file not shown.

BIN
lib-gnueabihf/libzmq.so.5.2.6 Executable file

Binary file not shown.

Binary file not shown.

BIN
lib-hisiv500/libzmq.so.5.2.6 Executable file

Binary file not shown.

BIN
lib-x86_64/libprotobuf-c.so.1.0.0 Executable file

Binary file not shown.

BIN
lib-x86_64/libzmq.so.5.2.6 Executable file

Binary file not shown.

View File

@ -0,0 +1,209 @@
syntax = "proto3";
package AWSM;
message Hash
{
bytes SourceData = 1;
int32 SourceDataLen = 2;
bytes HashData = 3;
int32 HashDataLen = 4;
bytes EccPublickey = 5;
int32 ReturnValue = 6;
}
message Rand
{
bytes ucRandom = 1;
int32 ulRandomLen = 2;
int32 ReturnValue = 3;
}
message SignatureByIntPrikey
{
bytes SignData = 1;
int32 SignDataLen = 2;
bytes EccSignBlobData = 3;
int32 EccSignBlobDatalen = 4;
int32 ReturnValue = 5;
int32 KeyPairNum = 6;
}
message SignatureByExtPrikey
{
bytes EccPrikey = 1;
bytes SignData = 2;
int32 SignDataLen = 3;
bytes EccSignBlobData = 4;
int32 EccSignBlobDataLen = 5;
int32 ReturnValue = 6;
}
message VerifySignature
{
bytes EccPublickey = 1;
bytes SignatureData = 2;
int32 SignDataLen = 3;
bytes EccSignBlobData = 4;
int32 EccSignBlobDataLen = 5;
int32 ReturnValue = 6;
}
message SM2EncryptByExtPubKey
{
bytes EPublickey = 1;
bytes InData = 2;
int32 InDataLen = 3;
bytes ECCCIPPHERData = 4;
int32 ECCCIPPHERDataLen = 5;
int32 ReturnValue = 6;
}
message SM2DecryptByExtPrikey
{
bytes EPrikey = 1;
bytes ECCCIPPHERData = 2;
int32 ECCCIPPHERDataLen = 3;
bytes OutData = 4;
int32 OutDataLen = 5;
int32 ReturnValue = 6;
}
message SM2DecryptByIntPrikey
{
bytes ECCCIPPHERData = 1;
int32 ECCCIPPHERDataLen = 2;
bytes OutData = 3;
int32 OutDataLen = 4;
int32 ReturnValue = 5;
int32 KeyPairNum = 6;
}
message SM2DecryptByIntCryptPrikey
{
bytes ECCCIPPHERData = 1;
int32 ECCCIPPHERDataLen = 2;
bytes OutData = 3;
int32 OutDataLen = 4;
int32 ReturnValue = 5;
int32 KeyPairNum = 6;
}
message SM1Encrypt
{
int32 AlgMode = 1;
bytes pIv = 2;
bytes Key = 3;
int32 KeyLen = 4;
bytes InData = 5;
int32 InDataLen = 6;
bytes OutData = 7;
int32 OutDataLen = 8;
int32 ReturnValue = 9;
}
message SM1Decrypt
{
int32 AlgMode = 1;
bytes pIv = 2;
bytes Key = 3;
int32 KeyLen = 4;
bytes InData = 5;
int32 InDataLen = 6;
bytes OutData = 7;
int32 OutDataLen = 8;
int32 ReturnValue = 9;
}
message SM4Encrypt
{
int32 AlgMode = 1;
bytes pIv = 2;
bytes Key = 3;
int32 KeyLen = 4;
bytes InData = 5;
int32 InDataLen = 6;
bytes OutData = 7;
int32 OutDataLen = 8;
int32 ReturnValue = 9;
}
message SM4Decrypt
{
int32 AlgMode = 1;
bytes pIv = 2;
bytes Key = 3;
int32 KeyLen = 4;
bytes InData = 5;
int32 InDataLen = 6;
bytes OutData = 7;
int32 OutDataLen = 8;
int32 ReturnValue = 9;
}
message GenerateECCKeyPair
{
int32 ReturnValue = 1;
int32 KeyPairNum = 2;
}
message ExportPubkey
{
int32 KeyPairType = 1;
bytes PublicKey = 2;
int32 ReturnValue = 3;
int32 KeyPairNum = 4;
}
message ImportKeyPair
{
int32 KeyPairType = 1;
bytes Prikey = 2;
bytes Pubkey = 3;
int32 ReturnValue = 4;
int32 KeyPairNum = 5;
}
message ImportCertificate
{
int32 CerType = 1;
bytes InData = 2;
int32 InDataLen = 3;
int32 ReturnValue = 4;
}
message ExportCertificate
{
int32 CerType = 1;
bytes OutData = 2;
int32 OutDataLen = 3;
int32 ReturnValue = 4;
}
message ImportFile
{
bytes FileName = 1;
bytes InData = 2;
int32 InDataLen = 3;
int32 ReturnValue = 4;
}
message ExportFile
{
bytes FileName = 1;
bytes OutData = 2;
int32 OutDataLen = 3;
int32 ReturnValue = 4;
}
message GetHwcode
{
bytes HwCode = 1;
int32 ReturnValue = 2;
}
message GetDevInfo
{
bytes DevInfo = 1;
int32 ReturnValue = 2;
}

View File

@ -0,0 +1,22 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
PROJECT(AWSMProtobuf)
ADD_COMPILE_OPTIONS(-fPIC)
AUX_SOURCE_DIRECTORY(${PROJECT_SOURCE_DIR}/src src_list)
ADD_LIBRARY(${PROJECT_NAME} STATIC ${src_list})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME}
PUBLIC
${PROJECT_SOURCE_DIR}/include)
TARGET_LINK_DIRECTORIES(${PROJECT_NAME}
PRIVATE
${CMAKE_SOURCE_DIR}/lib
)
TARGET_LINK_LIBRARIES(${PROJECT_NAME}
PRIVATE
protobuf-c
)

View File

@ -0,0 +1,881 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: AWSM.proto */
#ifndef PROTOBUF_C_AWSM_2eproto__INCLUDED
#define PROTOBUF_C_AWSM_2eproto__INCLUDED
#include <protobuf-c.h>
PROTOBUF_C__BEGIN_DECLS
#if PROTOBUF_C_VERSION_NUMBER < 1003000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif
typedef struct _AWSM__Hash AWSM__Hash;
typedef struct _AWSM__Rand AWSM__Rand;
typedef struct _AWSM__SignatureByIntPrikey AWSM__SignatureByIntPrikey;
typedef struct _AWSM__SignatureByExtPrikey AWSM__SignatureByExtPrikey;
typedef struct _AWSM__VerifySignature AWSM__VerifySignature;
typedef struct _AWSM__SM2EncryptByExtPubKey AWSM__SM2EncryptByExtPubKey;
typedef struct _AWSM__SM2DecryptByExtPrikey AWSM__SM2DecryptByExtPrikey;
typedef struct _AWSM__SM2DecryptByIntPrikey AWSM__SM2DecryptByIntPrikey;
typedef struct _AWSM__SM2DecryptByIntCryptPrikey AWSM__SM2DecryptByIntCryptPrikey;
typedef struct _AWSM__SM1Encrypt AWSM__SM1Encrypt;
typedef struct _AWSM__SM1Decrypt AWSM__SM1Decrypt;
typedef struct _AWSM__SM4Encrypt AWSM__SM4Encrypt;
typedef struct _AWSM__SM4Decrypt AWSM__SM4Decrypt;
typedef struct _AWSM__GenerateECCKeyPair AWSM__GenerateECCKeyPair;
typedef struct _AWSM__ExportPubkey AWSM__ExportPubkey;
typedef struct _AWSM__ImportKeyPair AWSM__ImportKeyPair;
typedef struct _AWSM__ImportCertificate AWSM__ImportCertificate;
typedef struct _AWSM__ExportCertificate AWSM__ExportCertificate;
typedef struct _AWSM__ImportFile AWSM__ImportFile;
typedef struct _AWSM__ExportFile AWSM__ExportFile;
typedef struct _AWSM__GetHwcode AWSM__GetHwcode;
typedef struct _AWSM__GetDevInfo AWSM__GetDevInfo;
/* --- enums --- */
/* --- messages --- */
struct _AWSM__Hash
{
ProtobufCMessage base;
ProtobufCBinaryData sourcedata;
int32_t sourcedatalen;
ProtobufCBinaryData hashdata;
int32_t hashdatalen;
ProtobufCBinaryData eccpublickey;
int32_t returnvalue;
};
#define AWSM__HASH__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__hash__descriptor) \
, {0,NULL}, 0, {0,NULL}, 0, {0,NULL}, 0 }
struct _AWSM__Rand
{
ProtobufCMessage base;
ProtobufCBinaryData ucrandom;
int32_t ulrandomlen;
int32_t returnvalue;
};
#define AWSM__RAND__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__rand__descriptor) \
, {0,NULL}, 0, 0 }
struct _AWSM__SignatureByIntPrikey
{
ProtobufCMessage base;
ProtobufCBinaryData signdata;
int32_t signdatalen;
ProtobufCBinaryData eccsignblobdata;
int32_t eccsignblobdatalen;
int32_t returnvalue;
int32_t keypairnum;
};
#define AWSM__SIGNATURE_BY_INT_PRIKEY__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__signature_by_int_prikey__descriptor) \
, {0,NULL}, 0, {0,NULL}, 0, 0, 0 }
struct _AWSM__SignatureByExtPrikey
{
ProtobufCMessage base;
ProtobufCBinaryData eccprikey;
ProtobufCBinaryData signdata;
int32_t signdatalen;
ProtobufCBinaryData eccsignblobdata;
int32_t eccsignblobdatalen;
int32_t returnvalue;
};
#define AWSM__SIGNATURE_BY_EXT_PRIKEY__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__signature_by_ext_prikey__descriptor) \
, {0,NULL}, {0,NULL}, 0, {0,NULL}, 0, 0 }
struct _AWSM__VerifySignature
{
ProtobufCMessage base;
ProtobufCBinaryData eccpublickey;
ProtobufCBinaryData signaturedata;
int32_t signdatalen;
ProtobufCBinaryData eccsignblobdata;
int32_t eccsignblobdatalen;
int32_t returnvalue;
};
#define AWSM__VERIFY_SIGNATURE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__verify_signature__descriptor) \
, {0,NULL}, {0,NULL}, 0, {0,NULL}, 0, 0 }
struct _AWSM__SM2EncryptByExtPubKey
{
ProtobufCMessage base;
ProtobufCBinaryData epublickey;
ProtobufCBinaryData indata;
int32_t indatalen;
ProtobufCBinaryData ecccippherdata;
int32_t ecccippherdatalen;
int32_t returnvalue;
};
#define AWSM__SM2_ENCRYPT_BY_EXT_PUB_KEY__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__sm2_encrypt_by_ext_pub_key__descriptor) \
, {0,NULL}, {0,NULL}, 0, {0,NULL}, 0, 0 }
struct _AWSM__SM2DecryptByExtPrikey
{
ProtobufCMessage base;
ProtobufCBinaryData eprikey;
ProtobufCBinaryData ecccippherdata;
int32_t ecccippherdatalen;
ProtobufCBinaryData outdata;
int32_t outdatalen;
int32_t returnvalue;
};
#define AWSM__SM2_DECRYPT_BY_EXT_PRIKEY__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__sm2_decrypt_by_ext_prikey__descriptor) \
, {0,NULL}, {0,NULL}, 0, {0,NULL}, 0, 0 }
struct _AWSM__SM2DecryptByIntPrikey
{
ProtobufCMessage base;
ProtobufCBinaryData ecccippherdata;
int32_t ecccippherdatalen;
ProtobufCBinaryData outdata;
int32_t outdatalen;
int32_t returnvalue;
int32_t keypairnum;
};
#define AWSM__SM2_DECRYPT_BY_INT_PRIKEY__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__sm2_decrypt_by_int_prikey__descriptor) \
, {0,NULL}, 0, {0,NULL}, 0, 0, 0 }
struct _AWSM__SM2DecryptByIntCryptPrikey
{
ProtobufCMessage base;
ProtobufCBinaryData ecccippherdata;
int32_t ecccippherdatalen;
ProtobufCBinaryData outdata;
int32_t outdatalen;
int32_t returnvalue;
int32_t keypairnum;
};
#define AWSM__SM2_DECRYPT_BY_INT_CRYPT_PRIKEY__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__sm2_decrypt_by_int_crypt_prikey__descriptor) \
, {0,NULL}, 0, {0,NULL}, 0, 0, 0 }
struct _AWSM__SM1Encrypt
{
ProtobufCMessage base;
int32_t algmode;
ProtobufCBinaryData piv;
ProtobufCBinaryData key;
int32_t keylen;
ProtobufCBinaryData indata;
int32_t indatalen;
ProtobufCBinaryData outdata;
int32_t outdatalen;
int32_t returnvalue;
};
#define AWSM__SM1_ENCRYPT__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__sm1_encrypt__descriptor) \
, 0, {0,NULL}, {0,NULL}, 0, {0,NULL}, 0, {0,NULL}, 0, 0 }
struct _AWSM__SM1Decrypt
{
ProtobufCMessage base;
int32_t algmode;
ProtobufCBinaryData piv;
ProtobufCBinaryData key;
int32_t keylen;
ProtobufCBinaryData indata;
int32_t indatalen;
ProtobufCBinaryData outdata;
int32_t outdatalen;
int32_t returnvalue;
};
#define AWSM__SM1_DECRYPT__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__sm1_decrypt__descriptor) \
, 0, {0,NULL}, {0,NULL}, 0, {0,NULL}, 0, {0,NULL}, 0, 0 }
struct _AWSM__SM4Encrypt
{
ProtobufCMessage base;
int32_t algmode;
ProtobufCBinaryData piv;
ProtobufCBinaryData key;
int32_t keylen;
ProtobufCBinaryData indata;
int32_t indatalen;
ProtobufCBinaryData outdata;
int32_t outdatalen;
int32_t returnvalue;
};
#define AWSM__SM4_ENCRYPT__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__sm4_encrypt__descriptor) \
, 0, {0,NULL}, {0,NULL}, 0, {0,NULL}, 0, {0,NULL}, 0, 0 }
struct _AWSM__SM4Decrypt
{
ProtobufCMessage base;
int32_t algmode;
ProtobufCBinaryData piv;
ProtobufCBinaryData key;
int32_t keylen;
ProtobufCBinaryData indata;
int32_t indatalen;
ProtobufCBinaryData outdata;
int32_t outdatalen;
int32_t returnvalue;
};
#define AWSM__SM4_DECRYPT__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__sm4_decrypt__descriptor) \
, 0, {0,NULL}, {0,NULL}, 0, {0,NULL}, 0, {0,NULL}, 0, 0 }
struct _AWSM__GenerateECCKeyPair
{
ProtobufCMessage base;
int32_t returnvalue;
int32_t keypairnum;
};
#define AWSM__GENERATE_ECCKEY_PAIR__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__generate_ecckey_pair__descriptor) \
, 0, 0 }
struct _AWSM__ExportPubkey
{
ProtobufCMessage base;
int32_t keypairtype;
ProtobufCBinaryData publickey;
int32_t returnvalue;
int32_t keypairnum;
};
#define AWSM__EXPORT_PUBKEY__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__export_pubkey__descriptor) \
, 0, {0,NULL}, 0, 0 }
struct _AWSM__ImportKeyPair
{
ProtobufCMessage base;
int32_t keypairtype;
ProtobufCBinaryData prikey;
ProtobufCBinaryData pubkey;
int32_t returnvalue;
int32_t keypairnum;
};
#define AWSM__IMPORT_KEY_PAIR__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__import_key_pair__descriptor) \
, 0, {0,NULL}, {0,NULL}, 0, 0 }
struct _AWSM__ImportCertificate
{
ProtobufCMessage base;
int32_t certype;
ProtobufCBinaryData indata;
int32_t indatalen;
int32_t returnvalue;
};
#define AWSM__IMPORT_CERTIFICATE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__import_certificate__descriptor) \
, 0, {0,NULL}, 0, 0 }
struct _AWSM__ExportCertificate
{
ProtobufCMessage base;
int32_t certype;
ProtobufCBinaryData outdata;
int32_t outdatalen;
int32_t returnvalue;
};
#define AWSM__EXPORT_CERTIFICATE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__export_certificate__descriptor) \
, 0, {0,NULL}, 0, 0 }
struct _AWSM__ImportFile
{
ProtobufCMessage base;
ProtobufCBinaryData filename;
ProtobufCBinaryData indata;
int32_t indatalen;
int32_t returnvalue;
};
#define AWSM__IMPORT_FILE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__import_file__descriptor) \
, {0,NULL}, {0,NULL}, 0, 0 }
struct _AWSM__ExportFile
{
ProtobufCMessage base;
ProtobufCBinaryData filename;
ProtobufCBinaryData outdata;
int32_t outdatalen;
int32_t returnvalue;
};
#define AWSM__EXPORT_FILE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__export_file__descriptor) \
, {0,NULL}, {0,NULL}, 0, 0 }
struct _AWSM__GetHwcode
{
ProtobufCMessage base;
ProtobufCBinaryData hwcode;
int32_t returnvalue;
};
#define AWSM__GET_HWCODE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__get_hwcode__descriptor) \
, {0,NULL}, 0 }
struct _AWSM__GetDevInfo
{
ProtobufCMessage base;
ProtobufCBinaryData devinfo;
int32_t returnvalue;
};
#define AWSM__GET_DEV_INFO__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&awsm__get_dev_info__descriptor) \
, {0,NULL}, 0 }
/* AWSM__Hash methods */
void awsm__hash__init
(AWSM__Hash *message);
size_t awsm__hash__get_packed_size
(const AWSM__Hash *message);
size_t awsm__hash__pack
(const AWSM__Hash *message,
uint8_t *out);
size_t awsm__hash__pack_to_buffer
(const AWSM__Hash *message,
ProtobufCBuffer *buffer);
AWSM__Hash *
awsm__hash__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__hash__free_unpacked
(AWSM__Hash *message,
ProtobufCAllocator *allocator);
/* AWSM__Rand methods */
void awsm__rand__init
(AWSM__Rand *message);
size_t awsm__rand__get_packed_size
(const AWSM__Rand *message);
size_t awsm__rand__pack
(const AWSM__Rand *message,
uint8_t *out);
size_t awsm__rand__pack_to_buffer
(const AWSM__Rand *message,
ProtobufCBuffer *buffer);
AWSM__Rand *
awsm__rand__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__rand__free_unpacked
(AWSM__Rand *message,
ProtobufCAllocator *allocator);
/* AWSM__SignatureByIntPrikey methods */
void awsm__signature_by_int_prikey__init
(AWSM__SignatureByIntPrikey *message);
size_t awsm__signature_by_int_prikey__get_packed_size
(const AWSM__SignatureByIntPrikey *message);
size_t awsm__signature_by_int_prikey__pack
(const AWSM__SignatureByIntPrikey *message,
uint8_t *out);
size_t awsm__signature_by_int_prikey__pack_to_buffer
(const AWSM__SignatureByIntPrikey *message,
ProtobufCBuffer *buffer);
AWSM__SignatureByIntPrikey *
awsm__signature_by_int_prikey__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__signature_by_int_prikey__free_unpacked
(AWSM__SignatureByIntPrikey *message,
ProtobufCAllocator *allocator);
/* AWSM__SignatureByExtPrikey methods */
void awsm__signature_by_ext_prikey__init
(AWSM__SignatureByExtPrikey *message);
size_t awsm__signature_by_ext_prikey__get_packed_size
(const AWSM__SignatureByExtPrikey *message);
size_t awsm__signature_by_ext_prikey__pack
(const AWSM__SignatureByExtPrikey *message,
uint8_t *out);
size_t awsm__signature_by_ext_prikey__pack_to_buffer
(const AWSM__SignatureByExtPrikey *message,
ProtobufCBuffer *buffer);
AWSM__SignatureByExtPrikey *
awsm__signature_by_ext_prikey__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__signature_by_ext_prikey__free_unpacked
(AWSM__SignatureByExtPrikey *message,
ProtobufCAllocator *allocator);
/* AWSM__VerifySignature methods */
void awsm__verify_signature__init
(AWSM__VerifySignature *message);
size_t awsm__verify_signature__get_packed_size
(const AWSM__VerifySignature *message);
size_t awsm__verify_signature__pack
(const AWSM__VerifySignature *message,
uint8_t *out);
size_t awsm__verify_signature__pack_to_buffer
(const AWSM__VerifySignature *message,
ProtobufCBuffer *buffer);
AWSM__VerifySignature *
awsm__verify_signature__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__verify_signature__free_unpacked
(AWSM__VerifySignature *message,
ProtobufCAllocator *allocator);
/* AWSM__SM2EncryptByExtPubKey methods */
void awsm__sm2_encrypt_by_ext_pub_key__init
(AWSM__SM2EncryptByExtPubKey *message);
size_t awsm__sm2_encrypt_by_ext_pub_key__get_packed_size
(const AWSM__SM2EncryptByExtPubKey *message);
size_t awsm__sm2_encrypt_by_ext_pub_key__pack
(const AWSM__SM2EncryptByExtPubKey *message,
uint8_t *out);
size_t awsm__sm2_encrypt_by_ext_pub_key__pack_to_buffer
(const AWSM__SM2EncryptByExtPubKey *message,
ProtobufCBuffer *buffer);
AWSM__SM2EncryptByExtPubKey *
awsm__sm2_encrypt_by_ext_pub_key__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__sm2_encrypt_by_ext_pub_key__free_unpacked
(AWSM__SM2EncryptByExtPubKey *message,
ProtobufCAllocator *allocator);
/* AWSM__SM2DecryptByExtPrikey methods */
void awsm__sm2_decrypt_by_ext_prikey__init
(AWSM__SM2DecryptByExtPrikey *message);
size_t awsm__sm2_decrypt_by_ext_prikey__get_packed_size
(const AWSM__SM2DecryptByExtPrikey *message);
size_t awsm__sm2_decrypt_by_ext_prikey__pack
(const AWSM__SM2DecryptByExtPrikey *message,
uint8_t *out);
size_t awsm__sm2_decrypt_by_ext_prikey__pack_to_buffer
(const AWSM__SM2DecryptByExtPrikey *message,
ProtobufCBuffer *buffer);
AWSM__SM2DecryptByExtPrikey *
awsm__sm2_decrypt_by_ext_prikey__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__sm2_decrypt_by_ext_prikey__free_unpacked
(AWSM__SM2DecryptByExtPrikey *message,
ProtobufCAllocator *allocator);
/* AWSM__SM2DecryptByIntPrikey methods */
void awsm__sm2_decrypt_by_int_prikey__init
(AWSM__SM2DecryptByIntPrikey *message);
size_t awsm__sm2_decrypt_by_int_prikey__get_packed_size
(const AWSM__SM2DecryptByIntPrikey *message);
size_t awsm__sm2_decrypt_by_int_prikey__pack
(const AWSM__SM2DecryptByIntPrikey *message,
uint8_t *out);
size_t awsm__sm2_decrypt_by_int_prikey__pack_to_buffer
(const AWSM__SM2DecryptByIntPrikey *message,
ProtobufCBuffer *buffer);
AWSM__SM2DecryptByIntPrikey *
awsm__sm2_decrypt_by_int_prikey__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__sm2_decrypt_by_int_prikey__free_unpacked
(AWSM__SM2DecryptByIntPrikey *message,
ProtobufCAllocator *allocator);
/* AWSM__SM2DecryptByIntCryptPrikey methods */
void awsm__sm2_decrypt_by_int_crypt_prikey__init
(AWSM__SM2DecryptByIntCryptPrikey *message);
size_t awsm__sm2_decrypt_by_int_crypt_prikey__get_packed_size
(const AWSM__SM2DecryptByIntCryptPrikey *message);
size_t awsm__sm2_decrypt_by_int_crypt_prikey__pack
(const AWSM__SM2DecryptByIntCryptPrikey *message,
uint8_t *out);
size_t awsm__sm2_decrypt_by_int_crypt_prikey__pack_to_buffer
(const AWSM__SM2DecryptByIntCryptPrikey *message,
ProtobufCBuffer *buffer);
AWSM__SM2DecryptByIntCryptPrikey *
awsm__sm2_decrypt_by_int_crypt_prikey__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__sm2_decrypt_by_int_crypt_prikey__free_unpacked
(AWSM__SM2DecryptByIntCryptPrikey *message,
ProtobufCAllocator *allocator);
/* AWSM__SM1Encrypt methods */
void awsm__sm1_encrypt__init
(AWSM__SM1Encrypt *message);
size_t awsm__sm1_encrypt__get_packed_size
(const AWSM__SM1Encrypt *message);
size_t awsm__sm1_encrypt__pack
(const AWSM__SM1Encrypt *message,
uint8_t *out);
size_t awsm__sm1_encrypt__pack_to_buffer
(const AWSM__SM1Encrypt *message,
ProtobufCBuffer *buffer);
AWSM__SM1Encrypt *
awsm__sm1_encrypt__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__sm1_encrypt__free_unpacked
(AWSM__SM1Encrypt *message,
ProtobufCAllocator *allocator);
/* AWSM__SM1Decrypt methods */
void awsm__sm1_decrypt__init
(AWSM__SM1Decrypt *message);
size_t awsm__sm1_decrypt__get_packed_size
(const AWSM__SM1Decrypt *message);
size_t awsm__sm1_decrypt__pack
(const AWSM__SM1Decrypt *message,
uint8_t *out);
size_t awsm__sm1_decrypt__pack_to_buffer
(const AWSM__SM1Decrypt *message,
ProtobufCBuffer *buffer);
AWSM__SM1Decrypt *
awsm__sm1_decrypt__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__sm1_decrypt__free_unpacked
(AWSM__SM1Decrypt *message,
ProtobufCAllocator *allocator);
/* AWSM__SM4Encrypt methods */
void awsm__sm4_encrypt__init
(AWSM__SM4Encrypt *message);
size_t awsm__sm4_encrypt__get_packed_size
(const AWSM__SM4Encrypt *message);
size_t awsm__sm4_encrypt__pack
(const AWSM__SM4Encrypt *message,
uint8_t *out);
size_t awsm__sm4_encrypt__pack_to_buffer
(const AWSM__SM4Encrypt *message,
ProtobufCBuffer *buffer);
AWSM__SM4Encrypt *
awsm__sm4_encrypt__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__sm4_encrypt__free_unpacked
(AWSM__SM4Encrypt *message,
ProtobufCAllocator *allocator);
/* AWSM__SM4Decrypt methods */
void awsm__sm4_decrypt__init
(AWSM__SM4Decrypt *message);
size_t awsm__sm4_decrypt__get_packed_size
(const AWSM__SM4Decrypt *message);
size_t awsm__sm4_decrypt__pack
(const AWSM__SM4Decrypt *message,
uint8_t *out);
size_t awsm__sm4_decrypt__pack_to_buffer
(const AWSM__SM4Decrypt *message,
ProtobufCBuffer *buffer);
AWSM__SM4Decrypt *
awsm__sm4_decrypt__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__sm4_decrypt__free_unpacked
(AWSM__SM4Decrypt *message,
ProtobufCAllocator *allocator);
/* AWSM__GenerateECCKeyPair methods */
void awsm__generate_ecckey_pair__init
(AWSM__GenerateECCKeyPair *message);
size_t awsm__generate_ecckey_pair__get_packed_size
(const AWSM__GenerateECCKeyPair *message);
size_t awsm__generate_ecckey_pair__pack
(const AWSM__GenerateECCKeyPair *message,
uint8_t *out);
size_t awsm__generate_ecckey_pair__pack_to_buffer
(const AWSM__GenerateECCKeyPair *message,
ProtobufCBuffer *buffer);
AWSM__GenerateECCKeyPair *
awsm__generate_ecckey_pair__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__generate_ecckey_pair__free_unpacked
(AWSM__GenerateECCKeyPair *message,
ProtobufCAllocator *allocator);
/* AWSM__ExportPubkey methods */
void awsm__export_pubkey__init
(AWSM__ExportPubkey *message);
size_t awsm__export_pubkey__get_packed_size
(const AWSM__ExportPubkey *message);
size_t awsm__export_pubkey__pack
(const AWSM__ExportPubkey *message,
uint8_t *out);
size_t awsm__export_pubkey__pack_to_buffer
(const AWSM__ExportPubkey *message,
ProtobufCBuffer *buffer);
AWSM__ExportPubkey *
awsm__export_pubkey__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__export_pubkey__free_unpacked
(AWSM__ExportPubkey *message,
ProtobufCAllocator *allocator);
/* AWSM__ImportKeyPair methods */
void awsm__import_key_pair__init
(AWSM__ImportKeyPair *message);
size_t awsm__import_key_pair__get_packed_size
(const AWSM__ImportKeyPair *message);
size_t awsm__import_key_pair__pack
(const AWSM__ImportKeyPair *message,
uint8_t *out);
size_t awsm__import_key_pair__pack_to_buffer
(const AWSM__ImportKeyPair *message,
ProtobufCBuffer *buffer);
AWSM__ImportKeyPair *
awsm__import_key_pair__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__import_key_pair__free_unpacked
(AWSM__ImportKeyPair *message,
ProtobufCAllocator *allocator);
/* AWSM__ImportCertificate methods */
void awsm__import_certificate__init
(AWSM__ImportCertificate *message);
size_t awsm__import_certificate__get_packed_size
(const AWSM__ImportCertificate *message);
size_t awsm__import_certificate__pack
(const AWSM__ImportCertificate *message,
uint8_t *out);
size_t awsm__import_certificate__pack_to_buffer
(const AWSM__ImportCertificate *message,
ProtobufCBuffer *buffer);
AWSM__ImportCertificate *
awsm__import_certificate__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__import_certificate__free_unpacked
(AWSM__ImportCertificate *message,
ProtobufCAllocator *allocator);
/* AWSM__ExportCertificate methods */
void awsm__export_certificate__init
(AWSM__ExportCertificate *message);
size_t awsm__export_certificate__get_packed_size
(const AWSM__ExportCertificate *message);
size_t awsm__export_certificate__pack
(const AWSM__ExportCertificate *message,
uint8_t *out);
size_t awsm__export_certificate__pack_to_buffer
(const AWSM__ExportCertificate *message,
ProtobufCBuffer *buffer);
AWSM__ExportCertificate *
awsm__export_certificate__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__export_certificate__free_unpacked
(AWSM__ExportCertificate *message,
ProtobufCAllocator *allocator);
/* AWSM__ImportFile methods */
void awsm__import_file__init
(AWSM__ImportFile *message);
size_t awsm__import_file__get_packed_size
(const AWSM__ImportFile *message);
size_t awsm__import_file__pack
(const AWSM__ImportFile *message,
uint8_t *out);
size_t awsm__import_file__pack_to_buffer
(const AWSM__ImportFile *message,
ProtobufCBuffer *buffer);
AWSM__ImportFile *
awsm__import_file__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__import_file__free_unpacked
(AWSM__ImportFile *message,
ProtobufCAllocator *allocator);
/* AWSM__ExportFile methods */
void awsm__export_file__init
(AWSM__ExportFile *message);
size_t awsm__export_file__get_packed_size
(const AWSM__ExportFile *message);
size_t awsm__export_file__pack
(const AWSM__ExportFile *message,
uint8_t *out);
size_t awsm__export_file__pack_to_buffer
(const AWSM__ExportFile *message,
ProtobufCBuffer *buffer);
AWSM__ExportFile *
awsm__export_file__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__export_file__free_unpacked
(AWSM__ExportFile *message,
ProtobufCAllocator *allocator);
/* AWSM__GetHwcode methods */
void awsm__get_hwcode__init
(AWSM__GetHwcode *message);
size_t awsm__get_hwcode__get_packed_size
(const AWSM__GetHwcode *message);
size_t awsm__get_hwcode__pack
(const AWSM__GetHwcode *message,
uint8_t *out);
size_t awsm__get_hwcode__pack_to_buffer
(const AWSM__GetHwcode *message,
ProtobufCBuffer *buffer);
AWSM__GetHwcode *
awsm__get_hwcode__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__get_hwcode__free_unpacked
(AWSM__GetHwcode *message,
ProtobufCAllocator *allocator);
/* AWSM__GetDevInfo methods */
void awsm__get_dev_info__init
(AWSM__GetDevInfo *message);
size_t awsm__get_dev_info__get_packed_size
(const AWSM__GetDevInfo *message);
size_t awsm__get_dev_info__pack
(const AWSM__GetDevInfo *message,
uint8_t *out);
size_t awsm__get_dev_info__pack_to_buffer
(const AWSM__GetDevInfo *message,
ProtobufCBuffer *buffer);
AWSM__GetDevInfo *
awsm__get_dev_info__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void awsm__get_dev_info__free_unpacked
(AWSM__GetDevInfo *message,
ProtobufCAllocator *allocator);
/* --- per-message closures --- */
typedef void (*AWSM__Hash_Closure)
(const AWSM__Hash *message,
void *closure_data);
typedef void (*AWSM__Rand_Closure)
(const AWSM__Rand *message,
void *closure_data);
typedef void (*AWSM__SignatureByIntPrikey_Closure)
(const AWSM__SignatureByIntPrikey *message,
void *closure_data);
typedef void (*AWSM__SignatureByExtPrikey_Closure)
(const AWSM__SignatureByExtPrikey *message,
void *closure_data);
typedef void (*AWSM__VerifySignature_Closure)
(const AWSM__VerifySignature *message,
void *closure_data);
typedef void (*AWSM__SM2EncryptByExtPubKey_Closure)
(const AWSM__SM2EncryptByExtPubKey *message,
void *closure_data);
typedef void (*AWSM__SM2DecryptByExtPrikey_Closure)
(const AWSM__SM2DecryptByExtPrikey *message,
void *closure_data);
typedef void (*AWSM__SM2DecryptByIntPrikey_Closure)
(const AWSM__SM2DecryptByIntPrikey *message,
void *closure_data);
typedef void (*AWSM__SM2DecryptByIntCryptPrikey_Closure)
(const AWSM__SM2DecryptByIntCryptPrikey *message,
void *closure_data);
typedef void (*AWSM__SM1Encrypt_Closure)
(const AWSM__SM1Encrypt *message,
void *closure_data);
typedef void (*AWSM__SM1Decrypt_Closure)
(const AWSM__SM1Decrypt *message,
void *closure_data);
typedef void (*AWSM__SM4Encrypt_Closure)
(const AWSM__SM4Encrypt *message,
void *closure_data);
typedef void (*AWSM__SM4Decrypt_Closure)
(const AWSM__SM4Decrypt *message,
void *closure_data);
typedef void (*AWSM__GenerateECCKeyPair_Closure)
(const AWSM__GenerateECCKeyPair *message,
void *closure_data);
typedef void (*AWSM__ExportPubkey_Closure)
(const AWSM__ExportPubkey *message,
void *closure_data);
typedef void (*AWSM__ImportKeyPair_Closure)
(const AWSM__ImportKeyPair *message,
void *closure_data);
typedef void (*AWSM__ImportCertificate_Closure)
(const AWSM__ImportCertificate *message,
void *closure_data);
typedef void (*AWSM__ExportCertificate_Closure)
(const AWSM__ExportCertificate *message,
void *closure_data);
typedef void (*AWSM__ImportFile_Closure)
(const AWSM__ImportFile *message,
void *closure_data);
typedef void (*AWSM__ExportFile_Closure)
(const AWSM__ExportFile *message,
void *closure_data);
typedef void (*AWSM__GetHwcode_Closure)
(const AWSM__GetHwcode *message,
void *closure_data);
typedef void (*AWSM__GetDevInfo_Closure)
(const AWSM__GetDevInfo *message,
void *closure_data);
/* --- services --- */
/* --- descriptors --- */
extern const ProtobufCMessageDescriptor awsm__hash__descriptor;
extern const ProtobufCMessageDescriptor awsm__rand__descriptor;
extern const ProtobufCMessageDescriptor awsm__signature_by_int_prikey__descriptor;
extern const ProtobufCMessageDescriptor awsm__signature_by_ext_prikey__descriptor;
extern const ProtobufCMessageDescriptor awsm__verify_signature__descriptor;
extern const ProtobufCMessageDescriptor awsm__sm2_encrypt_by_ext_pub_key__descriptor;
extern const ProtobufCMessageDescriptor awsm__sm2_decrypt_by_ext_prikey__descriptor;
extern const ProtobufCMessageDescriptor awsm__sm2_decrypt_by_int_prikey__descriptor;
extern const ProtobufCMessageDescriptor awsm__sm2_decrypt_by_int_crypt_prikey__descriptor;
extern const ProtobufCMessageDescriptor awsm__sm1_encrypt__descriptor;
extern const ProtobufCMessageDescriptor awsm__sm1_decrypt__descriptor;
extern const ProtobufCMessageDescriptor awsm__sm4_encrypt__descriptor;
extern const ProtobufCMessageDescriptor awsm__sm4_decrypt__descriptor;
extern const ProtobufCMessageDescriptor awsm__generate_ecckey_pair__descriptor;
extern const ProtobufCMessageDescriptor awsm__export_pubkey__descriptor;
extern const ProtobufCMessageDescriptor awsm__import_key_pair__descriptor;
extern const ProtobufCMessageDescriptor awsm__import_certificate__descriptor;
extern const ProtobufCMessageDescriptor awsm__export_certificate__descriptor;
extern const ProtobufCMessageDescriptor awsm__import_file__descriptor;
extern const ProtobufCMessageDescriptor awsm__export_file__descriptor;
extern const ProtobufCMessageDescriptor awsm__get_hwcode__descriptor;
extern const ProtobufCMessageDescriptor awsm__get_dev_info__descriptor;
PROTOBUF_C__END_DECLS
#endif /* PROTOBUF_C_AWSM_2eproto__INCLUDED */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

37
utils/VSClock/CMakeLists.txt Executable file
View File

@ -0,0 +1,37 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
PROJECT(VSClock)
### SET CONFIGURE
OPTION(SUBPROJECT "AS SubProject" OFF)
ADD_COMPILE_OPTIONS(-fPIC)
SET(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR}/bin)
### SET COMPILE
AUX_SOURCE_DIRECTORY(${PROJECT_SOURCE_DIR}/src src_list)
if(SUBPROJECT)
ADD_LIBRARY(${PROJECT_NAME} STATIC ${src_list})
else()
ADD_LIBRARY(${PROJECT_NAME} SHARED ${src_list})
endif()
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME}
PUBLIC
${PROJECT_SOURCE_DIR}/include)
### SET INSTALL
if(NOT SUBPROJECT)
INSTALL(TARGETS ${CMAKE_PROJECT_NAME}
LIBRARY DESTINATION lib)
endif()
FILE(GLOB INCLUDE "${PROJECT_SOURCE_DIR}/include/*.h" )
INSTALL(FILES
${INCLUDE} DESTINATION include/${CMAKE_PROJECT_NAME}/)

View File

@ -0,0 +1,26 @@
#ifndef __VSCLOCK_H__
#define __VSCLOCK_H__
typedef struct VSClock_S
{
long lClock;
int iYear;
int iMonth:8;
int iDay:8;
int iHour:8;
int iMinute:8;
int iSecond:8;
int iMilliSecond;
}VSClock_s, *pVSClock_s;
long VSClock(pVSClock_s psVSClock, int iOffsetSecond, int iOffsetMilliSecond);
long VSClock2L(pVSClock_s psVSClock);
int VSClockL2(long lClock, pVSClock_s psVSClock);
int VSClockTimeOut(pVSClock_s psVSClock);
#define VSClockClone(SRCpVSClock, DSTpVSClock) VSClockL2(SRCpVSClock->lClock, DSTpVSClock)
#endif

View File

@ -0,0 +1,94 @@
#include "VSClock.h"
#include <stdio.h>
#include <sys/time.h>
#include <sys/timeb.h>
#define _XOPEN_SOURCE
#define __USE_XOPEN
#include <time.h>
#include <unistd.h>
/*
* The IDs of the various system clocks (for POSIX.1b interval timers):
*/
#define CLOCK_REALTIME 0
#define CLOCK_MONOTONIC 1
#define CLOCK_PROCESS_CPUTIME_ID 2
#define CLOCK_THREAD_CPUTIME_ID 3
#define CLOCK_MONOTONIC_RAW 4
#define CLOCK_REALTIME_COARSE 5
#define CLOCK_MONOTONIC_COARSE 6
#define CLOCK_BOOTTIME 7
#define CLOCK_REALTIME_ALARM 8
#define CLOCK_BOOTTIME_ALARM 9
long VSClock(pVSClock_s psVSClock, int iOffsetSecond, int iOffsetMilliSecond)
{
struct timespec sTimespec = {0};
clock_gettime(CLOCK_REALTIME, &sTimespec);
long rv = sTimespec.tv_sec * 1000 + sTimespec.tv_nsec / 1000000 + iOffsetSecond * 1000 + iOffsetMilliSecond;
if(!psVSClock) return rv;
time_t Second = rv / 1000; //秒
int MilliSecond = rv % 1000; //毫秒
struct tm *pTM = NULL;
pTM = localtime(&Second);
if(!pTM) { return -1; }
psVSClock->iYear = 1900 + pTM->tm_year;
psVSClock->iMonth = 1 + pTM->tm_mon;
psVSClock->iDay = pTM->tm_mday;
psVSClock->iHour = pTM->tm_hour;
psVSClock->iMinute = pTM->tm_min;
psVSClock->iSecond = pTM->tm_sec;
psVSClock->iMilliSecond = MilliSecond;
return (psVSClock->lClock = Second * 1000 + MilliSecond);
}
long VSClock2L(pVSClock_s psVSClock)
{
char pcDate[32] = {0};
snprintf(pcDate, 32, "%d-%d-%d-%d-%d-%d",
psVSClock->iYear, psVSClock->iMonth, psVSClock->iDay,
psVSClock->iHour, psVSClock->iMinute, psVSClock->iSecond);
struct tm tm;
strptime((char *)pcDate, "%Y-%m-%d-%H-%M-%S", &tm);
return mktime(&tm) * 1000 + psVSClock->iMilliSecond;
}
int VSClockL2(long lClock, pVSClock_s psVSClock)
{
long iSeconds = lClock / 1000;
int iMilliSecond = lClock % 1000;
struct tm *pTM = NULL;
pTM = localtime(&iSeconds);
if(!pTM) { return -1; }
psVSClock->iYear = 1900 + pTM->tm_year;
psVSClock->iMonth = 1 + pTM->tm_mon;
psVSClock->iDay = pTM->tm_mday;
psVSClock->iHour = pTM->tm_hour;
psVSClock->iMinute = pTM->tm_min;
psVSClock->iSecond = pTM->tm_sec;
psVSClock->iMilliSecond = iMilliSecond;
psVSClock->lClock = lClock;
return 0;
}
int VSClockTimeOut(pVSClock_s psVSClock)
{
if(psVSClock->lClock < VSClock(NULL, 0, 0)) return 1;
// printf("%ld %ld\n", psVSClock->lClock, VSClock(NULL, 0, 0));
return 0;
}

37
utils/VSConfig/CMakeLists.txt Executable file
View File

@ -0,0 +1,37 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
PROJECT(VSConfig)
### SET CONFIGURE
OPTION(SUBPROJECT "AS SubProject" OFF)
ADD_COMPILE_OPTIONS(-fPIC -std=c99)
SET(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR}/bin)
### SET COMPILE
AUX_SOURCE_DIRECTORY(${PROJECT_SOURCE_DIR}/src src_list)
if(SUBPROJECT)
ADD_LIBRARY(${PROJECT_NAME} STATIC ${src_list})
else()
ADD_LIBRARY(${PROJECT_NAME} SHARED ${src_list})
endif()
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME}
PUBLIC
${PROJECT_SOURCE_DIR}/include)
### SET INSTALL
if(NOT SUBPROJECT)
INSTALL(TARGETS ${CMAKE_PROJECT_NAME}
LIBRARY DESTINATION lib)
endif()
FILE(GLOB INCLUDE "${PROJECT_SOURCE_DIR}/include/*.h" )
INSTALL(FILES
${INCLUDE} DESTINATION include/${CMAKE_PROJECT_NAME}/)

View File

@ -0,0 +1,377 @@
# This is the CMakeCache file.
# For build in directory: /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build
# It was generated by CMake: /usr/data/zt/download/cmake-3.26.3/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.
########################
# EXTERNAL cache entries
########################
//Path to a program.
CMAKE_ADDR2LINE:FILEPATH=/usr/bin/addr2line
//Path to a program.
CMAKE_AR:FILEPATH=/usr/bin/ar
//Choose the type of build, options are: None Debug Release RelWithDebInfo
// MinSizeRel ...
CMAKE_BUILD_TYPE:STRING=
//Enable/Disable color output during build.
CMAKE_COLOR_MAKEFILE:BOOL=ON
//CXX compiler
CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
//A wrapper around 'ar' adding the appropriate '--plugin' option
// for the GCC compiler
CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar
//A wrapper around 'ranlib' adding the appropriate '--plugin' option
// for the GCC compiler
CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib
//Flags used by the CXX compiler during all build types.
CMAKE_CXX_FLAGS:STRING=
//Flags used by the CXX compiler during DEBUG builds.
CMAKE_CXX_FLAGS_DEBUG:STRING=-g
//Flags used by the CXX compiler during MINSIZEREL builds.
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
//Flags used by the CXX compiler during RELEASE builds.
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
//Flags used by the CXX compiler during RELWITHDEBINFO builds.
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
//C compiler
CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc
//A wrapper around 'ar' adding the appropriate '--plugin' option
// for the GCC compiler
CMAKE_C_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar
//A wrapper around 'ranlib' adding the appropriate '--plugin' option
// for the GCC compiler
CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib
//Flags used by the C compiler during all build types.
CMAKE_C_FLAGS:STRING=
//Flags used by the C compiler during DEBUG builds.
CMAKE_C_FLAGS_DEBUG:STRING=-g
//Flags used by the C compiler during MINSIZEREL builds.
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
//Flags used by the C compiler during RELEASE builds.
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
//Flags used by the C compiler during RELWITHDEBINFO builds.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
//Path to a program.
CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND
//Flags used by the linker during all build types.
CMAKE_EXE_LINKER_FLAGS:STRING=
//Flags used by the linker during DEBUG builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during MINSIZEREL builds.
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during RELEASE builds.
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during RELWITHDEBINFO builds.
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Enable/Disable output of compile commands during generation.
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=
//Value Computed by CMake.
CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/pkgRedirects
//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local
//Path to a program.
CMAKE_LINKER:FILEPATH=/usr/bin/ld
//Path to a program.
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/gmake
//Flags used by the linker during the creation of modules during
// all build types.
CMAKE_MODULE_LINKER_FLAGS:STRING=
//Flags used by the linker during the creation of modules during
// DEBUG builds.
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during the creation of modules during
// MINSIZEREL builds.
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during the creation of modules during
// RELEASE builds.
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during the creation of modules during
// RELWITHDEBINFO builds.
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Path to a program.
CMAKE_NM:FILEPATH=/usr/bin/nm
//Path to a program.
CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
//Path to a program.
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
//Value Computed by CMake
CMAKE_PROJECT_DESCRIPTION:STATIC=
//Value Computed by CMake
CMAKE_PROJECT_HOMEPAGE_URL:STATIC=
//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=VSConfig
//Path to a program.
CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
//Path to a program.
CMAKE_READELF:FILEPATH=/usr/bin/readelf
//Flags used by the linker during the creation of shared libraries
// during all build types.
CMAKE_SHARED_LINKER_FLAGS:STRING=
//Flags used by the linker during the creation of shared libraries
// during DEBUG builds.
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during the creation of shared libraries
// during MINSIZEREL builds.
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during the creation of shared libraries
// during RELEASE builds.
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during the creation of shared libraries
// during RELWITHDEBINFO builds.
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//If set, runtime paths are not added when installing shared libraries,
// but are added when building.
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
//If set, runtime paths are not added when using shared libraries.
CMAKE_SKIP_RPATH:BOOL=NO
//Flags used by the linker during the creation of static libraries
// during all build types.
CMAKE_STATIC_LINKER_FLAGS:STRING=
//Flags used by the linker during the creation of static libraries
// during DEBUG builds.
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during the creation of static libraries
// during MINSIZEREL builds.
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during the creation of static libraries
// during RELEASE builds.
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during the creation of static libraries
// during RELWITHDEBINFO builds.
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Path to a program.
CMAKE_STRIP:FILEPATH=/usr/bin/strip
//If this value is on, makefiles will be generated without the
// .SILENT directive, and all commands will be echoed to the console
// during the make. This is useful for debugging only. With Visual
// Studio IDE projects all commands are done without /nologo.
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
//AS SubProject
SUBPROJECT:BOOL=OFF
//Value Computed by CMake
VSConfig_BINARY_DIR:STATIC=/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build
//Value Computed by CMake
VSConfig_IS_TOP_LEVEL:STATIC=ON
//Value Computed by CMake
VSConfig_SOURCE_DIR:STATIC=/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig
########################
# INTERNAL cache entries
########################
//ADVANCED property for variable: CMAKE_ADDR2LINE
CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_AR
CMAKE_AR-ADVANCED:INTERNAL=1
//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=26
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=3
//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE
CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=/usr/data/zt/download/cmake-3.26.3/bin/cmake
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=/usr/data/zt/download/cmake-3.26.3/bin/cpack
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=/usr/data/zt/download/cmake-3.26.3/bin/ctest
//ADVANCED property for variable: CMAKE_CXX_COMPILER
CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR
CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB
CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_COMPILER
CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_COMPILER_AR
CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB
CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS
CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_DLLTOOL
CMAKE_DLLTOOL-ADVANCED:INTERNAL=1
//Executable file format
CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
//Name of external makefile project generator.
CMAKE_EXTRA_GENERATOR:INTERNAL=
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
//Generator instance identifier.
CMAKE_GENERATOR_INSTANCE:INTERNAL=
//Name of generator platform.
CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Source directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig
//Install .so files without execute permission.
CMAKE_INSTALL_SO_NO_EXE:INTERNAL=0
//ADVANCED property for variable: CMAKE_LINKER
CMAKE_LINKER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_NM
CMAKE_NM-ADVANCED:INTERNAL=1
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJCOPY
CMAKE_OBJCOPY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJDUMP
CMAKE_OBJDUMP-ADVANCED:INTERNAL=1
//Platform information initialized
CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
//ADVANCED property for variable: CMAKE_RANLIB
CMAKE_RANLIB-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_READELF
CMAKE_READELF-ADVANCED:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=/usr/data/zt/download/cmake-3.26.3
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_RPATH
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS
CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG
CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE
CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STRIP
CMAKE_STRIP-ADVANCED:INTERNAL=1
//uname command
CMAKE_UNAME:INTERNAL=/usr/bin/uname
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
//linker supports push/pop state
_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED:INTERNAL=TRUE

View File

@ -0,0 +1,72 @@
set(CMAKE_C_COMPILER "/usr/bin/cc")
set(CMAKE_C_COMPILER_ARG1 "")
set(CMAKE_C_COMPILER_ID "GNU")
set(CMAKE_C_COMPILER_VERSION "8.3.1")
set(CMAKE_C_COMPILER_VERSION_INTERNAL "")
set(CMAKE_C_COMPILER_WRAPPER "")
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17")
set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON")
set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17")
set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")
set(CMAKE_C17_COMPILE_FEATURES "c_std_17")
set(CMAKE_C23_COMPILE_FEATURES "")
set(CMAKE_C_PLATFORM_ID "Linux")
set(CMAKE_C_SIMULATE_ID "")
set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU")
set(CMAKE_C_SIMULATE_VERSION "")
set(CMAKE_AR "/usr/bin/ar")
set(CMAKE_C_COMPILER_AR "/usr/bin/gcc-ar")
set(CMAKE_RANLIB "/usr/bin/ranlib")
set(CMAKE_C_COMPILER_RANLIB "/usr/bin/gcc-ranlib")
set(CMAKE_LINKER "/usr/bin/ld")
set(CMAKE_MT "")
set(CMAKE_COMPILER_IS_GNUCC 1)
set(CMAKE_C_COMPILER_LOADED 1)
set(CMAKE_C_COMPILER_WORKS TRUE)
set(CMAKE_C_ABI_COMPILED TRUE)
set(CMAKE_C_COMPILER_ENV_VAR "CC")
set(CMAKE_C_COMPILER_ID_RUN 1)
set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_C_LINKER_PREFERENCE 10)
# Save compiler ABI information.
set(CMAKE_C_SIZEOF_DATA_PTR "8")
set(CMAKE_C_COMPILER_ABI "ELF")
set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN")
set(CMAKE_C_LIBRARY_ARCHITECTURE "")
if(CMAKE_C_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
endif()
if(CMAKE_C_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
endif()
if(CMAKE_C_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "")
endif()
set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "")
if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
endif()
set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/lib/gcc/x86_64-redhat-linux/8/include;/usr/local/include;/usr/include")
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s")
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-redhat-linux/8;/usr/lib64;/lib64;/usr/lib")
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")

View File

@ -0,0 +1,83 @@
set(CMAKE_CXX_COMPILER "/usr/bin/c++")
set(CMAKE_CXX_COMPILER_ARG1 "")
set(CMAKE_CXX_COMPILER_ID "GNU")
set(CMAKE_CXX_COMPILER_VERSION "8.3.1")
set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "")
set(CMAKE_CXX_COMPILER_WRAPPER "")
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14")
set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "ON")
set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20")
set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17")
set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20")
set(CMAKE_CXX23_COMPILE_FEATURES "")
set(CMAKE_CXX_PLATFORM_ID "Linux")
set(CMAKE_CXX_SIMULATE_ID "")
set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "GNU")
set(CMAKE_CXX_SIMULATE_VERSION "")
set(CMAKE_AR "/usr/bin/ar")
set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar")
set(CMAKE_RANLIB "/usr/bin/ranlib")
set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib")
set(CMAKE_LINKER "/usr/bin/ld")
set(CMAKE_MT "")
set(CMAKE_COMPILER_IS_GNUCXX 1)
set(CMAKE_CXX_COMPILER_LOADED 1)
set(CMAKE_CXX_COMPILER_WORKS TRUE)
set(CMAKE_CXX_ABI_COMPILED TRUE)
set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
set(CMAKE_CXX_COMPILER_ID_RUN 1)
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm)
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
foreach (lang C OBJC OBJCXX)
if (CMAKE_${lang}_COMPILER_ID_RUN)
foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS)
list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension})
endforeach()
endif()
endforeach()
set(CMAKE_CXX_LINKER_PREFERENCE 30)
set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
# Save compiler ABI information.
set(CMAKE_CXX_SIZEOF_DATA_PTR "8")
set(CMAKE_CXX_COMPILER_ABI "ELF")
set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN")
set(CMAKE_CXX_LIBRARY_ARCHITECTURE "")
if(CMAKE_CXX_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
endif()
if(CMAKE_CXX_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
endif()
if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "")
endif()
set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "")
if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX)
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}")
endif()
set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/8;/usr/include/c++/8/x86_64-redhat-linux;/usr/include/c++/8/backward;/usr/lib/gcc/x86_64-redhat-linux/8/include;/usr/local/include;/usr/include")
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc")
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-redhat-linux/8;/usr/lib64;/lib64;/usr/lib")
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")

View File

@ -0,0 +1,15 @@
set(CMAKE_HOST_SYSTEM "Linux-3.10.0-1160.66.1.el7.x86_64")
set(CMAKE_HOST_SYSTEM_NAME "Linux")
set(CMAKE_HOST_SYSTEM_VERSION "3.10.0-1160.66.1.el7.x86_64")
set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_SYSTEM "Linux-3.10.0-1160.66.1.el7.x86_64")
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_VERSION "3.10.0-1160.66.1.el7.x86_64")
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_CROSSCOMPILING "FALSE")
set(CMAKE_SYSTEM_LOADED 1)

View File

@ -0,0 +1,866 @@
#ifdef __cplusplus
# error "A C++ compiler has been selected for C."
#endif
#if defined(__18CXX)
# define ID_VOID_MAIN
#endif
#if defined(__CLASSIC_C__)
/* cv-qualifiers did not exist in K&R C */
# define const
# define volatile
#endif
#if !defined(__has_include)
/* If the compiler does not have __has_include, pretend the answer is
always no. */
# define __has_include(x) 0
#endif
/* Version number components: V=Version, R=Revision, P=Patch
Version date components: YYYY=Year, MM=Month, DD=Day */
#if defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# if defined(__GNUC__)
# define SIMULATE_ID "GNU"
# endif
/* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later,
except that a few beta releases use the old format with V=2021. */
# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
# if defined(__INTEL_COMPILER_UPDATE)
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
# else
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
# endif
# else
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
/* The third version component from --version is an update index,
but no macro is provided for it. */
# define COMPILER_VERSION_PATCH DEC(0)
# endif
# if defined(__INTEL_COMPILER_BUILD_DATE)
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
# if defined(__GNUC__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
# elif defined(__GNUG__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
# endif
# if defined(__GNUC_MINOR__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
# endif
# if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
# define COMPILER_ID "IntelLLVM"
#if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
#endif
#if defined(__GNUC__)
# define SIMULATE_ID "GNU"
#endif
/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
* later. Look for 6 digit vs. 8 digit version number to decide encoding.
* VVVV is no smaller than the current year when a version is released.
*/
#if __INTEL_LLVM_COMPILER < 1000000L
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10)
#else
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
#endif
#if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
#endif
#if defined(__GNUC__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
#elif defined(__GNUG__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
#endif
#if defined(__GNUC_MINOR__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
#endif
#if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
#endif
#elif defined(__PATHCC__)
# define COMPILER_ID "PathScale"
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
# if defined(__PATHCC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
# endif
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
# define COMPILER_ID "Embarcadero"
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
/* __BORLANDC__ = 0xVRR */
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
# define COMPILER_ID "Watcom"
/* __WATCOMC__ = VVRR */
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__WATCOMC__)
# define COMPILER_ID "OpenWatcom"
/* __WATCOMC__ = VVRP + 1100 */
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__SUNPRO_C)
# define COMPILER_ID "SunPro"
# if __SUNPRO_C >= 0x5100
/* __SUNPRO_C = 0xVRRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
# else
/* __SUNPRO_CC = 0xVRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
# endif
#elif defined(__HP_cc)
# define COMPILER_ID "HP"
/* __HP_cc = VVRRPP */
# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
#elif defined(__DECC)
# define COMPILER_ID "Compaq"
/* __DECC_VER = VVRRTPPPP */
# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
#elif defined(__IBMC__) && defined(__COMPILER_VER__)
# define COMPILER_ID "zOS"
/* __IBMC__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
#elif defined(__open_xl__) && defined(__clang__)
# define COMPILER_ID "IBMClang"
# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__)
# define COMPILER_VERSION_MINOR DEC(__open_xl_release__)
# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__)
# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__)
#elif defined(__ibmxl__) && defined(__clang__)
# define COMPILER_ID "XLClang"
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800
# define COMPILER_ID "XL"
/* __IBMC__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800
# define COMPILER_ID "VisualAge"
/* __IBMC__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
#elif defined(__NVCOMPILER)
# define COMPILER_ID "NVHPC"
# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
# if defined(__NVCOMPILER_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
# endif
#elif defined(__PGI)
# define COMPILER_ID "PGI"
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
# if defined(__PGIC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
#elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI"
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
#elif defined(__CLANG_FUJITSU)
# define COMPILER_ID "FujitsuClang"
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
# define COMPILER_VERSION_INTERNAL_STR __clang_version__
#elif defined(__FUJITSU)
# define COMPILER_ID "Fujitsu"
# if defined(__FCC_version__)
# define COMPILER_VERSION __FCC_version__
# elif defined(__FCC_major__)
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
# endif
# if defined(__fcc_version)
# define COMPILER_VERSION_INTERNAL DEC(__fcc_version)
# elif defined(__FCC_VERSION)
# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION)
# endif
#elif defined(__ghs__)
# define COMPILER_ID "GHS"
/* __GHS_VERSION_NUMBER = VVVVRP */
# ifdef __GHS_VERSION_NUMBER
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
# endif
#elif defined(__TASKING__)
# define COMPILER_ID "Tasking"
# define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000)
# define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100)
# define COMPILER_VERSION_INTERNAL DEC(__VERSION__)
#elif defined(__TINYC__)
# define COMPILER_ID "TinyCC"
#elif defined(__BCC__)
# define COMPILER_ID "Bruce"
#elif defined(__SCO_VERSION__)
# define COMPILER_ID "SCO"
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
# define COMPILER_ID "ARMCC"
#if __ARMCC_VERSION >= 1000000
/* __ARMCC_VERSION = VRRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#else
/* __ARMCC_VERSION = VRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#endif
#elif defined(__clang__) && defined(__apple_build_version__)
# define COMPILER_ID "AppleClang"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
# define COMPILER_ID "ARMClang"
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
#elif defined(__clang__)
# define COMPILER_ID "Clang"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
# define COMPILER_ID "LCC"
# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100)
# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100)
# if defined(__LCC_MINOR__)
# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
# endif
# if defined(__GNUC__) && defined(__GNUC_MINOR__)
# define SIMULATE_ID "GNU"
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
# if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
# endif
#elif defined(__GNUC__)
# define COMPILER_ID "GNU"
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
# if defined(__GNUC_MINOR__)
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
# endif
# if defined(__GNUC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif defined(_MSC_VER)
# define COMPILER_ID "MSVC"
/* _MSC_VER = VVRR */
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
# if defined(_MSC_FULL_VER)
# if _MSC_VER >= 1400
/* _MSC_FULL_VER = VVRRPPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
# else
/* _MSC_FULL_VER = VVRRPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
# endif
# endif
# if defined(_MSC_BUILD)
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif
#elif defined(_ADI_COMPILER)
# define COMPILER_ID "ADSP"
#if defined(__VERSIONNUM__)
/* __VERSIONNUM__ = 0xVVRRPPTT */
# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF)
# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF)
# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF)
# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF)
#endif
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
# define COMPILER_ID "IAR"
# if defined(__VER__) && defined(__ICCARM__)
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
# endif
#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC)
# define COMPILER_ID "SDCC"
# if defined(__SDCC_VERSION_MAJOR)
# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR)
# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR)
# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH)
# else
/* SDCC = VRP */
# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
# define COMPILER_VERSION_PATCH DEC(SDCC % 10)
# endif
/* These compilers are either not known or too old to define an
identification macro. Try to identify the platform and guess that
it is the native compiler. */
#elif defined(__hpux) || defined(__hpua)
# define COMPILER_ID "HP"
#else /* unknown compiler */
# define COMPILER_ID ""
#endif
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
#ifdef SIMULATE_ID
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
#endif
#ifdef __QNXNTO__
char const* qnxnto = "INFO" ":" "qnxnto[]";
#endif
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
#endif
#define STRINGIFY_HELPER(X) #X
#define STRINGIFY(X) STRINGIFY_HELPER(X)
/* Identify known platforms by name. */
#if defined(__linux) || defined(__linux__) || defined(linux)
# define PLATFORM_ID "Linux"
#elif defined(__MSYS__)
# define PLATFORM_ID "MSYS"
#elif defined(__CYGWIN__)
# define PLATFORM_ID "Cygwin"
#elif defined(__MINGW32__)
# define PLATFORM_ID "MinGW"
#elif defined(__APPLE__)
# define PLATFORM_ID "Darwin"
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
# define PLATFORM_ID "Windows"
#elif defined(__FreeBSD__) || defined(__FreeBSD)
# define PLATFORM_ID "FreeBSD"
#elif defined(__NetBSD__) || defined(__NetBSD)
# define PLATFORM_ID "NetBSD"
#elif defined(__OpenBSD__) || defined(__OPENBSD)
# define PLATFORM_ID "OpenBSD"
#elif defined(__sun) || defined(sun)
# define PLATFORM_ID "SunOS"
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
# define PLATFORM_ID "AIX"
#elif defined(__hpux) || defined(__hpux__)
# define PLATFORM_ID "HP-UX"
#elif defined(__HAIKU__)
# define PLATFORM_ID "Haiku"
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
# define PLATFORM_ID "BeOS"
#elif defined(__QNX__) || defined(__QNXNTO__)
# define PLATFORM_ID "QNX"
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
# define PLATFORM_ID "Tru64"
#elif defined(__riscos) || defined(__riscos__)
# define PLATFORM_ID "RISCos"
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
# define PLATFORM_ID "SINIX"
#elif defined(__UNIX_SV__)
# define PLATFORM_ID "UNIX_SV"
#elif defined(__bsdos__)
# define PLATFORM_ID "BSDOS"
#elif defined(_MPRAS) || defined(MPRAS)
# define PLATFORM_ID "MP-RAS"
#elif defined(__osf) || defined(__osf__)
# define PLATFORM_ID "OSF1"
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
# define PLATFORM_ID "SCO_SV"
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
# define PLATFORM_ID "ULTRIX"
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
# define PLATFORM_ID "Xenix"
#elif defined(__WATCOMC__)
# if defined(__LINUX__)
# define PLATFORM_ID "Linux"
# elif defined(__DOS__)
# define PLATFORM_ID "DOS"
# elif defined(__OS2__)
# define PLATFORM_ID "OS2"
# elif defined(__WINDOWS__)
# define PLATFORM_ID "Windows3x"
# elif defined(__VXWORKS__)
# define PLATFORM_ID "VxWorks"
# else /* unknown platform */
# define PLATFORM_ID
# endif
#elif defined(__INTEGRITY)
# if defined(INT_178B)
# define PLATFORM_ID "Integrity178"
# else /* regular Integrity */
# define PLATFORM_ID "Integrity"
# endif
# elif defined(_ADI_COMPILER)
# define PLATFORM_ID "ADSP"
#else /* unknown platform */
# define PLATFORM_ID
#endif
/* For windows compilers MSVC and Intel we can determine
the architecture of the compiler being used. This is because
the compilers do not have flags that can change the architecture,
but rather depend on which compiler is being used
*/
#if defined(_WIN32) && defined(_MSC_VER)
# if defined(_M_IA64)
# define ARCHITECTURE_ID "IA64"
# elif defined(_M_ARM64EC)
# define ARCHITECTURE_ID "ARM64EC"
# elif defined(_M_X64) || defined(_M_AMD64)
# define ARCHITECTURE_ID "x64"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
# elif defined(_M_ARM64)
# define ARCHITECTURE_ID "ARM64"
# elif defined(_M_ARM)
# if _M_ARM == 4
# define ARCHITECTURE_ID "ARMV4I"
# elif _M_ARM == 5
# define ARCHITECTURE_ID "ARMV5I"
# else
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
# endif
# elif defined(_M_MIPS)
# define ARCHITECTURE_ID "MIPS"
# elif defined(_M_SH)
# define ARCHITECTURE_ID "SHx"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__WATCOMC__)
# if defined(_M_I86)
# define ARCHITECTURE_ID "I86"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
# if defined(__ICCARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__ICCRX__)
# define ARCHITECTURE_ID "RX"
# elif defined(__ICCRH850__)
# define ARCHITECTURE_ID "RH850"
# elif defined(__ICCRL78__)
# define ARCHITECTURE_ID "RL78"
# elif defined(__ICCRISCV__)
# define ARCHITECTURE_ID "RISCV"
# elif defined(__ICCAVR__)
# define ARCHITECTURE_ID "AVR"
# elif defined(__ICC430__)
# define ARCHITECTURE_ID "MSP430"
# elif defined(__ICCV850__)
# define ARCHITECTURE_ID "V850"
# elif defined(__ICC8051__)
# define ARCHITECTURE_ID "8051"
# elif defined(__ICCSTM8__)
# define ARCHITECTURE_ID "STM8"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__ghs__)
# if defined(__PPC64__)
# define ARCHITECTURE_ID "PPC64"
# elif defined(__ppc__)
# define ARCHITECTURE_ID "PPC"
# elif defined(__ARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__x86_64__)
# define ARCHITECTURE_ID "x64"
# elif defined(__i386__)
# define ARCHITECTURE_ID "X86"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__TI_COMPILER_VERSION__)
# if defined(__TI_ARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__MSP430__)
# define ARCHITECTURE_ID "MSP430"
# elif defined(__TMS320C28XX__)
# define ARCHITECTURE_ID "TMS320C28x"
# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
# define ARCHITECTURE_ID "TMS320C6x"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
# elif defined(__ADSPSHARC__)
# define ARCHITECTURE_ID "SHARC"
# elif defined(__ADSPBLACKFIN__)
# define ARCHITECTURE_ID "Blackfin"
#elif defined(__TASKING__)
# if defined(__CTC__) || defined(__CPTC__)
# define ARCHITECTURE_ID "TriCore"
# elif defined(__CMCS__)
# define ARCHITECTURE_ID "MCS"
# elif defined(__CARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__CARC__)
# define ARCHITECTURE_ID "ARC"
# elif defined(__C51__)
# define ARCHITECTURE_ID "8051"
# elif defined(__CPCP__)
# define ARCHITECTURE_ID "PCP"
# else
# define ARCHITECTURE_ID ""
# endif
#else
# define ARCHITECTURE_ID
#endif
/* Convert integer to decimal digit literals. */
#define DEC(n) \
('0' + (((n) / 10000000)%10)), \
('0' + (((n) / 1000000)%10)), \
('0' + (((n) / 100000)%10)), \
('0' + (((n) / 10000)%10)), \
('0' + (((n) / 1000)%10)), \
('0' + (((n) / 100)%10)), \
('0' + (((n) / 10)%10)), \
('0' + ((n) % 10))
/* Convert integer to hex digit literals. */
#define HEX(n) \
('0' + ((n)>>28 & 0xF)), \
('0' + ((n)>>24 & 0xF)), \
('0' + ((n)>>20 & 0xF)), \
('0' + ((n)>>16 & 0xF)), \
('0' + ((n)>>12 & 0xF)), \
('0' + ((n)>>8 & 0xF)), \
('0' + ((n)>>4 & 0xF)), \
('0' + ((n) & 0xF))
/* Construct a string literal encoding the version number. */
#ifdef COMPILER_VERSION
char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]";
/* Construct a string literal encoding the version number components. */
#elif defined(COMPILER_VERSION_MAJOR)
char const info_version[] = {
'I', 'N', 'F', 'O', ':',
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
COMPILER_VERSION_MAJOR,
# ifdef COMPILER_VERSION_MINOR
'.', COMPILER_VERSION_MINOR,
# ifdef COMPILER_VERSION_PATCH
'.', COMPILER_VERSION_PATCH,
# ifdef COMPILER_VERSION_TWEAK
'.', COMPILER_VERSION_TWEAK,
# endif
# endif
# endif
']','\0'};
#endif
/* Construct a string literal encoding the internal version number. */
#ifdef COMPILER_VERSION_INTERNAL
char const info_version_internal[] = {
'I', 'N', 'F', 'O', ':',
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
'i','n','t','e','r','n','a','l','[',
COMPILER_VERSION_INTERNAL,']','\0'};
#elif defined(COMPILER_VERSION_INTERNAL_STR)
char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
#endif
/* Construct a string literal encoding the version number components. */
#ifdef SIMULATE_VERSION_MAJOR
char const info_simulate_version[] = {
'I', 'N', 'F', 'O', ':',
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
SIMULATE_VERSION_MAJOR,
# ifdef SIMULATE_VERSION_MINOR
'.', SIMULATE_VERSION_MINOR,
# ifdef SIMULATE_VERSION_PATCH
'.', SIMULATE_VERSION_PATCH,
# ifdef SIMULATE_VERSION_TWEAK
'.', SIMULATE_VERSION_TWEAK,
# endif
# endif
# endif
']','\0'};
#endif
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
#if !defined(__STDC__) && !defined(__clang__)
# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__)
# define C_VERSION "90"
# else
# define C_VERSION
# endif
#elif __STDC_VERSION__ > 201710L
# define C_VERSION "23"
#elif __STDC_VERSION__ >= 201710L
# define C_VERSION "17"
#elif __STDC_VERSION__ >= 201000L
# define C_VERSION "11"
#elif __STDC_VERSION__ >= 199901L
# define C_VERSION "99"
#else
# define C_VERSION "90"
#endif
const char* info_language_standard_default =
"INFO" ":" "standard_default[" C_VERSION "]";
const char* info_language_extensions_default = "INFO" ":" "extensions_default["
#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
defined(__TI_COMPILER_VERSION__)) && \
!defined(__STRICT_ANSI__)
"ON"
#else
"OFF"
#endif
"]";
/*--------------------------------------------------------------------------*/
#ifdef ID_VOID_MAIN
void main() {}
#else
# if defined(__CLASSIC_C__)
int main(argc, argv) int argc; char *argv[];
# else
int main(int argc, char* argv[])
# endif
{
int require = 0;
require += info_compiler[argc];
require += info_platform[argc];
require += info_arch[argc];
#ifdef COMPILER_VERSION_MAJOR
require += info_version[argc];
#endif
#ifdef COMPILER_VERSION_INTERNAL
require += info_version_internal[argc];
#endif
#ifdef SIMULATE_ID
require += info_simulate[argc];
#endif
#ifdef SIMULATE_VERSION_MAJOR
require += info_simulate_version[argc];
#endif
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
require += info_cray[argc];
#endif
require += info_language_standard_default[argc];
require += info_language_extensions_default[argc];
(void)argv;
return require;
}
#endif

Binary file not shown.

View File

@ -0,0 +1,855 @@
/* This source file must have a .cpp extension so that all C++ compilers
recognize the extension without flags. Borland does not know .cxx for
example. */
#ifndef __cplusplus
# error "A C compiler has been selected for C++."
#endif
#if !defined(__has_include)
/* If the compiler does not have __has_include, pretend the answer is
always no. */
# define __has_include(x) 0
#endif
/* Version number components: V=Version, R=Revision, P=Patch
Version date components: YYYY=Year, MM=Month, DD=Day */
#if defined(__COMO__)
# define COMPILER_ID "Comeau"
/* __COMO_VERSION__ = VRR */
# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
#elif defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# if defined(__GNUC__)
# define SIMULATE_ID "GNU"
# endif
/* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later,
except that a few beta releases use the old format with V=2021. */
# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
# if defined(__INTEL_COMPILER_UPDATE)
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
# else
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
# endif
# else
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
/* The third version component from --version is an update index,
but no macro is provided for it. */
# define COMPILER_VERSION_PATCH DEC(0)
# endif
# if defined(__INTEL_COMPILER_BUILD_DATE)
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
# if defined(__GNUC__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
# elif defined(__GNUG__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
# endif
# if defined(__GNUC_MINOR__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
# endif
# if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
# define COMPILER_ID "IntelLLVM"
#if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
#endif
#if defined(__GNUC__)
# define SIMULATE_ID "GNU"
#endif
/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
* later. Look for 6 digit vs. 8 digit version number to decide encoding.
* VVVV is no smaller than the current year when a version is released.
*/
#if __INTEL_LLVM_COMPILER < 1000000L
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10)
#else
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
#endif
#if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
#endif
#if defined(__GNUC__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
#elif defined(__GNUG__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
#endif
#if defined(__GNUC_MINOR__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
#endif
#if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
#endif
#elif defined(__PATHCC__)
# define COMPILER_ID "PathScale"
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
# if defined(__PATHCC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
# endif
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
# define COMPILER_ID "Embarcadero"
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
/* __BORLANDC__ = 0xVRR */
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
# define COMPILER_ID "Watcom"
/* __WATCOMC__ = VVRR */
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__WATCOMC__)
# define COMPILER_ID "OpenWatcom"
/* __WATCOMC__ = VVRP + 1100 */
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__SUNPRO_CC)
# define COMPILER_ID "SunPro"
# if __SUNPRO_CC >= 0x5100
/* __SUNPRO_CC = 0xVRRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
# else
/* __SUNPRO_CC = 0xVRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
# endif
#elif defined(__HP_aCC)
# define COMPILER_ID "HP"
/* __HP_aCC = VVRRPP */
# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
#elif defined(__DECCXX)
# define COMPILER_ID "Compaq"
/* __DECCXX_VER = VVRRTPPPP */
# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
#elif defined(__IBMCPP__) && defined(__COMPILER_VER__)
# define COMPILER_ID "zOS"
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
#elif defined(__open_xl__) && defined(__clang__)
# define COMPILER_ID "IBMClang"
# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__)
# define COMPILER_VERSION_MINOR DEC(__open_xl_release__)
# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__)
# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__)
#elif defined(__ibmxl__) && defined(__clang__)
# define COMPILER_ID "XLClang"
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
# define COMPILER_ID "XL"
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800
# define COMPILER_ID "VisualAge"
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
#elif defined(__NVCOMPILER)
# define COMPILER_ID "NVHPC"
# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
# if defined(__NVCOMPILER_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
# endif
#elif defined(__PGI)
# define COMPILER_ID "PGI"
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
# if defined(__PGIC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
#elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI"
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
#elif defined(__CLANG_FUJITSU)
# define COMPILER_ID "FujitsuClang"
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
# define COMPILER_VERSION_INTERNAL_STR __clang_version__
#elif defined(__FUJITSU)
# define COMPILER_ID "Fujitsu"
# if defined(__FCC_version__)
# define COMPILER_VERSION __FCC_version__
# elif defined(__FCC_major__)
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
# endif
# if defined(__fcc_version)
# define COMPILER_VERSION_INTERNAL DEC(__fcc_version)
# elif defined(__FCC_VERSION)
# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION)
# endif
#elif defined(__ghs__)
# define COMPILER_ID "GHS"
/* __GHS_VERSION_NUMBER = VVVVRP */
# ifdef __GHS_VERSION_NUMBER
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
# endif
#elif defined(__TASKING__)
# define COMPILER_ID "Tasking"
# define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000)
# define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100)
# define COMPILER_VERSION_INTERNAL DEC(__VERSION__)
#elif defined(__SCO_VERSION__)
# define COMPILER_ID "SCO"
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
# define COMPILER_ID "ARMCC"
#if __ARMCC_VERSION >= 1000000
/* __ARMCC_VERSION = VRRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#else
/* __ARMCC_VERSION = VRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#endif
#elif defined(__clang__) && defined(__apple_build_version__)
# define COMPILER_ID "AppleClang"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
# define COMPILER_ID "ARMClang"
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
#elif defined(__clang__)
# define COMPILER_ID "Clang"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
# define COMPILER_ID "LCC"
# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100)
# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100)
# if defined(__LCC_MINOR__)
# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
# endif
# if defined(__GNUC__) && defined(__GNUC_MINOR__)
# define SIMULATE_ID "GNU"
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
# if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
# endif
#elif defined(__GNUC__) || defined(__GNUG__)
# define COMPILER_ID "GNU"
# if defined(__GNUC__)
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
# else
# define COMPILER_VERSION_MAJOR DEC(__GNUG__)
# endif
# if defined(__GNUC_MINOR__)
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
# endif
# if defined(__GNUC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif defined(_MSC_VER)
# define COMPILER_ID "MSVC"
/* _MSC_VER = VVRR */
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
# if defined(_MSC_FULL_VER)
# if _MSC_VER >= 1400
/* _MSC_FULL_VER = VVRRPPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
# else
/* _MSC_FULL_VER = VVRRPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
# endif
# endif
# if defined(_MSC_BUILD)
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif
#elif defined(_ADI_COMPILER)
# define COMPILER_ID "ADSP"
#if defined(__VERSIONNUM__)
/* __VERSIONNUM__ = 0xVVRRPPTT */
# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF)
# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF)
# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF)
# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF)
#endif
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
# define COMPILER_ID "IAR"
# if defined(__VER__) && defined(__ICCARM__)
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
# endif
/* These compilers are either not known or too old to define an
identification macro. Try to identify the platform and guess that
it is the native compiler. */
#elif defined(__hpux) || defined(__hpua)
# define COMPILER_ID "HP"
#else /* unknown compiler */
# define COMPILER_ID ""
#endif
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
#ifdef SIMULATE_ID
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
#endif
#ifdef __QNXNTO__
char const* qnxnto = "INFO" ":" "qnxnto[]";
#endif
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
#endif
#define STRINGIFY_HELPER(X) #X
#define STRINGIFY(X) STRINGIFY_HELPER(X)
/* Identify known platforms by name. */
#if defined(__linux) || defined(__linux__) || defined(linux)
# define PLATFORM_ID "Linux"
#elif defined(__MSYS__)
# define PLATFORM_ID "MSYS"
#elif defined(__CYGWIN__)
# define PLATFORM_ID "Cygwin"
#elif defined(__MINGW32__)
# define PLATFORM_ID "MinGW"
#elif defined(__APPLE__)
# define PLATFORM_ID "Darwin"
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
# define PLATFORM_ID "Windows"
#elif defined(__FreeBSD__) || defined(__FreeBSD)
# define PLATFORM_ID "FreeBSD"
#elif defined(__NetBSD__) || defined(__NetBSD)
# define PLATFORM_ID "NetBSD"
#elif defined(__OpenBSD__) || defined(__OPENBSD)
# define PLATFORM_ID "OpenBSD"
#elif defined(__sun) || defined(sun)
# define PLATFORM_ID "SunOS"
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
# define PLATFORM_ID "AIX"
#elif defined(__hpux) || defined(__hpux__)
# define PLATFORM_ID "HP-UX"
#elif defined(__HAIKU__)
# define PLATFORM_ID "Haiku"
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
# define PLATFORM_ID "BeOS"
#elif defined(__QNX__) || defined(__QNXNTO__)
# define PLATFORM_ID "QNX"
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
# define PLATFORM_ID "Tru64"
#elif defined(__riscos) || defined(__riscos__)
# define PLATFORM_ID "RISCos"
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
# define PLATFORM_ID "SINIX"
#elif defined(__UNIX_SV__)
# define PLATFORM_ID "UNIX_SV"
#elif defined(__bsdos__)
# define PLATFORM_ID "BSDOS"
#elif defined(_MPRAS) || defined(MPRAS)
# define PLATFORM_ID "MP-RAS"
#elif defined(__osf) || defined(__osf__)
# define PLATFORM_ID "OSF1"
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
# define PLATFORM_ID "SCO_SV"
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
# define PLATFORM_ID "ULTRIX"
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
# define PLATFORM_ID "Xenix"
#elif defined(__WATCOMC__)
# if defined(__LINUX__)
# define PLATFORM_ID "Linux"
# elif defined(__DOS__)
# define PLATFORM_ID "DOS"
# elif defined(__OS2__)
# define PLATFORM_ID "OS2"
# elif defined(__WINDOWS__)
# define PLATFORM_ID "Windows3x"
# elif defined(__VXWORKS__)
# define PLATFORM_ID "VxWorks"
# else /* unknown platform */
# define PLATFORM_ID
# endif
#elif defined(__INTEGRITY)
# if defined(INT_178B)
# define PLATFORM_ID "Integrity178"
# else /* regular Integrity */
# define PLATFORM_ID "Integrity"
# endif
# elif defined(_ADI_COMPILER)
# define PLATFORM_ID "ADSP"
#else /* unknown platform */
# define PLATFORM_ID
#endif
/* For windows compilers MSVC and Intel we can determine
the architecture of the compiler being used. This is because
the compilers do not have flags that can change the architecture,
but rather depend on which compiler is being used
*/
#if defined(_WIN32) && defined(_MSC_VER)
# if defined(_M_IA64)
# define ARCHITECTURE_ID "IA64"
# elif defined(_M_ARM64EC)
# define ARCHITECTURE_ID "ARM64EC"
# elif defined(_M_X64) || defined(_M_AMD64)
# define ARCHITECTURE_ID "x64"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
# elif defined(_M_ARM64)
# define ARCHITECTURE_ID "ARM64"
# elif defined(_M_ARM)
# if _M_ARM == 4
# define ARCHITECTURE_ID "ARMV4I"
# elif _M_ARM == 5
# define ARCHITECTURE_ID "ARMV5I"
# else
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
# endif
# elif defined(_M_MIPS)
# define ARCHITECTURE_ID "MIPS"
# elif defined(_M_SH)
# define ARCHITECTURE_ID "SHx"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__WATCOMC__)
# if defined(_M_I86)
# define ARCHITECTURE_ID "I86"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
# if defined(__ICCARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__ICCRX__)
# define ARCHITECTURE_ID "RX"
# elif defined(__ICCRH850__)
# define ARCHITECTURE_ID "RH850"
# elif defined(__ICCRL78__)
# define ARCHITECTURE_ID "RL78"
# elif defined(__ICCRISCV__)
# define ARCHITECTURE_ID "RISCV"
# elif defined(__ICCAVR__)
# define ARCHITECTURE_ID "AVR"
# elif defined(__ICC430__)
# define ARCHITECTURE_ID "MSP430"
# elif defined(__ICCV850__)
# define ARCHITECTURE_ID "V850"
# elif defined(__ICC8051__)
# define ARCHITECTURE_ID "8051"
# elif defined(__ICCSTM8__)
# define ARCHITECTURE_ID "STM8"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__ghs__)
# if defined(__PPC64__)
# define ARCHITECTURE_ID "PPC64"
# elif defined(__ppc__)
# define ARCHITECTURE_ID "PPC"
# elif defined(__ARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__x86_64__)
# define ARCHITECTURE_ID "x64"
# elif defined(__i386__)
# define ARCHITECTURE_ID "X86"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__TI_COMPILER_VERSION__)
# if defined(__TI_ARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__MSP430__)
# define ARCHITECTURE_ID "MSP430"
# elif defined(__TMS320C28XX__)
# define ARCHITECTURE_ID "TMS320C28x"
# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
# define ARCHITECTURE_ID "TMS320C6x"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
# elif defined(__ADSPSHARC__)
# define ARCHITECTURE_ID "SHARC"
# elif defined(__ADSPBLACKFIN__)
# define ARCHITECTURE_ID "Blackfin"
#elif defined(__TASKING__)
# if defined(__CTC__) || defined(__CPTC__)
# define ARCHITECTURE_ID "TriCore"
# elif defined(__CMCS__)
# define ARCHITECTURE_ID "MCS"
# elif defined(__CARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__CARC__)
# define ARCHITECTURE_ID "ARC"
# elif defined(__C51__)
# define ARCHITECTURE_ID "8051"
# elif defined(__CPCP__)
# define ARCHITECTURE_ID "PCP"
# else
# define ARCHITECTURE_ID ""
# endif
#else
# define ARCHITECTURE_ID
#endif
/* Convert integer to decimal digit literals. */
#define DEC(n) \
('0' + (((n) / 10000000)%10)), \
('0' + (((n) / 1000000)%10)), \
('0' + (((n) / 100000)%10)), \
('0' + (((n) / 10000)%10)), \
('0' + (((n) / 1000)%10)), \
('0' + (((n) / 100)%10)), \
('0' + (((n) / 10)%10)), \
('0' + ((n) % 10))
/* Convert integer to hex digit literals. */
#define HEX(n) \
('0' + ((n)>>28 & 0xF)), \
('0' + ((n)>>24 & 0xF)), \
('0' + ((n)>>20 & 0xF)), \
('0' + ((n)>>16 & 0xF)), \
('0' + ((n)>>12 & 0xF)), \
('0' + ((n)>>8 & 0xF)), \
('0' + ((n)>>4 & 0xF)), \
('0' + ((n) & 0xF))
/* Construct a string literal encoding the version number. */
#ifdef COMPILER_VERSION
char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]";
/* Construct a string literal encoding the version number components. */
#elif defined(COMPILER_VERSION_MAJOR)
char const info_version[] = {
'I', 'N', 'F', 'O', ':',
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
COMPILER_VERSION_MAJOR,
# ifdef COMPILER_VERSION_MINOR
'.', COMPILER_VERSION_MINOR,
# ifdef COMPILER_VERSION_PATCH
'.', COMPILER_VERSION_PATCH,
# ifdef COMPILER_VERSION_TWEAK
'.', COMPILER_VERSION_TWEAK,
# endif
# endif
# endif
']','\0'};
#endif
/* Construct a string literal encoding the internal version number. */
#ifdef COMPILER_VERSION_INTERNAL
char const info_version_internal[] = {
'I', 'N', 'F', 'O', ':',
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
'i','n','t','e','r','n','a','l','[',
COMPILER_VERSION_INTERNAL,']','\0'};
#elif defined(COMPILER_VERSION_INTERNAL_STR)
char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
#endif
/* Construct a string literal encoding the version number components. */
#ifdef SIMULATE_VERSION_MAJOR
char const info_simulate_version[] = {
'I', 'N', 'F', 'O', ':',
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
SIMULATE_VERSION_MAJOR,
# ifdef SIMULATE_VERSION_MINOR
'.', SIMULATE_VERSION_MINOR,
# ifdef SIMULATE_VERSION_PATCH
'.', SIMULATE_VERSION_PATCH,
# ifdef SIMULATE_VERSION_TWEAK
'.', SIMULATE_VERSION_TWEAK,
# endif
# endif
# endif
']','\0'};
#endif
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
# if defined(__INTEL_CXX11_MODE__)
# if defined(__cpp_aggregate_nsdmi)
# define CXX_STD 201402L
# else
# define CXX_STD 201103L
# endif
# else
# define CXX_STD 199711L
# endif
#elif defined(_MSC_VER) && defined(_MSVC_LANG)
# define CXX_STD _MSVC_LANG
#else
# define CXX_STD __cplusplus
#endif
const char* info_language_standard_default = "INFO" ":" "standard_default["
#if CXX_STD > 202002L
"23"
#elif CXX_STD > 201703L
"20"
#elif CXX_STD >= 201703L
"17"
#elif CXX_STD >= 201402L
"14"
#elif CXX_STD >= 201103L
"11"
#else
"98"
#endif
"]";
const char* info_language_extensions_default = "INFO" ":" "extensions_default["
#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
defined(__TI_COMPILER_VERSION__)) && \
!defined(__STRICT_ANSI__)
"ON"
#else
"OFF"
#endif
"]";
/*--------------------------------------------------------------------------*/
int main(int argc, char* argv[])
{
int require = 0;
require += info_compiler[argc];
require += info_platform[argc];
require += info_arch[argc];
#ifdef COMPILER_VERSION_MAJOR
require += info_version[argc];
#endif
#ifdef COMPILER_VERSION_INTERNAL
require += info_version_internal[argc];
#endif
#ifdef SIMULATE_ID
require += info_simulate[argc];
#endif
#ifdef SIMULATE_VERSION_MAJOR
require += info_simulate_version[argc];
#endif
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
require += info_cray[argc];
#endif
require += info_language_standard_default[argc];
require += info_language_extensions_default[argc];
(void)argv;
return require;
}

Binary file not shown.

View File

@ -0,0 +1,497 @@
---
events:
-
kind: "message-v1"
backtrace:
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineSystem.cmake:204 (message)"
- "CMakeLists.txt:2 (PROJECT)"
message: |
The system is: Linux - 3.10.0-1160.66.1.el7.x86_64 - x86_64
-
kind: "message-v1"
backtrace:
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCompilerId.cmake:17 (message)"
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)"
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCCompiler.cmake:123 (CMAKE_DETERMINE_COMPILER_ID)"
- "CMakeLists.txt:2 (PROJECT)"
message: |
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /usr/bin/cc
Build flags:
Id flags:
The output was:
0
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out"
The C compiler identification is GNU, found in:
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/3.26.3/CompilerIdC/a.out
-
kind: "message-v1"
backtrace:
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCompilerId.cmake:17 (message)"
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)"
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCXXCompiler.cmake:126 (CMAKE_DETERMINE_COMPILER_ID)"
- "CMakeLists.txt:2 (PROJECT)"
message: |
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /usr/bin/c++
Build flags:
Id flags:
The output was:
0
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"
The CXX compiler identification is GNU, found in:
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/3.26.3/CompilerIdCXX/a.out
-
kind: "try_compile-v1"
backtrace:
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCompilerABI.cmake:57 (try_compile)"
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)"
- "CMakeLists.txt:2 (PROJECT)"
checks:
- "Detecting C compiler ABI info"
directories:
source: "/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/CMakeScratch/TryCompile-Y9GOXZ"
binary: "/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/CMakeScratch/TryCompile-Y9GOXZ"
cmakeVariables:
CMAKE_C_FLAGS: ""
CMAKE_C_FLAGS_DEBUG: "-g"
CMAKE_EXE_LINKER_FLAGS: ""
buildResult:
variable: "CMAKE_C_ABI_COMPILED"
cached: true
stdout: |
Change Dir: /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/CMakeScratch/TryCompile-Y9GOXZ
Run Build Command(s):/usr/data/zt/download/cmake-3.26.3/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_77c4e/fast && /usr/bin/gmake -f CMakeFiles/cmTC_77c4e.dir/build.make CMakeFiles/cmTC_77c4e.dir/build
gmake[1]: Entering directory '/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/CMakeScratch/TryCompile-Y9GOXZ'
Building C object CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o
/usr/bin/cc -v -o CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o -c /usr/data/zt/download/cmake-3.26.3/Modules/CMakeCCompilerABI.c
Using built-in specs.
COLLECT_GCC=/usr/bin/cc
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
/usr/libexec/gcc/x86_64-redhat-linux/8/cc1 -quiet -v /usr/data/zt/download/cmake-3.26.3/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o -version -o /tmp/ccmS5CcS.s
GNU C17 (GCC) version 8.3.1 20191121 (Red Hat 8.3.1-5) (x86_64-redhat-linux)
compiled by GNU C version 8.3.1 20191121 (Red Hat 8.3.1-5), GMP version 6.1.2, MPFR version 3.1.6-p2, MPC version 1.0.2, isl version isl-0.16.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/8/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/8/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/x86_64-redhat-linux/8/include
/usr/local/include
/usr/include
End of search list.
GNU C17 (GCC) version 8.3.1 20191121 (Red Hat 8.3.1-5) (x86_64-redhat-linux)
compiled by GNU C version 8.3.1 20191121 (Red Hat 8.3.1-5), GMP version 6.1.2, MPFR version 3.1.6-p2, MPC version 1.0.2, isl version isl-0.16.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 220dcc731601936c0ccef916bbdca837
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
as -v --64 -o CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o /tmp/ccmS5CcS.s
GNU assembler version 2.30 (x86_64-redhat-linux) using BFD version version 2.30-73.el8
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
Linking C executable cmTC_77c4e
/usr/data/zt/download/cmake-3.26.3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_77c4e.dir/link.txt --verbose=1
/usr/bin/cc -v CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o -o cmTC_77c4e
Using built-in specs.
COLLECT_GCC=/usr/bin/cc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_77c4e' '-mtune=generic' '-march=x86-64'
/usr/libexec/gcc/x86_64-redhat-linux/8/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/8/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper -plugin-opt=-fresolution=/tmp/cc3BtBVY.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_77c4e /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/8/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/8 -L/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/8/../../.. CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-redhat-linux/8/crtend.o /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_77c4e' '-mtune=generic' '-march=x86-64'
gmake[1]: Leaving directory '/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/CMakeScratch/TryCompile-Y9GOXZ'
exitCode: 0
-
kind: "message-v1"
backtrace:
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCompilerABI.cmake:127 (message)"
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)"
- "CMakeLists.txt:2 (PROJECT)"
message: |
Parsed C implicit include dir info: rv=done
found start of include info
found start of implicit include info
add: [/usr/lib/gcc/x86_64-redhat-linux/8/include]
add: [/usr/local/include]
add: [/usr/include]
end of search list found
collapse include dir [/usr/lib/gcc/x86_64-redhat-linux/8/include] ==> [/usr/lib/gcc/x86_64-redhat-linux/8/include]
collapse include dir [/usr/local/include] ==> [/usr/local/include]
collapse include dir [/usr/include] ==> [/usr/include]
implicit include dirs: [/usr/lib/gcc/x86_64-redhat-linux/8/include;/usr/local/include;/usr/include]
-
kind: "message-v1"
backtrace:
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCompilerABI.cmake:152 (message)"
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)"
- "CMakeLists.txt:2 (PROJECT)"
message: |
Parsed C implicit link information:
link line regex: [^( *|.*[/\\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)]
ignore line: [Change Dir: /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/CMakeScratch/TryCompile-Y9GOXZ]
ignore line: []
ignore line: [Run Build Command(s):/usr/data/zt/download/cmake-3.26.3/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_77c4e/fast && /usr/bin/gmake -f CMakeFiles/cmTC_77c4e.dir/build.make CMakeFiles/cmTC_77c4e.dir/build]
ignore line: [gmake[1]: Entering directory '/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/CMakeScratch/TryCompile-Y9GOXZ']
ignore line: [Building C object CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o]
ignore line: [/usr/bin/cc -v -o CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o -c /usr/data/zt/download/cmake-3.26.3/Modules/CMakeCCompilerABI.c]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/cc]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none]
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
ignore line: [Target: x86_64-redhat-linux]
ignore line: [Configured with: ../configure --enable-bootstrap --enable-languages=c c++ fortran lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux]
ignore line: [Thread model: posix]
ignore line: [gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC) ]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
ignore line: [ /usr/libexec/gcc/x86_64-redhat-linux/8/cc1 -quiet -v /usr/data/zt/download/cmake-3.26.3/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o -version -o /tmp/ccmS5CcS.s]
ignore line: [GNU C17 (GCC) version 8.3.1 20191121 (Red Hat 8.3.1-5) (x86_64-redhat-linux)]
ignore line: [ compiled by GNU C version 8.3.1 20191121 (Red Hat 8.3.1-5) GMP version 6.1.2 MPFR version 3.1.6-p2 MPC version 1.0.2 isl version isl-0.16.1-GMP]
ignore line: []
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/8/include-fixed"]
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/8/../../../../x86_64-redhat-linux/include"]
ignore line: [#include "..." search starts here:]
ignore line: [#include <...> search starts here:]
ignore line: [ /usr/lib/gcc/x86_64-redhat-linux/8/include]
ignore line: [ /usr/local/include]
ignore line: [ /usr/include]
ignore line: [End of search list.]
ignore line: [GNU C17 (GCC) version 8.3.1 20191121 (Red Hat 8.3.1-5) (x86_64-redhat-linux)]
ignore line: [ compiled by GNU C version 8.3.1 20191121 (Red Hat 8.3.1-5) GMP version 6.1.2 MPFR version 3.1.6-p2 MPC version 1.0.2 isl version isl-0.16.1-GMP]
ignore line: []
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
ignore line: [Compiler executable checksum: 220dcc731601936c0ccef916bbdca837]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
ignore line: [ as -v --64 -o CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o /tmp/ccmS5CcS.s]
ignore line: [GNU assembler version 2.30 (x86_64-redhat-linux) using BFD version version 2.30-73.el8]
ignore line: [COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
ignore line: [Linking C executable cmTC_77c4e]
ignore line: [/usr/data/zt/download/cmake-3.26.3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_77c4e.dir/link.txt --verbose=1]
ignore line: [/usr/bin/cc -v CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o -o cmTC_77c4e ]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/cc]
ignore line: [COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none]
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
ignore line: [Target: x86_64-redhat-linux]
ignore line: [Configured with: ../configure --enable-bootstrap --enable-languages=c c++ fortran lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux]
ignore line: [Thread model: posix]
ignore line: [gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC) ]
ignore line: [COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_77c4e' '-mtune=generic' '-march=x86-64']
link line: [ /usr/libexec/gcc/x86_64-redhat-linux/8/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/8/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper -plugin-opt=-fresolution=/tmp/cc3BtBVY.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_77c4e /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/8/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/8 -L/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/8/../../.. CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-redhat-linux/8/crtend.o /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crtn.o]
arg [/usr/libexec/gcc/x86_64-redhat-linux/8/collect2] ==> ignore
arg [-plugin] ==> ignore
arg [/usr/libexec/gcc/x86_64-redhat-linux/8/liblto_plugin.so] ==> ignore
arg [-plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/cc3BtBVY.res] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [--build-id] ==> ignore
arg [--no-add-needed] ==> ignore
arg [--eh-frame-hdr] ==> ignore
arg [--hash-style=gnu] ==> ignore
arg [-m] ==> ignore
arg [elf_x86_64] ==> ignore
arg [-dynamic-linker] ==> ignore
arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
arg [-o] ==> ignore
arg [cmTC_77c4e] ==> ignore
arg [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o] ==> obj [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o]
arg [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crti.o] ==> obj [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crti.o]
arg [/usr/lib/gcc/x86_64-redhat-linux/8/crtbegin.o] ==> obj [/usr/lib/gcc/x86_64-redhat-linux/8/crtbegin.o]
arg [-L/usr/lib/gcc/x86_64-redhat-linux/8] ==> dir [/usr/lib/gcc/x86_64-redhat-linux/8]
arg [-L/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64] ==> dir [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64]
arg [-L/lib/../lib64] ==> dir [/lib/../lib64]
arg [-L/usr/lib/../lib64] ==> dir [/usr/lib/../lib64]
arg [-L/usr/lib/gcc/x86_64-redhat-linux/8/../../..] ==> dir [/usr/lib/gcc/x86_64-redhat-linux/8/../../..]
arg [CMakeFiles/cmTC_77c4e.dir/CMakeCCompilerABI.c.o] ==> ignore
arg [-lgcc] ==> lib [gcc]
arg [--as-needed] ==> ignore
arg [-lgcc_s] ==> lib [gcc_s]
arg [--no-as-needed] ==> ignore
arg [-lc] ==> lib [c]
arg [-lgcc] ==> lib [gcc]
arg [--as-needed] ==> ignore
arg [-lgcc_s] ==> lib [gcc_s]
arg [--no-as-needed] ==> ignore
arg [/usr/lib/gcc/x86_64-redhat-linux/8/crtend.o] ==> obj [/usr/lib/gcc/x86_64-redhat-linux/8/crtend.o]
arg [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crtn.o] ==> obj [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crtn.o]
collapse obj [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o] ==> [/usr/lib64/crt1.o]
collapse obj [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crti.o] ==> [/usr/lib64/crti.o]
collapse obj [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crtn.o] ==> [/usr/lib64/crtn.o]
collapse library dir [/usr/lib/gcc/x86_64-redhat-linux/8] ==> [/usr/lib/gcc/x86_64-redhat-linux/8]
collapse library dir [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64] ==> [/usr/lib64]
collapse library dir [/lib/../lib64] ==> [/lib64]
collapse library dir [/usr/lib/../lib64] ==> [/usr/lib64]
collapse library dir [/usr/lib/gcc/x86_64-redhat-linux/8/../../..] ==> [/usr/lib]
implicit libs: [gcc;gcc_s;c;gcc;gcc_s]
implicit objs: [/usr/lib64/crt1.o;/usr/lib64/crti.o;/usr/lib/gcc/x86_64-redhat-linux/8/crtbegin.o;/usr/lib/gcc/x86_64-redhat-linux/8/crtend.o;/usr/lib64/crtn.o]
implicit dirs: [/usr/lib/gcc/x86_64-redhat-linux/8;/usr/lib64;/lib64;/usr/lib]
implicit fwks: []
-
kind: "try_compile-v1"
backtrace:
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCompilerABI.cmake:57 (try_compile)"
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)"
- "CMakeLists.txt:2 (PROJECT)"
checks:
- "Detecting CXX compiler ABI info"
directories:
source: "/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/CMakeScratch/TryCompile-7kwaOk"
binary: "/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/CMakeScratch/TryCompile-7kwaOk"
cmakeVariables:
CMAKE_CXX_FLAGS: ""
CMAKE_CXX_FLAGS_DEBUG: "-g"
CMAKE_EXE_LINKER_FLAGS: ""
buildResult:
variable: "CMAKE_CXX_ABI_COMPILED"
cached: true
stdout: |
Change Dir: /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/CMakeScratch/TryCompile-7kwaOk
Run Build Command(s):/usr/data/zt/download/cmake-3.26.3/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_f24e3/fast && /usr/bin/gmake -f CMakeFiles/cmTC_f24e3.dir/build.make CMakeFiles/cmTC_f24e3.dir/build
gmake[1]: Entering directory '/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/CMakeScratch/TryCompile-7kwaOk'
Building CXX object CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o
/usr/bin/c++ -v -o CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o -c /usr/data/zt/download/cmake-3.26.3/Modules/CMakeCXXCompilerABI.cpp
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/libexec/gcc/x86_64-redhat-linux/8/cc1plus -quiet -v -D_GNU_SOURCE /usr/data/zt/download/cmake-3.26.3/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o -version -o /tmp/ccunZP2p.s
GNU C++14 (GCC) version 8.3.1 20191121 (Red Hat 8.3.1-5) (x86_64-redhat-linux)
compiled by GNU C version 8.3.1 20191121 (Red Hat 8.3.1-5), GMP version 6.1.2, MPFR version 3.1.6-p2, MPC version 1.0.2, isl version isl-0.16.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/8/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/8/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8
/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/x86_64-redhat-linux
/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/backward
/usr/lib/gcc/x86_64-redhat-linux/8/include
/usr/local/include
/usr/include
End of search list.
GNU C++14 (GCC) version 8.3.1 20191121 (Red Hat 8.3.1-5) (x86_64-redhat-linux)
compiled by GNU C version 8.3.1 20191121 (Red Hat 8.3.1-5), GMP version 6.1.2, MPFR version 3.1.6-p2, MPC version 1.0.2, isl version isl-0.16.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 6bc037fd95a01018b18727df05c3a70b
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
as -v --64 -o CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccunZP2p.s
GNU assembler version 2.30 (x86_64-redhat-linux) using BFD version version 2.30-73.el8
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
Linking CXX executable cmTC_f24e3
/usr/data/zt/download/cmake-3.26.3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f24e3.dir/link.txt --verbose=1
/usr/bin/c++ -v CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_f24e3
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_f24e3' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/libexec/gcc/x86_64-redhat-linux/8/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/8/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper -plugin-opt=-fresolution=/tmp/ccfxVUjz.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_f24e3 /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/8/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/8 -L/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/8/../../.. CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-redhat-linux/8/crtend.o /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_f24e3' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
gmake[1]: Leaving directory '/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/CMakeScratch/TryCompile-7kwaOk'
exitCode: 0
-
kind: "message-v1"
backtrace:
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCompilerABI.cmake:127 (message)"
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)"
- "CMakeLists.txt:2 (PROJECT)"
message: |
Parsed CXX implicit include dir info: rv=done
found start of include info
found start of implicit include info
add: [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8]
add: [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/x86_64-redhat-linux]
add: [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/backward]
add: [/usr/lib/gcc/x86_64-redhat-linux/8/include]
add: [/usr/local/include]
add: [/usr/include]
end of search list found
collapse include dir [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8] ==> [/usr/include/c++/8]
collapse include dir [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/x86_64-redhat-linux] ==> [/usr/include/c++/8/x86_64-redhat-linux]
collapse include dir [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/backward] ==> [/usr/include/c++/8/backward]
collapse include dir [/usr/lib/gcc/x86_64-redhat-linux/8/include] ==> [/usr/lib/gcc/x86_64-redhat-linux/8/include]
collapse include dir [/usr/local/include] ==> [/usr/local/include]
collapse include dir [/usr/include] ==> [/usr/include]
implicit include dirs: [/usr/include/c++/8;/usr/include/c++/8/x86_64-redhat-linux;/usr/include/c++/8/backward;/usr/lib/gcc/x86_64-redhat-linux/8/include;/usr/local/include;/usr/include]
-
kind: "message-v1"
backtrace:
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCompilerABI.cmake:152 (message)"
- "/usr/data/zt/download/cmake-3.26.3/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)"
- "CMakeLists.txt:2 (PROJECT)"
message: |
Parsed CXX implicit link information:
link line regex: [^( *|.*[/\\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)]
ignore line: [Change Dir: /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/CMakeScratch/TryCompile-7kwaOk]
ignore line: []
ignore line: [Run Build Command(s):/usr/data/zt/download/cmake-3.26.3/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_f24e3/fast && /usr/bin/gmake -f CMakeFiles/cmTC_f24e3.dir/build.make CMakeFiles/cmTC_f24e3.dir/build]
ignore line: [gmake[1]: Entering directory '/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/CMakeScratch/TryCompile-7kwaOk']
ignore line: [Building CXX object CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o]
ignore line: [/usr/bin/c++ -v -o CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o -c /usr/data/zt/download/cmake-3.26.3/Modules/CMakeCXXCompilerABI.cpp]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/c++]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none]
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
ignore line: [Target: x86_64-redhat-linux]
ignore line: [Configured with: ../configure --enable-bootstrap --enable-languages=c c++ fortran lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux]
ignore line: [Thread model: posix]
ignore line: [gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC) ]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
ignore line: [ /usr/libexec/gcc/x86_64-redhat-linux/8/cc1plus -quiet -v -D_GNU_SOURCE /usr/data/zt/download/cmake-3.26.3/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o -version -o /tmp/ccunZP2p.s]
ignore line: [GNU C++14 (GCC) version 8.3.1 20191121 (Red Hat 8.3.1-5) (x86_64-redhat-linux)]
ignore line: [ compiled by GNU C version 8.3.1 20191121 (Red Hat 8.3.1-5) GMP version 6.1.2 MPFR version 3.1.6-p2 MPC version 1.0.2 isl version isl-0.16.1-GMP]
ignore line: []
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/8/include-fixed"]
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/8/../../../../x86_64-redhat-linux/include"]
ignore line: [#include "..." search starts here:]
ignore line: [#include <...> search starts here:]
ignore line: [ /usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8]
ignore line: [ /usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/x86_64-redhat-linux]
ignore line: [ /usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/backward]
ignore line: [ /usr/lib/gcc/x86_64-redhat-linux/8/include]
ignore line: [ /usr/local/include]
ignore line: [ /usr/include]
ignore line: [End of search list.]
ignore line: [GNU C++14 (GCC) version 8.3.1 20191121 (Red Hat 8.3.1-5) (x86_64-redhat-linux)]
ignore line: [ compiled by GNU C version 8.3.1 20191121 (Red Hat 8.3.1-5) GMP version 6.1.2 MPFR version 3.1.6-p2 MPC version 1.0.2 isl version isl-0.16.1-GMP]
ignore line: []
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
ignore line: [Compiler executable checksum: 6bc037fd95a01018b18727df05c3a70b]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
ignore line: [ as -v --64 -o CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccunZP2p.s]
ignore line: [GNU assembler version 2.30 (x86_64-redhat-linux) using BFD version version 2.30-73.el8]
ignore line: [COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
ignore line: [Linking CXX executable cmTC_f24e3]
ignore line: [/usr/data/zt/download/cmake-3.26.3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f24e3.dir/link.txt --verbose=1]
ignore line: [/usr/bin/c++ -v CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_f24e3 ]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/c++]
ignore line: [COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none]
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
ignore line: [Target: x86_64-redhat-linux]
ignore line: [Configured with: ../configure --enable-bootstrap --enable-languages=c c++ fortran lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux]
ignore line: [Thread model: posix]
ignore line: [gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC) ]
ignore line: [COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_f24e3' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
link line: [ /usr/libexec/gcc/x86_64-redhat-linux/8/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/8/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper -plugin-opt=-fresolution=/tmp/ccfxVUjz.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_f24e3 /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/8/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/8 -L/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/8/../../.. CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-redhat-linux/8/crtend.o /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crtn.o]
arg [/usr/libexec/gcc/x86_64-redhat-linux/8/collect2] ==> ignore
arg [-plugin] ==> ignore
arg [/usr/libexec/gcc/x86_64-redhat-linux/8/liblto_plugin.so] ==> ignore
arg [-plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/ccfxVUjz.res] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [--build-id] ==> ignore
arg [--no-add-needed] ==> ignore
arg [--eh-frame-hdr] ==> ignore
arg [--hash-style=gnu] ==> ignore
arg [-m] ==> ignore
arg [elf_x86_64] ==> ignore
arg [-dynamic-linker] ==> ignore
arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
arg [-o] ==> ignore
arg [cmTC_f24e3] ==> ignore
arg [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o] ==> obj [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o]
arg [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crti.o] ==> obj [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crti.o]
arg [/usr/lib/gcc/x86_64-redhat-linux/8/crtbegin.o] ==> obj [/usr/lib/gcc/x86_64-redhat-linux/8/crtbegin.o]
arg [-L/usr/lib/gcc/x86_64-redhat-linux/8] ==> dir [/usr/lib/gcc/x86_64-redhat-linux/8]
arg [-L/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64] ==> dir [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64]
arg [-L/lib/../lib64] ==> dir [/lib/../lib64]
arg [-L/usr/lib/../lib64] ==> dir [/usr/lib/../lib64]
arg [-L/usr/lib/gcc/x86_64-redhat-linux/8/../../..] ==> dir [/usr/lib/gcc/x86_64-redhat-linux/8/../../..]
arg [CMakeFiles/cmTC_f24e3.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore
arg [-lstdc++] ==> lib [stdc++]
arg [-lm] ==> lib [m]
arg [-lgcc_s] ==> lib [gcc_s]
arg [-lgcc] ==> lib [gcc]
arg [-lc] ==> lib [c]
arg [-lgcc_s] ==> lib [gcc_s]
arg [-lgcc] ==> lib [gcc]
arg [/usr/lib/gcc/x86_64-redhat-linux/8/crtend.o] ==> obj [/usr/lib/gcc/x86_64-redhat-linux/8/crtend.o]
arg [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crtn.o] ==> obj [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crtn.o]
collapse obj [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o] ==> [/usr/lib64/crt1.o]
collapse obj [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crti.o] ==> [/usr/lib64/crti.o]
collapse obj [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crtn.o] ==> [/usr/lib64/crtn.o]
collapse library dir [/usr/lib/gcc/x86_64-redhat-linux/8] ==> [/usr/lib/gcc/x86_64-redhat-linux/8]
collapse library dir [/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64] ==> [/usr/lib64]
collapse library dir [/lib/../lib64] ==> [/lib64]
collapse library dir [/usr/lib/../lib64] ==> [/usr/lib64]
collapse library dir [/usr/lib/gcc/x86_64-redhat-linux/8/../../..] ==> [/usr/lib]
implicit libs: [stdc++;m;gcc_s;gcc;c;gcc_s;gcc]
implicit objs: [/usr/lib64/crt1.o;/usr/lib64/crti.o;/usr/lib/gcc/x86_64-redhat-linux/8/crtbegin.o;/usr/lib/gcc/x86_64-redhat-linux/8/crtend.o;/usr/lib64/crtn.o]
implicit dirs: [/usr/lib/gcc/x86_64-redhat-linux/8;/usr/lib64;/lib64;/usr/lib]
implicit fwks: []
...

View File

@ -0,0 +1,16 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.26
# Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build")
# Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1)
# The C and CXX include file regular expressions for this directory.
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})

View File

@ -0,0 +1,127 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.26
# The generator used is:
set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles")
# The top level Makefile was generated from the following files:
set(CMAKE_MAKEFILE_DEPENDS
"CMakeCache.txt"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeCCompiler.cmake.in"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeCCompilerABI.c"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeCInformation.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeCXXCompiler.cmake.in"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeCXXCompilerABI.cpp"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeCXXInformation.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeCommonLanguageInclude.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeCompilerIdDetection.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCXXCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCompileFeatures.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCompilerABI.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineCompilerId.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeDetermineSystem.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeFindBinUtils.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeGenericSystem.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeInitializeConfigs.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeLanguageInformation.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeParseImplicitIncludeInfo.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeParseImplicitLinkInfo.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeParseLibraryArchitecture.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeSystem.cmake.in"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeSystemSpecificInformation.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeSystemSpecificInitialize.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeTestCCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeTestCXXCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeTestCompilerCommon.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/CMakeUnixFindMake.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/ADSP-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/ARMCC-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/ARMClang-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/AppleClang-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/Borland-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/Bruce-C-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/CMakeCommonCompilerMacros.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/Clang-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/Clang-DetermineCompilerInternal.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/Compaq-C-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/Cray-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/Embarcadero-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/Fujitsu-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/FujitsuClang-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/GHS-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/GNU-C-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/GNU-C.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/GNU-CXX.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/GNU-FindBinUtils.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/GNU.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/HP-C-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/HP-CXX-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/IAR-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/IBMClang-C-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/IBMClang-CXX-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/Intel-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/IntelLLVM-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/LCC-C-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/LCC-CXX-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/MSVC-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/NVHPC-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/NVIDIA-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/PGI-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/PathScale-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/SCO-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/SDCC-C-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/SunPro-C-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/TI-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/Tasking-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/Watcom-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/XL-C-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/XL-CXX-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/XLClang-C-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/zOS-C-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Internal/FeatureTesting.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Platform/Linux-Determine-CXX.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Platform/Linux-GNU-C.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Platform/Linux-GNU-CXX.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Platform/Linux-GNU.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Platform/Linux.cmake"
"/usr/data/zt/download/cmake-3.26.3/Modules/Platform/UnixPaths.cmake"
"/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/CMakeLists.txt"
"CMakeFiles/3.26.3/CMakeCCompiler.cmake"
"CMakeFiles/3.26.3/CMakeCXXCompiler.cmake"
"CMakeFiles/3.26.3/CMakeSystem.cmake"
)
# The corresponding makefile is:
set(CMAKE_MAKEFILE_OUTPUTS
"Makefile"
"CMakeFiles/cmake.check_cache"
)
# Byproducts of CMake generate step:
set(CMAKE_MAKEFILE_PRODUCTS
"CMakeFiles/3.26.3/CMakeSystem.cmake"
"CMakeFiles/3.26.3/CMakeCCompiler.cmake"
"CMakeFiles/3.26.3/CMakeCXXCompiler.cmake"
"CMakeFiles/3.26.3/CMakeCCompiler.cmake"
"CMakeFiles/3.26.3/CMakeCXXCompiler.cmake"
"CMakeFiles/CMakeDirectoryInformation.cmake"
)
# Dependency information for all targets:
set(CMAKE_DEPEND_INFO_FILES
"CMakeFiles/VSConfig.dir/DependInfo.cmake"
)

View File

@ -0,0 +1,112 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.26
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Disable VCS-based implicit rules.
% : %,v
# Disable VCS-based implicit rules.
% : RCS/%
# Disable VCS-based implicit rules.
% : RCS/%,v
# Disable VCS-based implicit rules.
% : SCCS/s.%
# Disable VCS-based implicit rules.
% : s.%
.SUFFIXES: .hpux_make_needs_suffix_list
# Command-line flag to silence nested $(MAKE).
$(VERBOSE)MAKESILENT = -s
#Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/data/zt/download/cmake-3.26.3/bin/cmake
# The command to remove a file.
RM = /usr/data/zt/download/cmake-3.26.3/bin/cmake -E rm -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build
#=============================================================================
# Directory level rules for the build root directory
# The main recursive "all" target.
all: CMakeFiles/VSConfig.dir/all
.PHONY : all
# The main recursive "preinstall" target.
preinstall:
.PHONY : preinstall
# The main recursive "clean" target.
clean: CMakeFiles/VSConfig.dir/clean
.PHONY : clean
#=============================================================================
# Target rules for target CMakeFiles/VSConfig.dir
# All Build rule for target.
CMakeFiles/VSConfig.dir/all:
$(MAKE) $(MAKESILENT) -f CMakeFiles/VSConfig.dir/build.make CMakeFiles/VSConfig.dir/depend
$(MAKE) $(MAKESILENT) -f CMakeFiles/VSConfig.dir/build.make CMakeFiles/VSConfig.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles --progress-num=1,2,3,4 "Built target VSConfig"
.PHONY : CMakeFiles/VSConfig.dir/all
# Build rule for subdir invocation for target.
CMakeFiles/VSConfig.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles 4
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/VSConfig.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles 0
.PHONY : CMakeFiles/VSConfig.dir/rule
# Convenience name for target.
VSConfig: CMakeFiles/VSConfig.dir/rule
.PHONY : VSConfig
# clean rule for target.
CMakeFiles/VSConfig.dir/clean:
$(MAKE) $(MAKESILENT) -f CMakeFiles/VSConfig.dir/build.make CMakeFiles/VSConfig.dir/clean
.PHONY : CMakeFiles/VSConfig.dir/clean
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system

View File

@ -0,0 +1,7 @@
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/VSConfig.dir
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/edit_cache.dir
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/rebuild_cache.dir
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/list_install_components.dir
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/install.dir
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/install/local.dir
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/install/strip.dir

View File

@ -0,0 +1,21 @@
# Consider dependencies only in project.
set(CMAKE_DEPENDS_IN_PROJECT_ONLY OFF)
# The set of languages for which implicit dependencies are needed:
set(CMAKE_DEPENDS_LANGUAGES
)
# The set of dependency files which are needed:
set(CMAKE_DEPENDS_DEPENDENCY_FILES
"/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/VSConfig.c" "CMakeFiles/VSConfig.dir/src/VSConfig.c.o" "gcc" "CMakeFiles/VSConfig.dir/src/VSConfig.c.o.d"
"/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/cJSON.c" "CMakeFiles/VSConfig.dir/src/cJSON.c.o" "gcc" "CMakeFiles/VSConfig.dir/src/cJSON.c.o.d"
"/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/cJSON_Utils.c" "CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o" "gcc" "CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o.d"
)
# Targets to which this target links which contain Fortran sources.
set(CMAKE_Fortran_TARGET_LINKED_INFO_FILES
)
# Fortran module output directory.
set(CMAKE_Fortran_TARGET_MODULE_DIR "")

View File

@ -0,0 +1,142 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.26
# Delete rule output on recipe failure.
.DELETE_ON_ERROR:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Disable VCS-based implicit rules.
% : %,v
# Disable VCS-based implicit rules.
% : RCS/%
# Disable VCS-based implicit rules.
% : RCS/%,v
# Disable VCS-based implicit rules.
% : SCCS/s.%
# Disable VCS-based implicit rules.
% : s.%
.SUFFIXES: .hpux_make_needs_suffix_list
# Command-line flag to silence nested $(MAKE).
$(VERBOSE)MAKESILENT = -s
#Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/data/zt/download/cmake-3.26.3/bin/cmake
# The command to remove a file.
RM = /usr/data/zt/download/cmake-3.26.3/bin/cmake -E rm -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build
# Include any dependencies generated for this target.
include CMakeFiles/VSConfig.dir/depend.make
# Include any dependencies generated by the compiler for this target.
include CMakeFiles/VSConfig.dir/compiler_depend.make
# Include the progress variables for this target.
include CMakeFiles/VSConfig.dir/progress.make
# Include the compile flags for this target's objects.
include CMakeFiles/VSConfig.dir/flags.make
CMakeFiles/VSConfig.dir/src/VSConfig.c.o: CMakeFiles/VSConfig.dir/flags.make
CMakeFiles/VSConfig.dir/src/VSConfig.c.o: /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/VSConfig.c
CMakeFiles/VSConfig.dir/src/VSConfig.c.o: CMakeFiles/VSConfig.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object CMakeFiles/VSConfig.dir/src/VSConfig.c.o"
/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -MD -MT CMakeFiles/VSConfig.dir/src/VSConfig.c.o -MF CMakeFiles/VSConfig.dir/src/VSConfig.c.o.d -o CMakeFiles/VSConfig.dir/src/VSConfig.c.o -c /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/VSConfig.c
CMakeFiles/VSConfig.dir/src/VSConfig.c.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/VSConfig.dir/src/VSConfig.c.i"
/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/VSConfig.c > CMakeFiles/VSConfig.dir/src/VSConfig.c.i
CMakeFiles/VSConfig.dir/src/VSConfig.c.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/VSConfig.dir/src/VSConfig.c.s"
/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/VSConfig.c -o CMakeFiles/VSConfig.dir/src/VSConfig.c.s
CMakeFiles/VSConfig.dir/src/cJSON.c.o: CMakeFiles/VSConfig.dir/flags.make
CMakeFiles/VSConfig.dir/src/cJSON.c.o: /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/cJSON.c
CMakeFiles/VSConfig.dir/src/cJSON.c.o: CMakeFiles/VSConfig.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building C object CMakeFiles/VSConfig.dir/src/cJSON.c.o"
/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -MD -MT CMakeFiles/VSConfig.dir/src/cJSON.c.o -MF CMakeFiles/VSConfig.dir/src/cJSON.c.o.d -o CMakeFiles/VSConfig.dir/src/cJSON.c.o -c /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/cJSON.c
CMakeFiles/VSConfig.dir/src/cJSON.c.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/VSConfig.dir/src/cJSON.c.i"
/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/cJSON.c > CMakeFiles/VSConfig.dir/src/cJSON.c.i
CMakeFiles/VSConfig.dir/src/cJSON.c.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/VSConfig.dir/src/cJSON.c.s"
/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/cJSON.c -o CMakeFiles/VSConfig.dir/src/cJSON.c.s
CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o: CMakeFiles/VSConfig.dir/flags.make
CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o: /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/cJSON_Utils.c
CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o: CMakeFiles/VSConfig.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building C object CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o"
/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -MD -MT CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o -MF CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o.d -o CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o -c /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/cJSON_Utils.c
CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.i"
/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/cJSON_Utils.c > CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.i
CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.s"
/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/cJSON_Utils.c -o CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.s
# Object files for target VSConfig
VSConfig_OBJECTS = \
"CMakeFiles/VSConfig.dir/src/VSConfig.c.o" \
"CMakeFiles/VSConfig.dir/src/cJSON.c.o" \
"CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o"
# External object files for target VSConfig
VSConfig_EXTERNAL_OBJECTS =
libVSConfig.so: CMakeFiles/VSConfig.dir/src/VSConfig.c.o
libVSConfig.so: CMakeFiles/VSConfig.dir/src/cJSON.c.o
libVSConfig.so: CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o
libVSConfig.so: CMakeFiles/VSConfig.dir/build.make
libVSConfig.so: CMakeFiles/VSConfig.dir/link.txt
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Linking C shared library libVSConfig.so"
$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/VSConfig.dir/link.txt --verbose=$(VERBOSE)
# Rule to build all files generated by this target.
CMakeFiles/VSConfig.dir/build: libVSConfig.so
.PHONY : CMakeFiles/VSConfig.dir/build
CMakeFiles/VSConfig.dir/clean:
$(CMAKE_COMMAND) -P CMakeFiles/VSConfig.dir/cmake_clean.cmake
.PHONY : CMakeFiles/VSConfig.dir/clean
CMakeFiles/VSConfig.dir/depend:
cd /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles/VSConfig.dir/DependInfo.cmake --color=$(COLOR)
.PHONY : CMakeFiles/VSConfig.dir/depend

View File

@ -0,0 +1,15 @@
file(REMOVE_RECURSE
"CMakeFiles/VSConfig.dir/src/VSConfig.c.o"
"CMakeFiles/VSConfig.dir/src/VSConfig.c.o.d"
"CMakeFiles/VSConfig.dir/src/cJSON.c.o"
"CMakeFiles/VSConfig.dir/src/cJSON.c.o.d"
"CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o"
"CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o.d"
"libVSConfig.pdb"
"libVSConfig.so"
)
# Per-language clean rules from dependency scanning.
foreach(lang C)
include(CMakeFiles/VSConfig.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()

View File

@ -0,0 +1,2 @@
# Empty compiler generated dependencies file for VSConfig.
# This may be replaced when dependencies are built.

View File

@ -0,0 +1,2 @@
# CMAKE generated file: DO NOT EDIT!
# Timestamp file for compiler generated dependencies management for VSConfig.

View File

@ -0,0 +1,2 @@
# Empty dependencies file for VSConfig.
# This may be replaced when dependencies are built.

View File

@ -0,0 +1,10 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.26
# compile C with /usr/bin/cc
C_DEFINES = -DVSConfig_EXPORTS
C_INCLUDES = -I/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/include
C_FLAGS = -fPIC -fPIC

View File

@ -0,0 +1 @@
/usr/bin/cc -fPIC -shared -Wl,-soname,libVSConfig.so -o libVSConfig.so CMakeFiles/VSConfig.dir/src/VSConfig.c.o CMakeFiles/VSConfig.dir/src/cJSON.c.o CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o

View File

@ -0,0 +1,5 @@
CMAKE_PROGRESS_1 = 1
CMAKE_PROGRESS_2 = 2
CMAKE_PROGRESS_3 = 3
CMAKE_PROGRESS_4 = 4

View File

@ -0,0 +1,37 @@
CMakeFiles/VSConfig.dir/src/VSConfig.c.o: \
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/VSConfig.c \
/usr/include/stdc-predef.h \
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/include/VSConfig.h \
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/include/cJSON/cJSON.h \
/usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h /usr/include/stdio.h \
/usr/include/bits/libc-header-start.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
/usr/include/bits/long-double.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-64.h \
/usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/bits/types/__fpos_t.h /usr/include/bits/types/__mbstate_t.h \
/usr/include/bits/types/__fpos64_t.h /usr/include/bits/types/__FILE.h \
/usr/include/bits/types/FILE.h /usr/include/bits/types/struct_FILE.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/stdlib.h /usr/include/bits/waitflags.h \
/usr/include/bits/waitstatus.h /usr/include/bits/floatn.h \
/usr/include/bits/floatn-common.h /usr/include/sys/types.h \
/usr/include/bits/types/clock_t.h /usr/include/bits/types/clockid_t.h \
/usr/include/bits/types/time_t.h /usr/include/bits/types/timer_t.h \
/usr/include/bits/stdint-intn.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/bits/byteswap.h \
/usr/include/bits/uintn-identity.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/types/sigset_t.h \
/usr/include/bits/types/__sigset_t.h \
/usr/include/bits/types/struct_timeval.h \
/usr/include/bits/types/struct_timespec.h \
/usr/include/bits/pthreadtypes.h /usr/include/bits/thread-shared-types.h \
/usr/include/bits/pthreadtypes-arch.h /usr/include/alloca.h \
/usr/include/bits/stdlib-float.h /usr/include/string.h \
/usr/include/bits/types/locale_t.h /usr/include/bits/types/__locale_t.h \
/usr/include/strings.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \
/usr/include/bits/fcntl-linux.h /usr/include/bits/stat.h \
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
/usr/include/bits/environments.h /usr/include/bits/confname.h \
/usr/include/bits/getopt_posix.h /usr/include/bits/getopt_core.h

View File

@ -0,0 +1,42 @@
CMakeFiles/VSConfig.dir/src/cJSON.c.o: \
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/cJSON.c \
/usr/include/stdc-predef.h /usr/include/string.h \
/usr/include/bits/libc-header-start.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
/usr/include/bits/long-double.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-64.h \
/usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h \
/usr/include/bits/types/locale_t.h /usr/include/bits/types/__locale_t.h \
/usr/include/strings.h /usr/include/stdio.h \
/usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/bits/types/__fpos_t.h /usr/include/bits/types/__mbstate_t.h \
/usr/include/bits/types/__fpos64_t.h /usr/include/bits/types/__FILE.h \
/usr/include/bits/types/FILE.h /usr/include/bits/types/struct_FILE.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/math.h /usr/include/bits/math-vector.h \
/usr/include/bits/libm-simd-decl-stubs.h /usr/include/bits/floatn.h \
/usr/include/bits/floatn-common.h /usr/include/bits/flt-eval-method.h \
/usr/include/bits/fp-logb.h /usr/include/bits/fp-fast.h \
/usr/include/bits/mathcalls-helper-functions.h \
/usr/include/bits/mathcalls.h /usr/include/stdlib.h \
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
/usr/include/sys/types.h /usr/include/bits/types/clock_t.h \
/usr/include/bits/types/clockid_t.h /usr/include/bits/types/time_t.h \
/usr/include/bits/types/timer_t.h /usr/include/bits/stdint-intn.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/bits/byteswap.h /usr/include/bits/uintn-identity.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/types/sigset_t.h /usr/include/bits/types/__sigset_t.h \
/usr/include/bits/types/struct_timeval.h \
/usr/include/bits/types/struct_timespec.h \
/usr/include/bits/pthreadtypes.h /usr/include/bits/thread-shared-types.h \
/usr/include/bits/pthreadtypes-arch.h /usr/include/alloca.h \
/usr/include/bits/stdlib-float.h \
/usr/lib/gcc/x86_64-redhat-linux/8/include/limits.h \
/usr/lib/gcc/x86_64-redhat-linux/8/include/syslimits.h \
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
/usr/include/bits/posix2_lim.h /usr/include/ctype.h \
/usr/lib/gcc/x86_64-redhat-linux/8/include/float.h \
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/include/cJSON/cJSON.h

View File

@ -0,0 +1,43 @@
CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o: \
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/src/cJSON_Utils.c \
/usr/include/stdc-predef.h /usr/include/ctype.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
/usr/include/bits/long-double.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-64.h /usr/include/bits/types.h \
/usr/include/bits/typesizes.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/bits/byteswap.h \
/usr/include/bits/uintn-identity.h /usr/include/bits/types/locale_t.h \
/usr/include/bits/types/__locale_t.h /usr/include/string.h \
/usr/include/bits/libc-header-start.h \
/usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h \
/usr/include/strings.h /usr/include/stdlib.h \
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
/usr/include/bits/floatn.h /usr/include/bits/floatn-common.h \
/usr/include/sys/types.h /usr/include/bits/types/clock_t.h \
/usr/include/bits/types/clockid_t.h /usr/include/bits/types/time_t.h \
/usr/include/bits/types/timer_t.h /usr/include/bits/stdint-intn.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/types/sigset_t.h /usr/include/bits/types/__sigset_t.h \
/usr/include/bits/types/struct_timeval.h \
/usr/include/bits/types/struct_timespec.h \
/usr/include/bits/pthreadtypes.h /usr/include/bits/thread-shared-types.h \
/usr/include/bits/pthreadtypes-arch.h /usr/include/alloca.h \
/usr/include/bits/stdlib-float.h /usr/include/stdio.h \
/usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h \
/usr/include/bits/types/__fpos_t.h /usr/include/bits/types/__mbstate_t.h \
/usr/include/bits/types/__fpos64_t.h /usr/include/bits/types/__FILE.h \
/usr/include/bits/types/FILE.h /usr/include/bits/types/struct_FILE.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/lib/gcc/x86_64-redhat-linux/8/include/limits.h \
/usr/lib/gcc/x86_64-redhat-linux/8/include/syslimits.h \
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
/usr/include/bits/posix2_lim.h /usr/include/math.h \
/usr/include/bits/math-vector.h /usr/include/bits/libm-simd-decl-stubs.h \
/usr/include/bits/flt-eval-method.h /usr/include/bits/fp-logb.h \
/usr/include/bits/fp-fast.h \
/usr/include/bits/mathcalls-helper-functions.h \
/usr/include/bits/mathcalls.h \
/usr/lib/gcc/x86_64-redhat-linux/8/include/float.h \
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/include/cJSON/cJSON_Utils.h \
/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/include/cJSON/cJSON.h

View File

@ -0,0 +1 @@
# This file is generated by cmake for dependency checking of the CMakeCache.txt file

View File

@ -0,0 +1 @@
4

View File

@ -0,0 +1,284 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.26
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Disable VCS-based implicit rules.
% : %,v
# Disable VCS-based implicit rules.
% : RCS/%
# Disable VCS-based implicit rules.
% : RCS/%,v
# Disable VCS-based implicit rules.
% : SCCS/s.%
# Disable VCS-based implicit rules.
% : s.%
.SUFFIXES: .hpux_make_needs_suffix_list
# Command-line flag to silence nested $(MAKE).
$(VERBOSE)MAKESILENT = -s
#Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/data/zt/download/cmake-3.26.3/bin/cmake
# The command to remove a file.
RM = /usr/data/zt/download/cmake-3.26.3/bin/cmake -E rm -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
/usr/data/zt/download/cmake-3.26.3/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
.PHONY : edit_cache
# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast
# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/usr/data/zt/download/cmake-3.26.3/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast
# Special rule for the target list_install_components
list_install_components:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
.PHONY : list_install_components
# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast
# Special rule for the target install
install: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/data/zt/download/cmake-3.26.3/bin/cmake -P cmake_install.cmake
.PHONY : install
# Special rule for the target install
install/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/data/zt/download/cmake-3.26.3/bin/cmake -P cmake_install.cmake
.PHONY : install/fast
# Special rule for the target install/local
install/local: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/usr/data/zt/download/cmake-3.26.3/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local
# Special rule for the target install/local
install/local/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/usr/data/zt/download/cmake-3.26.3/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local/fast
# Special rule for the target install/strip
install/strip: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/usr/data/zt/download/cmake-3.26.3/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip
# Special rule for the target install/strip
install/strip/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/usr/data/zt/download/cmake-3.26.3/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip/fast
# The main all target
all: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build//CMakeFiles/progress.marks
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all
$(CMAKE_COMMAND) -E cmake_progress_start /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/CMakeFiles 0
.PHONY : all
# The main clean target
clean:
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean
.PHONY : clean
# The main clean target
clean/fast: clean
.PHONY : clean/fast
# Prepare targets for installation.
preinstall: all
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall
# Prepare targets for installation.
preinstall/fast:
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall/fast
# clear depends
depend:
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend
#=============================================================================
# Target rules for targets named VSConfig
# Build rule for target.
VSConfig: cmake_check_build_system
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 VSConfig
.PHONY : VSConfig
# fast build rule for target.
VSConfig/fast:
$(MAKE) $(MAKESILENT) -f CMakeFiles/VSConfig.dir/build.make CMakeFiles/VSConfig.dir/build
.PHONY : VSConfig/fast
src/VSConfig.o: src/VSConfig.c.o
.PHONY : src/VSConfig.o
# target to build an object file
src/VSConfig.c.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/VSConfig.dir/build.make CMakeFiles/VSConfig.dir/src/VSConfig.c.o
.PHONY : src/VSConfig.c.o
src/VSConfig.i: src/VSConfig.c.i
.PHONY : src/VSConfig.i
# target to preprocess a source file
src/VSConfig.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/VSConfig.dir/build.make CMakeFiles/VSConfig.dir/src/VSConfig.c.i
.PHONY : src/VSConfig.c.i
src/VSConfig.s: src/VSConfig.c.s
.PHONY : src/VSConfig.s
# target to generate assembly for a file
src/VSConfig.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/VSConfig.dir/build.make CMakeFiles/VSConfig.dir/src/VSConfig.c.s
.PHONY : src/VSConfig.c.s
src/cJSON.o: src/cJSON.c.o
.PHONY : src/cJSON.o
# target to build an object file
src/cJSON.c.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/VSConfig.dir/build.make CMakeFiles/VSConfig.dir/src/cJSON.c.o
.PHONY : src/cJSON.c.o
src/cJSON.i: src/cJSON.c.i
.PHONY : src/cJSON.i
# target to preprocess a source file
src/cJSON.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/VSConfig.dir/build.make CMakeFiles/VSConfig.dir/src/cJSON.c.i
.PHONY : src/cJSON.c.i
src/cJSON.s: src/cJSON.c.s
.PHONY : src/cJSON.s
# target to generate assembly for a file
src/cJSON.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/VSConfig.dir/build.make CMakeFiles/VSConfig.dir/src/cJSON.c.s
.PHONY : src/cJSON.c.s
src/cJSON_Utils.o: src/cJSON_Utils.c.o
.PHONY : src/cJSON_Utils.o
# target to build an object file
src/cJSON_Utils.c.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/VSConfig.dir/build.make CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.o
.PHONY : src/cJSON_Utils.c.o
src/cJSON_Utils.i: src/cJSON_Utils.c.i
.PHONY : src/cJSON_Utils.i
# target to preprocess a source file
src/cJSON_Utils.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/VSConfig.dir/build.make CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.i
.PHONY : src/cJSON_Utils.c.i
src/cJSON_Utils.s: src/cJSON_Utils.c.s
.PHONY : src/cJSON_Utils.s
# target to generate assembly for a file
src/cJSON_Utils.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/VSConfig.dir/build.make CMakeFiles/VSConfig.dir/src/cJSON_Utils.c.s
.PHONY : src/cJSON_Utils.c.s
# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... edit_cache"
@echo "... install"
@echo "... install/local"
@echo "... install/strip"
@echo "... list_install_components"
@echo "... rebuild_cache"
@echo "... VSConfig"
@echo "... src/VSConfig.o"
@echo "... src/VSConfig.i"
@echo "... src/VSConfig.s"
@echo "... src/cJSON.o"
@echo "... src/cJSON.i"
@echo "... src/cJSON.s"
@echo "... src/cJSON_Utils.o"
@echo "... src/cJSON_Utils.i"
@echo "... src/cJSON_Utils.s"
.PHONY : help
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system

View File

@ -0,0 +1,77 @@
# Install script for directory: /usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/bin")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "0")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set default install directory permissions.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libVSConfig.so" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libVSConfig.so")
file(RPATH_CHECK
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libVSConfig.so"
RPATH "")
endif()
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE SHARED_LIBRARY FILES "/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/libVSConfig.so")
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libVSConfig.so" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libVSConfig.so")
if(CMAKE_INSTALL_DO_STRIP)
execute_process(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libVSConfig.so")
endif()
endif()
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include/VSConfig" TYPE FILE FILES "/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/include/VSConfig.h")
endif()
if(CMAKE_INSTALL_COMPONENT)
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
else()
set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
file(WRITE "/usr/data/zt/git/AW-Sm-Rpc/utils/VSConfig/build/${CMAKE_INSTALL_MANIFEST}"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")

Binary file not shown.

View File

@ -0,0 +1,49 @@
#ifndef __VSCONFIG_H__
#define __VSCONFIG_H__
enum VSConfigType_E
{
VSConfigTypeString,
VSConfigTypeInt,
VSConfigTypeDouble,
VSConfigTypeStringOption,
VSConfigTypeIntOption,
VSConfigTypeDoubleOption
};
#define VSConfigMandatory 1
#define VSConfigOptional 2
typedef struct VSConfig_S
{
int Type;
char *Name;
union
{
int *piValue;
double *plfValue;
char *pcValue;
}pValue;
int ValueMaxLen;
char *Detail;
}VSConfig_s, *pVSConfig_s;
#define VSConfigStart {
#define VSConfigString(Name, _Value, ValueMaxLen, Detail) { VSConfigTypeString, (char *)Name, .pValue.pcValue = (char *)(_Value), ValueMaxLen, Detail },
#define VSConfigInt(Name, _Value, Detail) { VSConfigTypeInt, (char *)Name, .pValue.piValue = (int *)(_Value), 0, Detail },
#define VSConfigDouble(Name, _Value, Detail) { VSConfigTypeDouble, (char *)Name, .pValue.plfValue = (double *)(_Value), 0, Detail },
#define VSConfigStringOption(Name, _Value, ValueMaxLen, Detail) { VSConfigTypeStringOption, (char *)Name, .pValue.pcValue = (char *)(_Value), ValueMaxLen, Detail },
#define VSConfigIntOption(Name, _Value, Detail) { VSConfigTypeIntOption, (char *)Name, .pValue.piValue = (int *)(_Value), 0, Detail },
#define VSConfigDoubleOption(Name, _Value, Detail) { VSConfigTypeDoubleOption, (char *)Name, .pValue.plfValue = (double *)(_Value), 0, Detail },
#define VSConfigNULL { 0, 0, 0, 0, 0 }
#define VSConfigEnd VSConfigNULL };
void VSConfigHelp(pVSConfig_s psVSConfig);
int VSConfig(pVSConfig_s psVSConfig, char *pcFilePath);
#endif

View File

@ -0,0 +1,300 @@
/*
Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
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.
*/
#ifndef cJSON__h
#define cJSON__h
#ifdef __cplusplus
extern "C"
{
#endif
#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32))
#define __WINDOWS__
#endif
#ifdef __WINDOWS__
/* When compiling for windows, we specify a specific calling convention to avoid issues where we are being called from a project with a different default calling convention. For windows you have 3 define options:
CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols
CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default)
CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol
For *nix builds that support visibility attribute, you can define similar behavior by
setting default visibility to hidden by adding
-fvisibility=hidden (for gcc)
or
-xldscope=hidden (for sun cc)
to CFLAGS
then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does
*/
#define CJSON_CDECL __cdecl
#define CJSON_STDCALL __stdcall
/* export symbols by default, this is necessary for copy pasting the C and header file */
#if !defined(CJSON_HIDE_SYMBOLS) && !defined(CJSON_IMPORT_SYMBOLS) && !defined(CJSON_EXPORT_SYMBOLS)
#define CJSON_EXPORT_SYMBOLS
#endif
#if defined(CJSON_HIDE_SYMBOLS)
#define CJSON_PUBLIC(type) type CJSON_STDCALL
#elif defined(CJSON_EXPORT_SYMBOLS)
#define CJSON_PUBLIC(type) __declspec(dllexport) type CJSON_STDCALL
#elif defined(CJSON_IMPORT_SYMBOLS)
#define CJSON_PUBLIC(type) __declspec(dllimport) type CJSON_STDCALL
#endif
#else /* !__WINDOWS__ */
#define CJSON_CDECL
#define CJSON_STDCALL
#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(CJSON_API_VISIBILITY)
#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type
#else
#define CJSON_PUBLIC(type) type
#endif
#endif
/* project version */
#define CJSON_VERSION_MAJOR 1
#define CJSON_VERSION_MINOR 7
#define CJSON_VERSION_PATCH 15
#include <stddef.h>
/* cJSON Types: */
#define cJSON_Invalid (0)
#define cJSON_False (1 << 0)
#define cJSON_True (1 << 1)
#define cJSON_NULL (1 << 2)
#define cJSON_Number (1 << 3)
#define cJSON_String (1 << 4)
#define cJSON_Array (1 << 5)
#define cJSON_Object (1 << 6)
#define cJSON_Raw (1 << 7) /* raw json */
#define cJSON_IsReference 256
#define cJSON_StringIsConst 512
/* The cJSON structure: */
typedef struct cJSON
{
/* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
struct cJSON *next;
struct cJSON *prev;
/* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
struct cJSON *child;
/* The type of the item, as above. */
int type;
/* The item's string, if type==cJSON_String and type == cJSON_Raw */
char *valuestring;
/* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */
int valueint;
/* The item's number, if type==cJSON_Number */
double valuedouble;
/* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
char *string;
} cJSON;
typedef struct cJSON_Hooks
{
/* malloc/free are CDECL on Windows regardless of the default calling convention of the compiler, so ensure the hooks allow passing those functions directly. */
void *(CJSON_CDECL *malloc_fn)(size_t sz);
void (CJSON_CDECL *free_fn)(void *ptr);
} cJSON_Hooks;
typedef int cJSON_bool;
/* Limits how deeply nested arrays/objects can be before cJSON rejects to parse them.
* This is to prevent stack overflows. */
#ifndef CJSON_NESTING_LIMIT
#define CJSON_NESTING_LIMIT 1000
#endif
/* returns the version of cJSON as a string */
CJSON_PUBLIC(const char*) cJSON_Version(void);
/* Supply malloc, realloc and free functions to cJSON */
CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks);
/* Memory Management: the caller is always responsible to free the results from all variants of cJSON_Parse (with cJSON_Delete) and cJSON_Print (with stdlib free, cJSON_Hooks.free_fn, or cJSON_free as appropriate). The exception is cJSON_PrintPreallocated, where the caller has full responsibility of the buffer. */
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. */
CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value);
CJSON_PUBLIC(cJSON *) cJSON_ParseWithLength(const char *value, size_t buffer_length);
/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */
/* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error so will match cJSON_GetErrorPtr(). */
CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated);
CJSON_PUBLIC(cJSON *) cJSON_ParseWithLengthOpts(const char *value, size_t buffer_length, const char **return_parse_end, cJSON_bool require_null_terminated);
/* Render a cJSON entity to text for transfer/storage. */
CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item);
/* Render a cJSON entity to text for transfer/storage without any formatting. */
CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item);
/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */
CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt);
/* Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. */
/* NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need */
CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format);
/* Delete a cJSON entity and all subentities. */
CJSON_PUBLIC(void) cJSON_Delete(cJSON *item);
/* Returns the number of items in an array (or object). */
CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array);
/* Retrieve item number "index" from array "array". Returns NULL if unsuccessful. */
CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index);
/* Get item "string" from object. Case insensitive. */
CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string);
CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string);
CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const 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. */
CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void);
/* Check item type and return its value */
CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item);
CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item);
/* These functions check the type of an item */
CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item);
/* These calls create a cJSON item of the appropriate type. */
CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void);
CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void);
CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void);
CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean);
CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num);
CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string);
/* raw json */
CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw);
CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void);
CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void);
/* Create a string where valuestring references a string so
* it will not be freed by cJSON_Delete */
CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string);
/* Create an object/array that only references it's elements so
* they will not be freed by cJSON_Delete */
CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child);
CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child);
/* These utilities create an Array of count items.
* The parameter count cannot be greater than the number of elements in the number array, otherwise array access will be out of bounds.*/
CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count);
CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count);
CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count);
CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char *const *strings, int count);
/* Append item to the specified array/object. */
CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToArray(cJSON *array, cJSON *item);
CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item);
/* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object.
* WARNING: When this function was used, make sure to always check that (item->type & cJSON_StringIsConst) is zero before
* writing to `item->string` */
CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObjectCS(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. */
CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item);
/* Remove/Detach items from Arrays/Objects. */
CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item);
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which);
CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which);
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string);
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string);
CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string);
CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string);
/* Update array items. */
CJSON_PUBLIC(cJSON_bool) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */
CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement);
CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem);
CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem);
/* Duplicate a cJSON item */
CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool 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. */
/* Recursively compare two cJSON items for equality. If either a or b is NULL or invalid, they will be considered unequal.
* case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */
CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive);
/* Minify a strings, remove blank characters(such as ' ', '\t', '\r', '\n') from strings.
* The input pointer json cannot point to a read-only address area, such as a string constant,
* but should point to a readable and writable address area. */
CJSON_PUBLIC(void) cJSON_Minify(char *json);
/* Helper functions for creating and adding items to an object at the same time.
* They return the added item or NULL on failure. */
CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name);
CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name);
CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name);
CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean);
CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number);
CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string);
CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw);
CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name);
CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name);
/* When assigning an integer value, it needs to be propagated to valuedouble too. */
#define cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number))
/* helper for the cJSON_SetNumberValue macro */
CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number);
#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number))
/* Change the valuestring of a cJSON_String object, only takes effect when type of object is cJSON_String */
CJSON_PUBLIC(char*) cJSON_SetValuestring(cJSON *object, const char *valuestring);
/* If the object is not a boolean type this does nothing and returns cJSON_Invalid else it returns the new type*/
#define cJSON_SetBoolValue(object, boolValue) ( \
(object != NULL && ((object)->type & (cJSON_False|cJSON_True))) ? \
(object)->type=((object)->type &(~(cJSON_False|cJSON_True)))|((boolValue)?cJSON_True:cJSON_False) : \
cJSON_Invalid\
)
/* Macro for iterating over an array or object */
#define cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next)
/* malloc/free objects using the malloc/free functions that have been set with cJSON_InitHooks */
CJSON_PUBLIC(void *) cJSON_malloc(size_t size);
CJSON_PUBLIC(void) cJSON_free(void *object);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,88 @@
/*
Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
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.
*/
#ifndef cJSON_Utils__h
#define cJSON_Utils__h
#ifdef __cplusplus
extern "C"
{
#endif
#include "cJSON.h"
/* Implement RFC6901 (https://tools.ietf.org/html/rfc6901) JSON Pointer spec. */
CJSON_PUBLIC(cJSON *) cJSONUtils_GetPointer(cJSON * const object, const char *pointer);
CJSON_PUBLIC(cJSON *) cJSONUtils_GetPointerCaseSensitive(cJSON * const object, const char *pointer);
/* Implement RFC6902 (https://tools.ietf.org/html/rfc6902) JSON Patch spec. */
/* NOTE: This modifies objects in 'from' and 'to' by sorting the elements by their key */
CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatches(cJSON * const from, cJSON * const to);
CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatchesCaseSensitive(cJSON * const from, cJSON * const to);
/* Utility for generating patch array entries. */
CJSON_PUBLIC(void) cJSONUtils_AddPatchToArray(cJSON * const array, const char * const operation, const char * const path, const cJSON * const value);
/* Returns 0 for success. */
CJSON_PUBLIC(int) cJSONUtils_ApplyPatches(cJSON * const object, const cJSON * const patches);
CJSON_PUBLIC(int) cJSONUtils_ApplyPatchesCaseSensitive(cJSON * const object, const cJSON * const patches);
/*
// Note that ApplyPatches is NOT atomic on failure. To implement an atomic ApplyPatches, use:
//int cJSONUtils_AtomicApplyPatches(cJSON **object, cJSON *patches)
//{
// cJSON *modme = cJSON_Duplicate(*object, 1);
// int error = cJSONUtils_ApplyPatches(modme, patches);
// if (!error)
// {
// cJSON_Delete(*object);
// *object = modme;
// }
// else
// {
// cJSON_Delete(modme);
// }
//
// return error;
//}
// Code not added to library since this strategy is a LOT slower.
*/
/* Implement RFC7386 (https://tools.ietf.org/html/rfc7396) JSON Merge Patch spec. */
/* target will be modified by patch. return value is new ptr for target. */
CJSON_PUBLIC(cJSON *) cJSONUtils_MergePatch(cJSON *target, const cJSON * const patch);
CJSON_PUBLIC(cJSON *) cJSONUtils_MergePatchCaseSensitive(cJSON *target, const cJSON * const patch);
/* generates a patch to move from -> to */
/* NOTE: This modifies objects in 'from' and 'to' by sorting the elements by their key */
CJSON_PUBLIC(cJSON *) cJSONUtils_GenerateMergePatch(cJSON * const from, cJSON * const to);
CJSON_PUBLIC(cJSON *) cJSONUtils_GenerateMergePatchCaseSensitive(cJSON * const from, cJSON * const to);
/* Given a root object and a target object, construct a pointer from one to the other. */
CJSON_PUBLIC(char *) cJSONUtils_FindPointerFromObjectTo(const cJSON * const object, const cJSON * const target);
/* Sorts the members of the object into alphabetical order. */
CJSON_PUBLIC(void) cJSONUtils_SortObject(cJSON * const object);
CJSON_PUBLIC(void) cJSONUtils_SortObjectCaseSensitive(cJSON * const object);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,113 @@
#include "VSConfig.h"
#include "cJSON/cJSON.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
void VSConfigHelp(pVSConfig_s psVSConfig)
{
printf("Config Help\n");
for(int iCnt = 0; psVSConfig[iCnt].Name; ++iCnt)
{
switch (psVSConfig[iCnt].Type)
{
case VSConfigTypeString:
printf("*");
case VSConfigTypeStringOption:
printf("[String][MaxLen:%d]%s:%s\n", psVSConfig[iCnt].ValueMaxLen, psVSConfig[iCnt].Name, psVSConfig[iCnt].Detail);
break;
case VSConfigTypeInt:
printf("*");
case VSConfigTypeIntOption:
printf("[Integer]%s:%s\n", psVSConfig[iCnt].Name, psVSConfig[iCnt].Detail);
break;
case VSConfigTypeDouble:
printf("*");
case VSConfigTypeDoubleOption:
printf("[Double]%s:%s\n", psVSConfig[iCnt].Name, psVSConfig[iCnt].Detail);
break;
default:
break;
}
}
return ;
}
int VSConfig(pVSConfig_s psVSConfig, char *pcFilePath)
{
int rv = 0;
int fdFile = -1;
char *pcReadData = NULL;
cJSON *cJSONRoot = NULL;
do
{
fdFile = open(pcFilePath, O_RDONLY, 0777);
if(!fdFile) { /*printf("Open %s fail\n", pcFilePath);*/ rv = -1; break; }
int iFileLen = lseek(fdFile, 0, SEEK_END);
lseek(fdFile, 0, SEEK_SET);
pcReadData = (char *)malloc(sizeof(char) * (iFileLen + 1));
if(!pcReadData) { /*printf("Read malloc %d size fail\n", iFileLen);*/ rv = -1; break; }
rv = read(fdFile, pcReadData, iFileLen);
if(rv <= 0) { /*printf("Read fail rv = %d\n", rv);*/ rv = -1; break; }
cJSONRoot = cJSON_Parse(pcReadData);
if(!cJSONRoot) { /*printf("cJSON_Parse %s fail\n", pcReadData);*/ rv = -1; break; }
cJSON *cJSONTmp = NULL;
for(int iCnt = 0; psVSConfig[iCnt].Name; ++iCnt)
{
cJSONTmp = cJSON_GetObjectItem(cJSONRoot, psVSConfig[iCnt].Name);
if(psVSConfig[iCnt].Type < 3)
{
if(!cJSONTmp) { /*printf("%s not found\n", psVSConfig[iCnt].Name);*/ rv = -1; break; }
}
else
{
if(!cJSONTmp) continue;
}
switch (psVSConfig[iCnt].Type)
{
case VSConfigTypeString:
case VSConfigTypeStringOption:
snprintf(psVSConfig[iCnt].pValue.pcValue, psVSConfig[iCnt].ValueMaxLen, "%s", cJSON_GetStringValue(cJSONTmp));
break;
case VSConfigTypeInt:
case VSConfigTypeIntOption:
*psVSConfig[iCnt].pValue.piValue = cJSON_GetNumberValue(cJSONTmp);
break;
case VSConfigTypeDouble:
case VSConfigTypeDoubleOption:
*psVSConfig[iCnt].pValue.plfValue = cJSON_GetNumberValue(cJSONTmp);
break;
default:
break;
}
}
if(rv < 0) break;
rv = 0;
}while(0);
if(fdFile) close(fdFile);
if(pcReadData) free(pcReadData);
if(cJSONRoot) cJSON_Delete(cJSONRoot);
return rv;
}

3114
utils/VSConfig/src/cJSON.c Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
PROJECT(ZMQLayout)
ADD_COMPILE_OPTIONS(-fPIC)
AUX_SOURCE_DIRECTORY(${PROJECT_SOURCE_DIR}/src src_list)
ADD_LIBRARY(${PROJECT_NAME} STATIC ${src_list})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME}
PUBLIC
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/../VSClock/include)
TARGET_LINK_DIRECTORIES(${PROJECT_NAME}
PRIVATE
${CMAKE_SOURCE_DIR}/lib
)
TARGET_LINK_LIBRARIES(${PROJECT_NAME}
PRIVATE
stdc++
VSClock
zmq
)

View File

@ -0,0 +1,26 @@
#ifndef __ZMQLAYOUT_H__
#define __ZMQLAYOUT_H__
#include "zmq.h"
typedef void * pZMQ_s;
pZMQ_s ZMQServerInit(const char *pcAddress);
pZMQ_s ZMQClientInit(const char *pcAddress);
void ZMQDestroy(pZMQ_s psZMQ);
int ZMQSend(void *phZMQ, const char *pcBuf, const int iBufLen);
typedef struct ZMQBuf_S
{
char *pcBuf;
int iBufLen;
}ZMQBuf_s, *pZMQBuf_s;
void ZMQBufDestroy(pZMQBuf_s psZMQBuf);
pZMQBuf_s ZMQRecv(void *phZMQSocket, int iWaitTime);
#endif

View File

@ -0,0 +1,787 @@
/* SPDX-License-Identifier: MPL-2.0 */
/* *************************************************************************
NOTE to contributors. This file comprises the principal public contract
for ZeroMQ API users. Any change to this file supplied in a stable
release SHOULD not break existing applications.
In practice this means that the value of constants must not change, and
that old values may not be reused for new constants.
*************************************************************************
*/
#ifndef __ZMQ_H_INCLUDED__
#define __ZMQ_H_INCLUDED__
/* Version macros for compile-time API version detection */
#define ZMQ_VERSION_MAJOR 4
#define ZMQ_VERSION_MINOR 3
#define ZMQ_VERSION_PATCH 6
#define ZMQ_MAKE_VERSION(major, minor, patch) \
((major) *10000 + (minor) *100 + (patch))
#define ZMQ_VERSION \
ZMQ_MAKE_VERSION (ZMQ_VERSION_MAJOR, ZMQ_VERSION_MINOR, ZMQ_VERSION_PATCH)
#ifdef __cplusplus
extern "C" {
#endif
#if !defined _WIN32_WCE
#include <errno.h>
#endif
#include <stddef.h>
#include <stdio.h>
/* Handle DSO symbol visibility */
#if defined ZMQ_NO_EXPORT
#define ZMQ_EXPORT
#else
#if defined _WIN32
#if defined ZMQ_STATIC
#define ZMQ_EXPORT
#elif defined DLL_EXPORT
#define ZMQ_EXPORT __declspec(dllexport)
#else
#define ZMQ_EXPORT __declspec(dllimport)
#endif
#else
#if defined __SUNPRO_C || defined __SUNPRO_CC
#define ZMQ_EXPORT __global
#elif (defined __GNUC__ && __GNUC__ >= 4) || defined __INTEL_COMPILER
#define ZMQ_EXPORT __attribute__ ((visibility ("default")))
#else
#define ZMQ_EXPORT
#endif
#endif
#endif
/* Define integer types needed for event interface */
#define ZMQ_DEFINED_STDINT 1
#if defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_OPENVMS
#include <inttypes.h>
#elif defined _MSC_VER && _MSC_VER < 1600
#ifndef uint64_t
typedef unsigned __int64 uint64_t;
#endif
#ifndef int32_t
typedef __int32 int32_t;
#endif
#ifndef uint32_t
typedef unsigned __int32 uint32_t;
#endif
#ifndef uint16_t
typedef unsigned __int16 uint16_t;
#endif
#ifndef uint8_t
typedef unsigned __int8 uint8_t;
#endif
#else
#include <stdint.h>
#endif
#if !defined _WIN32
// needed for sigset_t definition in zmq_ppoll
#include <signal.h>
#endif
// 32-bit AIX's pollfd struct members are called reqevents and rtnevents so it
// defines compatibility macros for them. Need to include that header first to
// stop build failures since zmq_pollset_t defines them as events and revents.
#ifdef ZMQ_HAVE_AIX
#include <poll.h>
#endif
/******************************************************************************/
/* 0MQ errors. */
/******************************************************************************/
/* A number random enough not to collide with different errno ranges on */
/* different OSes. The assumption is that error_t is at least 32-bit type. */
#define ZMQ_HAUSNUMERO 156384712
/* On Windows platform some of the standard POSIX errnos are not defined. */
#ifndef ENOTSUP
#define ENOTSUP (ZMQ_HAUSNUMERO + 1)
#endif
#ifndef EPROTONOSUPPORT
#define EPROTONOSUPPORT (ZMQ_HAUSNUMERO + 2)
#endif
#ifndef ENOBUFS
#define ENOBUFS (ZMQ_HAUSNUMERO + 3)
#endif
#ifndef ENETDOWN
#define ENETDOWN (ZMQ_HAUSNUMERO + 4)
#endif
#ifndef EADDRINUSE
#define EADDRINUSE (ZMQ_HAUSNUMERO + 5)
#endif
#ifndef EADDRNOTAVAIL
#define EADDRNOTAVAIL (ZMQ_HAUSNUMERO + 6)
#endif
#ifndef ECONNREFUSED
#define ECONNREFUSED (ZMQ_HAUSNUMERO + 7)
#endif
#ifndef EINPROGRESS
#define EINPROGRESS (ZMQ_HAUSNUMERO + 8)
#endif
#ifndef ENOTSOCK
#define ENOTSOCK (ZMQ_HAUSNUMERO + 9)
#endif
#ifndef EMSGSIZE
#define EMSGSIZE (ZMQ_HAUSNUMERO + 10)
#endif
#ifndef EAFNOSUPPORT
#define EAFNOSUPPORT (ZMQ_HAUSNUMERO + 11)
#endif
#ifndef ENETUNREACH
#define ENETUNREACH (ZMQ_HAUSNUMERO + 12)
#endif
#ifndef ECONNABORTED
#define ECONNABORTED (ZMQ_HAUSNUMERO + 13)
#endif
#ifndef ECONNRESET
#define ECONNRESET (ZMQ_HAUSNUMERO + 14)
#endif
#ifndef ENOTCONN
#define ENOTCONN (ZMQ_HAUSNUMERO + 15)
#endif
#ifndef ETIMEDOUT
#define ETIMEDOUT (ZMQ_HAUSNUMERO + 16)
#endif
#ifndef EHOSTUNREACH
#define EHOSTUNREACH (ZMQ_HAUSNUMERO + 17)
#endif
#ifndef ENETRESET
#define ENETRESET (ZMQ_HAUSNUMERO + 18)
#endif
/* Native 0MQ error codes. */
#define EFSM (ZMQ_HAUSNUMERO + 51)
#define ENOCOMPATPROTO (ZMQ_HAUSNUMERO + 52)
#define ETERM (ZMQ_HAUSNUMERO + 53)
#define EMTHREAD (ZMQ_HAUSNUMERO + 54)
/* This function retrieves the errno as it is known to 0MQ library. The goal */
/* of this function is to make the code 100% portable, including where 0MQ */
/* compiled with certain CRT library (on Windows) is linked to an */
/* application that uses different CRT library. */
ZMQ_EXPORT int zmq_errno (void);
/* Resolves system errors and 0MQ errors to human-readable string. */
ZMQ_EXPORT const char *zmq_strerror (int errnum_);
/* Run-time API version detection */
ZMQ_EXPORT void zmq_version (int *major_, int *minor_, int *patch_);
/******************************************************************************/
/* 0MQ infrastructure (a.k.a. context) initialisation & termination. */
/******************************************************************************/
/* Context options */
#define ZMQ_IO_THREADS 1
#define ZMQ_MAX_SOCKETS 2
#define ZMQ_SOCKET_LIMIT 3
#define ZMQ_THREAD_PRIORITY 3
#define ZMQ_THREAD_SCHED_POLICY 4
#define ZMQ_MAX_MSGSZ 5
#define ZMQ_MSG_T_SIZE 6
#define ZMQ_THREAD_AFFINITY_CPU_ADD 7
#define ZMQ_THREAD_AFFINITY_CPU_REMOVE 8
#define ZMQ_THREAD_NAME_PREFIX 9
/* Default for new contexts */
#define ZMQ_IO_THREADS_DFLT 1
#define ZMQ_MAX_SOCKETS_DFLT 1023
#define ZMQ_THREAD_PRIORITY_DFLT -1
#define ZMQ_THREAD_SCHED_POLICY_DFLT -1
ZMQ_EXPORT void *zmq_ctx_new (void);
ZMQ_EXPORT int zmq_ctx_term (void *context_);
ZMQ_EXPORT int zmq_ctx_shutdown (void *context_);
ZMQ_EXPORT int zmq_ctx_set (void *context_, int option_, int optval_);
ZMQ_EXPORT int zmq_ctx_get (void *context_, int option_);
/* Old (legacy) API */
ZMQ_EXPORT void *zmq_init (int io_threads_);
ZMQ_EXPORT int zmq_term (void *context_);
ZMQ_EXPORT int zmq_ctx_destroy (void *context_);
/******************************************************************************/
/* 0MQ message definition. */
/******************************************************************************/
/* Some architectures, like sparc64 and some variants of aarch64, enforce pointer
* alignment and raise sigbus on violations. Make sure applications allocate
* zmq_msg_t on addresses aligned on a pointer-size boundary to avoid this issue.
*/
typedef struct zmq_msg_t
{
#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64))
__declspec(align (8)) unsigned char _[64];
#elif defined(_MSC_VER) \
&& (defined(_M_IX86) || defined(_M_ARM_ARMV7VE) || defined(_M_ARM))
__declspec(align (4)) unsigned char _[64];
#elif defined(__GNUC__) || defined(__INTEL_COMPILER) \
|| (defined(__SUNPRO_C) && __SUNPRO_C >= 0x590) \
|| (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x590)
unsigned char _[64] __attribute__ ((aligned (sizeof (void *))));
#else
unsigned char _[64];
#endif
} zmq_msg_t;
typedef void (zmq_free_fn) (void *data_, void *hint_);
ZMQ_EXPORT int zmq_msg_init (zmq_msg_t *msg_);
ZMQ_EXPORT int zmq_msg_init_size (zmq_msg_t *msg_, size_t size_);
ZMQ_EXPORT int zmq_msg_init_data (
zmq_msg_t *msg_, void *data_, size_t size_, zmq_free_fn *ffn_, void *hint_);
ZMQ_EXPORT int zmq_msg_send (zmq_msg_t *msg_, void *s_, int flags_);
ZMQ_EXPORT int zmq_msg_recv (zmq_msg_t *msg_, void *s_, int flags_);
ZMQ_EXPORT int zmq_msg_close (zmq_msg_t *msg_);
ZMQ_EXPORT int zmq_msg_move (zmq_msg_t *dest_, zmq_msg_t *src_);
ZMQ_EXPORT int zmq_msg_copy (zmq_msg_t *dest_, zmq_msg_t *src_);
ZMQ_EXPORT void *zmq_msg_data (zmq_msg_t *msg_);
ZMQ_EXPORT size_t zmq_msg_size (const zmq_msg_t *msg_);
ZMQ_EXPORT int zmq_msg_more (const zmq_msg_t *msg_);
ZMQ_EXPORT int zmq_msg_get (const zmq_msg_t *msg_, int property_);
ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg_, int property_, int optval_);
ZMQ_EXPORT const char *zmq_msg_gets (const zmq_msg_t *msg_,
const char *property_);
/******************************************************************************/
/* 0MQ socket definition. */
/******************************************************************************/
/* Socket types. */
#define ZMQ_PAIR 0
#define ZMQ_PUB 1
#define ZMQ_SUB 2
#define ZMQ_REQ 3
#define ZMQ_REP 4
#define ZMQ_DEALER 5
#define ZMQ_ROUTER 6
#define ZMQ_PULL 7
#define ZMQ_PUSH 8
#define ZMQ_XPUB 9
#define ZMQ_XSUB 10
#define ZMQ_STREAM 11
/* Deprecated aliases */
#define ZMQ_XREQ ZMQ_DEALER
#define ZMQ_XREP ZMQ_ROUTER
/* Socket options. */
#define ZMQ_AFFINITY 4
#define ZMQ_ROUTING_ID 5
#define ZMQ_SUBSCRIBE 6
#define ZMQ_UNSUBSCRIBE 7
#define ZMQ_RATE 8
#define ZMQ_RECOVERY_IVL 9
#define ZMQ_SNDBUF 11
#define ZMQ_RCVBUF 12
#define ZMQ_RCVMORE 13
#define ZMQ_FD 14
#define ZMQ_EVENTS 15
#define ZMQ_TYPE 16
#define ZMQ_LINGER 17
#define ZMQ_RECONNECT_IVL 18
#define ZMQ_BACKLOG 19
#define ZMQ_RECONNECT_IVL_MAX 21
#define ZMQ_MAXMSGSIZE 22
#define ZMQ_SNDHWM 23
#define ZMQ_RCVHWM 24
#define ZMQ_MULTICAST_HOPS 25
#define ZMQ_RCVTIMEO 27
#define ZMQ_SNDTIMEO 28
#define ZMQ_LAST_ENDPOINT 32
#define ZMQ_ROUTER_MANDATORY 33
#define ZMQ_TCP_KEEPALIVE 34
#define ZMQ_TCP_KEEPALIVE_CNT 35
#define ZMQ_TCP_KEEPALIVE_IDLE 36
#define ZMQ_TCP_KEEPALIVE_INTVL 37
#define ZMQ_IMMEDIATE 39
#define ZMQ_XPUB_VERBOSE 40
#define ZMQ_ROUTER_RAW 41
#define ZMQ_IPV6 42
#define ZMQ_MECHANISM 43
#define ZMQ_PLAIN_SERVER 44
#define ZMQ_PLAIN_USERNAME 45
#define ZMQ_PLAIN_PASSWORD 46
#define ZMQ_CURVE_SERVER 47
#define ZMQ_CURVE_PUBLICKEY 48
#define ZMQ_CURVE_SECRETKEY 49
#define ZMQ_CURVE_SERVERKEY 50
#define ZMQ_PROBE_ROUTER 51
#define ZMQ_REQ_CORRELATE 52
#define ZMQ_REQ_RELAXED 53
#define ZMQ_CONFLATE 54
#define ZMQ_ZAP_DOMAIN 55
#define ZMQ_ROUTER_HANDOVER 56
#define ZMQ_TOS 57
#define ZMQ_CONNECT_ROUTING_ID 61
#define ZMQ_GSSAPI_SERVER 62
#define ZMQ_GSSAPI_PRINCIPAL 63
#define ZMQ_GSSAPI_SERVICE_PRINCIPAL 64
#define ZMQ_GSSAPI_PLAINTEXT 65
#define ZMQ_HANDSHAKE_IVL 66
#define ZMQ_SOCKS_PROXY 68
#define ZMQ_XPUB_NODROP 69
#define ZMQ_BLOCKY 70
#define ZMQ_XPUB_MANUAL 71
#define ZMQ_XPUB_WELCOME_MSG 72
#define ZMQ_STREAM_NOTIFY 73
#define ZMQ_INVERT_MATCHING 74
#define ZMQ_HEARTBEAT_IVL 75
#define ZMQ_HEARTBEAT_TTL 76
#define ZMQ_HEARTBEAT_TIMEOUT 77
#define ZMQ_XPUB_VERBOSER 78
#define ZMQ_CONNECT_TIMEOUT 79
#define ZMQ_TCP_MAXRT 80
#define ZMQ_THREAD_SAFE 81
#define ZMQ_MULTICAST_MAXTPDU 84
#define ZMQ_VMCI_BUFFER_SIZE 85
#define ZMQ_VMCI_BUFFER_MIN_SIZE 86
#define ZMQ_VMCI_BUFFER_MAX_SIZE 87
#define ZMQ_VMCI_CONNECT_TIMEOUT 88
#define ZMQ_USE_FD 89
#define ZMQ_GSSAPI_PRINCIPAL_NAMETYPE 90
#define ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE 91
#define ZMQ_BINDTODEVICE 92
/* Message options */
#define ZMQ_MORE 1
#define ZMQ_SHARED 3
/* Send/recv options. */
#define ZMQ_DONTWAIT 1
#define ZMQ_SNDMORE 2
/* Security mechanisms */
#define ZMQ_NULL 0
#define ZMQ_PLAIN 1
#define ZMQ_CURVE 2
#define ZMQ_GSSAPI 3
/* RADIO-DISH protocol */
#define ZMQ_GROUP_MAX_LENGTH 255
/* Deprecated options and aliases */
#define ZMQ_IDENTITY ZMQ_ROUTING_ID
#define ZMQ_CONNECT_RID ZMQ_CONNECT_ROUTING_ID
#define ZMQ_TCP_ACCEPT_FILTER 38
#define ZMQ_IPC_FILTER_PID 58
#define ZMQ_IPC_FILTER_UID 59
#define ZMQ_IPC_FILTER_GID 60
#define ZMQ_IPV4ONLY 31
#define ZMQ_DELAY_ATTACH_ON_CONNECT ZMQ_IMMEDIATE
#define ZMQ_NOBLOCK ZMQ_DONTWAIT
#define ZMQ_FAIL_UNROUTABLE ZMQ_ROUTER_MANDATORY
#define ZMQ_ROUTER_BEHAVIOR ZMQ_ROUTER_MANDATORY
/* Deprecated Message options */
#define ZMQ_SRCFD 2
/******************************************************************************/
/* GSSAPI definitions */
/******************************************************************************/
/* GSSAPI principal name types */
#define ZMQ_GSSAPI_NT_HOSTBASED 0
#define ZMQ_GSSAPI_NT_USER_NAME 1
#define ZMQ_GSSAPI_NT_KRB5_PRINCIPAL 2
/******************************************************************************/
/* 0MQ socket events and monitoring */
/******************************************************************************/
/* Socket transport events (TCP, IPC and TIPC only) */
#define ZMQ_EVENT_CONNECTED 0x0001
#define ZMQ_EVENT_CONNECT_DELAYED 0x0002
#define ZMQ_EVENT_CONNECT_RETRIED 0x0004
#define ZMQ_EVENT_LISTENING 0x0008
#define ZMQ_EVENT_BIND_FAILED 0x0010
#define ZMQ_EVENT_ACCEPTED 0x0020
#define ZMQ_EVENT_ACCEPT_FAILED 0x0040
#define ZMQ_EVENT_CLOSED 0x0080
#define ZMQ_EVENT_CLOSE_FAILED 0x0100
#define ZMQ_EVENT_DISCONNECTED 0x0200
#define ZMQ_EVENT_MONITOR_STOPPED 0x0400
#define ZMQ_EVENT_ALL 0xFFFF
/* Unspecified system errors during handshake. Event value is an errno. */
#define ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL 0x0800
/* Handshake complete successfully with successful authentication (if *
* enabled). Event value is unused. */
#define ZMQ_EVENT_HANDSHAKE_SUCCEEDED 0x1000
/* Protocol errors between ZMTP peers or between server and ZAP handler. *
* Event value is one of ZMQ_PROTOCOL_ERROR_* */
#define ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL 0x2000
/* Failed authentication requests. Event value is the numeric ZAP status *
* code, i.e. 300, 400 or 500. */
#define ZMQ_EVENT_HANDSHAKE_FAILED_AUTH 0x4000
#define ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED 0x10000000
#define ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND 0x10000001
#define ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE 0x10000002
#define ZMQ_PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE 0x10000003
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED 0x10000011
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE 0x10000012
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO 0x10000013
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE 0x10000014
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR 0x10000015
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY 0x10000016
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME 0x10000017
#define ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA 0x10000018
// the following two may be due to erroneous configuration of a peer
#define ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC 0x11000001
#define ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH 0x11000002
#define ZMQ_PROTOCOL_ERROR_ZAP_UNSPECIFIED 0x20000000
#define ZMQ_PROTOCOL_ERROR_ZAP_MALFORMED_REPLY 0x20000001
#define ZMQ_PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID 0x20000002
#define ZMQ_PROTOCOL_ERROR_ZAP_BAD_VERSION 0x20000003
#define ZMQ_PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE 0x20000004
#define ZMQ_PROTOCOL_ERROR_ZAP_INVALID_METADATA 0x20000005
#define ZMQ_PROTOCOL_ERROR_WS_UNSPECIFIED 0x30000000
ZMQ_EXPORT void *zmq_socket (void *, int type_);
ZMQ_EXPORT int zmq_close (void *s_);
ZMQ_EXPORT int
zmq_setsockopt (void *s_, int option_, const void *optval_, size_t optvallen_);
ZMQ_EXPORT int
zmq_getsockopt (void *s_, int option_, void *optval_, size_t *optvallen_);
ZMQ_EXPORT int zmq_bind (void *s_, const char *addr_);
ZMQ_EXPORT int zmq_connect (void *s_, const char *addr_);
ZMQ_EXPORT int zmq_unbind (void *s_, const char *addr_);
ZMQ_EXPORT int zmq_disconnect (void *s_, const char *addr_);
ZMQ_EXPORT int zmq_send (void *s_, const void *buf_, size_t len_, int flags_);
ZMQ_EXPORT int
zmq_send_const (void *s_, const void *buf_, size_t len_, int flags_);
ZMQ_EXPORT int zmq_recv (void *s_, void *buf_, size_t len_, int flags_);
ZMQ_EXPORT int zmq_socket_monitor (void *s_, const char *addr_, int events_);
/******************************************************************************/
/* Hide socket fd type; this was before zmq_poller_event_t typedef below */
/******************************************************************************/
#if defined _WIN32
// Windows uses a pointer-sized unsigned integer to store the socket fd.
#if defined _WIN64
typedef unsigned __int64 zmq_fd_t;
#else
typedef unsigned int zmq_fd_t;
#endif
#else
typedef int zmq_fd_t;
#endif
/******************************************************************************/
/* Deprecated I/O multiplexing. Prefer using zmq_poller API */
/******************************************************************************/
#define ZMQ_POLLIN 1
#define ZMQ_POLLOUT 2
#define ZMQ_POLLERR 4
#define ZMQ_POLLPRI 8
typedef struct zmq_pollitem_t
{
void *socket;
zmq_fd_t fd;
short events;
short revents;
} zmq_pollitem_t;
#define ZMQ_POLLITEMS_DFLT 16
ZMQ_EXPORT int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_);
/******************************************************************************/
/* Message proxying */
/******************************************************************************/
ZMQ_EXPORT int zmq_proxy (void *frontend_, void *backend_, void *capture_);
ZMQ_EXPORT int zmq_proxy_steerable (void *frontend_,
void *backend_,
void *capture_,
void *control_);
/******************************************************************************/
/* Probe library capabilities */
/******************************************************************************/
#define ZMQ_HAS_CAPABILITIES 1
ZMQ_EXPORT int zmq_has (const char *capability_);
/* Deprecated aliases */
#define ZMQ_STREAMER 1
#define ZMQ_FORWARDER 2
#define ZMQ_QUEUE 3
/* Deprecated methods */
ZMQ_EXPORT int zmq_device (int type_, void *frontend_, void *backend_);
ZMQ_EXPORT int zmq_sendmsg (void *s_, zmq_msg_t *msg_, int flags_);
ZMQ_EXPORT int zmq_recvmsg (void *s_, zmq_msg_t *msg_, int flags_);
struct iovec;
ZMQ_EXPORT int
zmq_sendiov (void *s_, struct iovec *iov_, size_t count_, int flags_);
ZMQ_EXPORT int
zmq_recviov (void *s_, struct iovec *iov_, size_t *count_, int flags_);
/******************************************************************************/
/* Encryption functions */
/******************************************************************************/
/* Encode data with Z85 encoding. Returns encoded data */
ZMQ_EXPORT char *
zmq_z85_encode (char *dest_, const uint8_t *data_, size_t size_);
/* Decode data with Z85 encoding. Returns decoded data */
ZMQ_EXPORT uint8_t *zmq_z85_decode (uint8_t *dest_, const char *string_);
/* Generate z85-encoded public and private keypair with libsodium. */
/* Returns 0 on success. */
ZMQ_EXPORT int zmq_curve_keypair (char *z85_public_key_, char *z85_secret_key_);
/* Derive the z85-encoded public key from the z85-encoded secret key. */
/* Returns 0 on success. */
ZMQ_EXPORT int zmq_curve_public (char *z85_public_key_,
const char *z85_secret_key_);
/******************************************************************************/
/* Atomic utility methods */
/******************************************************************************/
ZMQ_EXPORT void *zmq_atomic_counter_new (void);
ZMQ_EXPORT void zmq_atomic_counter_set (void *counter_, int value_);
ZMQ_EXPORT int zmq_atomic_counter_inc (void *counter_);
ZMQ_EXPORT int zmq_atomic_counter_dec (void *counter_);
ZMQ_EXPORT int zmq_atomic_counter_value (void *counter_);
ZMQ_EXPORT void zmq_atomic_counter_destroy (void **counter_p_);
/******************************************************************************/
/* Scheduling timers */
/******************************************************************************/
#define ZMQ_HAVE_TIMERS
typedef void (zmq_timer_fn) (int timer_id, void *arg);
ZMQ_EXPORT void *zmq_timers_new (void);
ZMQ_EXPORT int zmq_timers_destroy (void **timers_p);
ZMQ_EXPORT int
zmq_timers_add (void *timers, size_t interval, zmq_timer_fn handler, void *arg);
ZMQ_EXPORT int zmq_timers_cancel (void *timers, int timer_id);
ZMQ_EXPORT int
zmq_timers_set_interval (void *timers, int timer_id, size_t interval);
ZMQ_EXPORT int zmq_timers_reset (void *timers, int timer_id);
ZMQ_EXPORT long zmq_timers_timeout (void *timers);
ZMQ_EXPORT int zmq_timers_execute (void *timers);
/******************************************************************************/
/* These functions are not documented by man pages -- use at your own risk. */
/* If you need these to be part of the formal ZMQ API, then (a) write a man */
/* page, and (b) write a test case in tests. */
/******************************************************************************/
/* Helper functions are used by perf tests so that they don't have to care */
/* about minutiae of time-related functions on different OS platforms. */
/* Starts the stopwatch. Returns the handle to the watch. */
ZMQ_EXPORT void *zmq_stopwatch_start (void);
/* Returns the number of microseconds elapsed since the stopwatch was */
/* started, but does not stop or deallocate the stopwatch. */
ZMQ_EXPORT unsigned long zmq_stopwatch_intermediate (void *watch_);
/* Stops the stopwatch. Returns the number of microseconds elapsed since */
/* the stopwatch was started, and deallocates that watch. */
ZMQ_EXPORT unsigned long zmq_stopwatch_stop (void *watch_);
/* Sleeps for specified number of seconds. */
ZMQ_EXPORT void zmq_sleep (int seconds_);
typedef void (zmq_thread_fn) (void *);
/* Start a thread. Returns a handle to the thread. */
ZMQ_EXPORT void *zmq_threadstart (zmq_thread_fn *func_, void *arg_);
/* Wait for thread to complete then free up resources. */
ZMQ_EXPORT void zmq_threadclose (void *thread_);
/******************************************************************************/
/* These functions are DRAFT and disabled in stable releases, and subject to */
/* change at ANY time until declared stable. */
/******************************************************************************/
#ifdef ZMQ_BUILD_DRAFT_API
/* DRAFT Socket types. */
#define ZMQ_SERVER 12
#define ZMQ_CLIENT 13
#define ZMQ_RADIO 14
#define ZMQ_DISH 15
#define ZMQ_GATHER 16
#define ZMQ_SCATTER 17
#define ZMQ_DGRAM 18
#define ZMQ_PEER 19
#define ZMQ_CHANNEL 20
/* DRAFT Socket options. */
#define ZMQ_ZAP_ENFORCE_DOMAIN 93
#define ZMQ_LOOPBACK_FASTPATH 94
#define ZMQ_METADATA 95
#define ZMQ_MULTICAST_LOOP 96
#define ZMQ_ROUTER_NOTIFY 97
#define ZMQ_XPUB_MANUAL_LAST_VALUE 98
#define ZMQ_SOCKS_USERNAME 99
#define ZMQ_SOCKS_PASSWORD 100
#define ZMQ_IN_BATCH_SIZE 101
#define ZMQ_OUT_BATCH_SIZE 102
#define ZMQ_WSS_KEY_PEM 103
#define ZMQ_WSS_CERT_PEM 104
#define ZMQ_WSS_TRUST_PEM 105
#define ZMQ_WSS_HOSTNAME 106
#define ZMQ_WSS_TRUST_SYSTEM 107
#define ZMQ_ONLY_FIRST_SUBSCRIBE 108
#define ZMQ_RECONNECT_STOP 109
#define ZMQ_HELLO_MSG 110
#define ZMQ_DISCONNECT_MSG 111
#define ZMQ_PRIORITY 112
#define ZMQ_BUSY_POLL 113
#define ZMQ_HICCUP_MSG 114
#define ZMQ_XSUB_VERBOSE_UNSUBSCRIBE 115
#define ZMQ_TOPICS_COUNT 116
#define ZMQ_NORM_MODE 117
#define ZMQ_NORM_UNICAST_NACK 118
#define ZMQ_NORM_BUFFER_SIZE 119
#define ZMQ_NORM_SEGMENT_SIZE 120
#define ZMQ_NORM_BLOCK_SIZE 121
#define ZMQ_NORM_NUM_PARITY 122
#define ZMQ_NORM_NUM_AUTOPARITY 123
#define ZMQ_NORM_PUSH 124
/* DRAFT ZMQ_NORM_MODE options */
#define ZMQ_NORM_FIXED 0
#define ZMQ_NORM_CC 1
#define ZMQ_NORM_CCL 2
#define ZMQ_NORM_CCE 3
#define ZMQ_NORM_CCE_ECNONLY 4
/* DRAFT ZMQ_RECONNECT_STOP options */
#define ZMQ_RECONNECT_STOP_CONN_REFUSED 0x1
#define ZMQ_RECONNECT_STOP_HANDSHAKE_FAILED 0x2
#define ZMQ_RECONNECT_STOP_AFTER_DISCONNECT 0x4
/* DRAFT Context options */
#define ZMQ_ZERO_COPY_RECV 10
/* DRAFT Context methods. */
ZMQ_EXPORT int zmq_ctx_set_ext (void *context_,
int option_,
const void *optval_,
size_t optvallen_);
ZMQ_EXPORT int zmq_ctx_get_ext (void *context_,
int option_,
void *optval_,
size_t *optvallen_);
/* DRAFT Socket methods. */
ZMQ_EXPORT int zmq_join (void *s, const char *group);
ZMQ_EXPORT int zmq_leave (void *s, const char *group);
ZMQ_EXPORT uint32_t zmq_connect_peer (void *s_, const char *addr_);
/* DRAFT Msg methods. */
ZMQ_EXPORT int zmq_msg_set_routing_id (zmq_msg_t *msg, uint32_t routing_id);
ZMQ_EXPORT uint32_t zmq_msg_routing_id (zmq_msg_t *msg);
ZMQ_EXPORT int zmq_msg_set_group (zmq_msg_t *msg, const char *group);
ZMQ_EXPORT const char *zmq_msg_group (zmq_msg_t *msg);
ZMQ_EXPORT int
zmq_msg_init_buffer (zmq_msg_t *msg_, const void *buf_, size_t size_);
/* DRAFT Msg property names. */
#define ZMQ_MSG_PROPERTY_ROUTING_ID "Routing-Id"
#define ZMQ_MSG_PROPERTY_SOCKET_TYPE "Socket-Type"
#define ZMQ_MSG_PROPERTY_USER_ID "User-Id"
#define ZMQ_MSG_PROPERTY_PEER_ADDRESS "Peer-Address"
/* Router notify options */
#define ZMQ_NOTIFY_CONNECT 1
#define ZMQ_NOTIFY_DISCONNECT 2
/******************************************************************************/
/* Poller polling on sockets,fd and thread-safe sockets */
/******************************************************************************/
#define ZMQ_HAVE_POLLER
typedef struct zmq_poller_event_t
{
void *socket;
zmq_fd_t fd;
void *user_data;
short events;
} zmq_poller_event_t;
ZMQ_EXPORT void *zmq_poller_new (void);
ZMQ_EXPORT int zmq_poller_destroy (void **poller_p);
ZMQ_EXPORT int zmq_poller_size (void *poller);
ZMQ_EXPORT int
zmq_poller_add (void *poller, void *socket, void *user_data, short events);
ZMQ_EXPORT int zmq_poller_modify (void *poller, void *socket, short events);
ZMQ_EXPORT int zmq_poller_remove (void *poller, void *socket);
ZMQ_EXPORT int
zmq_poller_wait (void *poller, zmq_poller_event_t *event, long timeout);
ZMQ_EXPORT int zmq_poller_wait_all (void *poller,
zmq_poller_event_t *events,
int n_events,
long timeout);
ZMQ_EXPORT int zmq_poller_fd (void *poller, zmq_fd_t *fd);
ZMQ_EXPORT int
zmq_poller_add_fd (void *poller, zmq_fd_t fd, void *user_data, short events);
ZMQ_EXPORT int zmq_poller_modify_fd (void *poller, zmq_fd_t fd, short events);
ZMQ_EXPORT int zmq_poller_remove_fd (void *poller, zmq_fd_t fd);
ZMQ_EXPORT int zmq_socket_get_peer_state (void *socket,
const void *routing_id,
size_t routing_id_size);
/* DRAFT Socket monitoring events */
#define ZMQ_EVENT_PIPES_STATS 0x10000
#define ZMQ_CURRENT_EVENT_VERSION 1
#define ZMQ_CURRENT_EVENT_VERSION_DRAFT 2
#define ZMQ_EVENT_ALL_V1 ZMQ_EVENT_ALL
#define ZMQ_EVENT_ALL_V2 ZMQ_EVENT_ALL_V1 | ZMQ_EVENT_PIPES_STATS
ZMQ_EXPORT int zmq_socket_monitor_versioned (
void *s_, const char *addr_, uint64_t events_, int event_version_, int type_);
ZMQ_EXPORT int zmq_socket_monitor_pipes_stats (void *s);
#if !defined _WIN32
ZMQ_EXPORT int zmq_ppoll (zmq_pollitem_t *items_,
int nitems_,
long timeout_,
const sigset_t *sigmask_);
#else
// Windows has no sigset_t
ZMQ_EXPORT int zmq_ppoll (zmq_pollitem_t *items_,
int nitems_,
long timeout_,
const void *sigmask_);
#endif
#endif // ZMQ_BUILD_DRAFT_API
#undef ZMQ_EXPORT
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,23 @@
/* SPDX-License-Identifier: MPL-2.0 */
/* This file is deprecated, and all its functionality provided by zmq.h */
/* Note that -Wpedantic compilation requires GCC to avoid using its custom
extensions such as #warning, hence the trick below. Also, pragmas for
warnings or other messages are not standard, not portable, and not all
compilers even have an equivalent concept.
So in the worst case, this include file is treated as silently empty. */
#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) \
|| defined(_MSC_VER)
#if defined(__GNUC__) || defined(__GNUG__)
#pragma GCC diagnostic push
#pragma GCC diagnostic warning "-Wcpp"
#pragma GCC diagnostic ignored "-Werror"
#pragma GCC diagnostic ignored "-Wall"
#endif
#pragma message( \
"Warning: zmq_utils.h is deprecated. All its functionality is provided by zmq.h.")
#if defined(__GNUC__) || defined(__GNUG__)
#pragma GCC diagnostic pop
#endif
#endif

BIN
utils/ZMQLayout/lib/libVSClock.so Executable file

Binary file not shown.

View File

@ -0,0 +1,162 @@
#include "ZMQLayout.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <VSClock.h>
#include <unistd.h>
static void *ZMQCTX = NULL;
static int ZMQSocketNum = 0;
void ZMQBufDestroy(pZMQBuf_s psZMQBuf)
{
if(!psZMQBuf) return ;
if(psZMQBuf->pcBuf) free(psZMQBuf->pcBuf);
free(psZMQBuf);
return ;
}
pZMQBuf_s ZMQRecv(void *phZMQSocket, int iWaitTime)
{
int rv = 0;
pZMQBuf_s psZMQBuf = NULL;
zmq_msg_t tZMQMSG;
rv = zmq_msg_init(&tZMQMSG);
if(rv) { return NULL; }
do
{
if(iWaitTime == -1)
{
rv = zmq_msg_recv(&tZMQMSG, phZMQSocket, 0);
}
else
{
VSClock_s sVSClock = { 0 };
VSClock(&sVSClock, iWaitTime, 0);
while(!VSClockTimeOut(&sVSClock))
{
rv = zmq_msg_recv(&tZMQMSG, phZMQSocket, ZMQ_DONTWAIT);
if(rv < 0) { /* printf("ERROR\n"); */ sleep(0); continue; }
break;
}
}
if(rv < 0) break;
psZMQBuf = calloc(1, sizeof(ZMQBuf_s));
psZMQBuf->iBufLen = zmq_msg_size(&tZMQMSG);
psZMQBuf->pcBuf = calloc(psZMQBuf->iBufLen + 1, sizeof(char));
memcpy(psZMQBuf->pcBuf, zmq_msg_data(&tZMQMSG), psZMQBuf->iBufLen);
}while(0);
zmq_msg_close(&tZMQMSG);
return psZMQBuf;
}
int ZMQSend(void *phZMQSocket, const char *pcBuf, const int iBufLen)
{
int rv = 0;
zmq_msg_t tZMQMSG;
rv = zmq_msg_init_size(&tZMQMSG, iBufLen);
if(rv) { return -1; }
do
{
memcpy(zmq_msg_data(&tZMQMSG), pcBuf, iBufLen);
// rv = zmq_sendmsg(phZMQSocket, &tZMQMSG, 0);
rv = zmq_msg_send(&tZMQMSG, phZMQSocket, ZMQ_DONTWAIT);
if(rv < 0) { /* printf("zmq_sendmsg errno = %d\n", errno); */ rv = -1; break; }
rv = 0;
}while(0);
zmq_msg_close(&tZMQMSG);
return rv;
}
pZMQ_s ZMQServerInit(const char *pcAddress)
{
int rv = 0;
if(!ZMQCTX) ZMQCTX = zmq_ctx_new();
if(!ZMQCTX) return NULL;
pZMQ_s psZMQSocket = NULL;
do
{
void *phZMQSocket = zmq_socket(ZMQCTX, ZMQ_REP);
if(!phZMQSocket) { /* printf("zmq_socket fail\n"); */ break; }
rv = zmq_bind(phZMQSocket, pcAddress);
if(rv != 0)
{
zmq_close(phZMQSocket);
/* printf("zmq_bind rv = %d errno = %d fail\n", rv, errno); */
break;
}
psZMQSocket = phZMQSocket;
ZMQSocketNum++;
}while(0);
return psZMQSocket;
}
pZMQ_s ZMQClientInit(const char *pcAddress)
{
int rv = 0;
if(!ZMQCTX) ZMQCTX = zmq_ctx_new();
if(!ZMQCTX) return NULL;
pZMQ_s psZMQSocket = NULL;
do
{
void *phZMQSocket = zmq_socket(ZMQCTX, ZMQ_REQ);
if(!phZMQSocket) { /* printf("zmq_socket fail\n"); */ break; }
rv = zmq_connect(phZMQSocket, pcAddress);
if(rv != 0)
{
zmq_close(phZMQSocket);
// printf("zmq_bind rv = %d errno = %d fail\n", rv, errno);
break;
}
psZMQSocket = phZMQSocket;
ZMQSocketNum++;
}while(0);
return psZMQSocket;
}
void ZMQDestroy(pZMQ_s psZMQ)
{
if(!psZMQ) return ;
zmq_close(psZMQ);
ZMQSocketNum--;
if(ZMQSocketNum <= 0) {
zmq_ctx_destroy(ZMQCTX);
ZMQSocketNum = 0;
ZMQCTX = NULL;
}
return ;
}

View File

@ -0,0 +1,24 @@
#include <stdio.h>
#include <stdlib.h>
#include "ZMQLayout.h"
int main()
{
int rv = 0;
pZMQ_s psZMQ = ZMQClientInit("tcp://localhost:60006");
if(!psZMQ) { printf("ZMQServerInit Fail\n"); return -1; }
while (1)
{
rv = ZMQSend(psZMQ, "Client request", 13);
if(rv) { printf("ZMQSend Fail\n"); break; }
pZMQBuf_s psZMQBuf = ZMQRecv(psZMQ, 1);
if(!psZMQBuf) { printf("ZMQRecv Fail\n"); break; }
printf("Read = %s\n", psZMQBuf->pcBuf);
}
return rv;
}

View File

@ -0,0 +1,26 @@
#include <stdio.h>
#include <stdlib.h>
#include "ZMQLayout.h"
int main()
{
int rv = 0;
pZMQ_s psZMQ = ZMQServerInit("tcp://localhost:60006");
if(!psZMQ) { printf("ZMQServerInit Fail\n"); return -1; }
while (1)
{
sleep(0);
pZMQBuf_s psZMQBuf = ZMQRecv(psZMQ, -1);
if(!psZMQBuf) { printf("ZMQRecv Fail\n"); break; }
printf("Read = %s\n", psZMQBuf->pcBuf);
rv = ZMQSend(psZMQ, "Server reply", 13);
if(rv) { printf("ZMQSend Fail\n"); break; }
}
return rv;
}