install pEp/status_to_string.h sync
authorVolker Birk <vb@pep-project.org>
Sat, 04 May 2019 02:14:34 +0200
branchsync
changeset 36241bf48c2e4230
parent 3623 8520605700b7
child 3625 162afea48c56
install pEp/status_to_string.h
src/Makefile
src/pEp_status_to_string.h
src/pgp_sequoia.c
src/status_to_string.h
     1.1 --- a/src/Makefile	Sat May 04 01:54:28 2019 +0200
     1.2 +++ b/src/Makefile	Sat May 04 02:14:34 2019 +0200
     1.3 @@ -102,7 +102,7 @@
     1.4  	cp pEpEngine.h keymanagement.h message_api.h dynamic_api.h stringlist.h \
     1.5  	   timestamp.h identity_list.h bloblist.h stringpair.h message.h mime.h \
     1.6  	   cryptotech.h sync_api.h blacklist.h pEp_string.h openpgp_compat.h \
     1.7 -	   labeled_int_list.h key_reset.h base64.h sync_codec.h \
     1.8 +	   labeled_int_list.h key_reset.h base64.h sync_codec.h status_to_string.h\
     1.9  	   ../asn.1/*.h $(PREFIX)/include/pEp/
    1.10  
    1.11  install: $(TARGET) install_headers
     2.1 --- a/src/pEp_status_to_string.h	Sat May 04 01:54:28 2019 +0200
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,109 +0,0 @@
     2.4 -#pragma once
     2.5 -
     2.6 -#ifdef __cplusplus
     2.7 -"C" {
     2.8 -#endif
     2.9 -
    2.10 -inline const char *pEp_status_to_string(PEP_STATUS status) {
    2.11 -    switch (status) {
    2.12 -    case PEP_STATUS_OK: return "PEP_STATUS_OK";
    2.13 -
    2.14 -    case PEP_INIT_CANNOT_LOAD_GPGME: return "PEP_INIT_CANNOT_LOAD_GPGME";
    2.15 -    case PEP_INIT_GPGME_INIT_FAILED: return "PEP_INIT_GPGME_INIT_FAILED";
    2.16 -    case PEP_INIT_NO_GPG_HOME: return "PEP_INIT_NO_GPG_HOME";
    2.17 -    case PEP_INIT_NETPGP_INIT_FAILED: return "PEP_INIT_NETPGP_INIT_FAILED";
    2.18 -    case PEP_INIT_CANNOT_DETERMINE_GPG_VERSION: return "PEP_INIT_CANNOT_DETERMINE_GPG_VERSION";
    2.19 -    case PEP_INIT_UNSUPPORTED_GPG_VERSION: return "PEP_INIT_UNSUPPORTED_GPG_VERSION";
    2.20 -    case PEP_INIT_CANNOT_CONFIG_GPG_AGENT: return "PEP_INIT_CANNOT_CONFIG_GPG_AGENT";
    2.21 -    case PEP_INIT_SQLITE3_WITHOUT_MUTEX: return "PEP_INIT_SQLITE3_WITHOUT_MUTEX";
    2.22 -    case PEP_INIT_CANNOT_OPEN_DB: return "PEP_INIT_CANNOT_OPEN_DB";
    2.23 -    case PEP_INIT_CANNOT_OPEN_SYSTEM_DB: return "PEP_INIT_CANNOT_OPEN_SYSTEM_DB";
    2.24 -    case PEP_UNKNOWN_DB_ERROR: return "PEP_UNKNOWN_DB_ERROR";
    2.25 -    case PEP_KEY_NOT_FOUND: return "PEP_KEY_NOT_FOUND";
    2.26 -    case PEP_KEY_HAS_AMBIG_NAME: return "PEP_KEY_HAS_AMBIG_NAME";
    2.27 -    case PEP_GET_KEY_FAILED: return "PEP_GET_KEY_FAILED";
    2.28 -    case PEP_CANNOT_EXPORT_KEY: return "PEP_CANNOT_EXPORT_KEY";
    2.29 -    case PEP_CANNOT_EDIT_KEY: return "PEP_CANNOT_EDIT_KEY";
    2.30 -    case PEP_KEY_UNSUITABLE: return "PEP_KEY_UNSUITABLE";
    2.31 -    case PEP_MALFORMED_KEY_RESET_MSG: return "PEP_MALFORMED_KEY_RESET_MSG";
    2.32 -    case PEP_KEY_NOT_RESET: return "PEP_KEY_NOT_RESET";
    2.33 -
    2.34 -    case PEP_KEY_IMPORTED: return "PEP_KEY_IMPORTED";
    2.35 -    case PEP_NO_KEY_IMPORTED: return "PEP_NO_KEY_IMPORTED";
    2.36 -    case PEP_KEY_IMPORT_STATUS_UNKNOWN: return "PEP_KEY_IMPORT_STATUS_UNKNOWN";
    2.37 -    
    2.38 -    case PEP_CANNOT_FIND_IDENTITY: return "PEP_CANNOT_FIND_IDENTITY";
    2.39 -    case PEP_CANNOT_SET_PERSON: return "PEP_CANNOT_SET_PERSON";
    2.40 -    case PEP_CANNOT_SET_PGP_KEYPAIR: return "PEP_CANNOT_SET_PGP_KEYPAIR";
    2.41 -    case PEP_CANNOT_SET_IDENTITY: return "PEP_CANNOT_SET_IDENTITY";
    2.42 -    case PEP_CANNOT_SET_TRUST: return "PEP_CANNOT_SET_TRUST";
    2.43 -    case PEP_KEY_BLACKLISTED: return "PEP_KEY_BLACKLISTED";
    2.44 -    case PEP_CANNOT_FIND_PERSON: return "PEP_CANNOT_FIND_PERSON";
    2.45 -
    2.46 -    case PEP_CANNOT_FIND_ALIAS: return "PEP_CANNOT_FIND_ALIAS";
    2.47 -    case PEP_CANNOT_SET_ALIAS: return "PEP_CANNOT_SET_ALIAS";
    2.48 -
    2.49 -    case PEP_UNENCRYPTED: return "PEP_UNENCRYPTED";
    2.50 -    case PEP_VERIFIED: return "PEP_VERIFIED";
    2.51 -    case PEP_DECRYPTED: return "PEP_DECRYPTED";
    2.52 -    case PEP_DECRYPTED_AND_VERIFIED: return "PEP_DECRYPTED_AND_VERIFIED";
    2.53 -    case PEP_DECRYPT_WRONG_FORMAT: return "PEP_DECRYPT_WRONG_FORMAT";
    2.54 -    case PEP_DECRYPT_NO_KEY: return "PEP_DECRYPT_NO_KEY";
    2.55 -    case PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH: return "PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH";
    2.56 -    case PEP_VERIFY_NO_KEY: return "PEP_VERIFY_NO_KEY";
    2.57 -    case PEP_VERIFIED_AND_TRUSTED: return "PEP_VERIFIED_AND_TRUSTED";
    2.58 -    case PEP_CANNOT_REENCRYPT: return "PEP_CANNOT_REENCRYPT";
    2.59 -    case PEP_CANNOT_DECRYPT_UNKNOWN: return "PEP_CANNOT_DECRYPT_UNKNOWN";
    2.60 -
    2.61 -    case PEP_TRUSTWORD_NOT_FOUND: return "PEP_TRUSTWORD_NOT_FOUND";
    2.62 -    case PEP_TRUSTWORDS_FPR_WRONG_LENGTH: return "PEP_TRUSTWORDS_FPR_WRONG_LENGTH";
    2.63 -    case PEP_TRUSTWORDS_DUPLICATE_FPR: return "PEP_TRUSTWORDS_DUPLICATE_FPR";
    2.64 -
    2.65 -    case PEP_CANNOT_CREATE_KEY: return "PEP_CANNOT_CREATE_KEY";
    2.66 -    case PEP_CANNOT_SEND_KEY: return "PEP_CANNOT_SEND_KEY";
    2.67 -
    2.68 -    case PEP_PHRASE_NOT_FOUND: return "PEP_PHRASE_NOT_FOUND";
    2.69 -
    2.70 -    case PEP_SEND_FUNCTION_NOT_REGISTERED: return "PEP_SEND_FUNCTION_NOT_REGISTERED";
    2.71 -    case PEP_CONTRAINTS_VIOLATED: return "PEP_CONTRAINTS_VIOLATED";
    2.72 -    case PEP_CANNOT_ENCODE: return "PEP_CANNOT_ENCODE";
    2.73 -
    2.74 -    case PEP_SYNC_NO_NOTIFY_CALLBACK: return "PEP_SYNC_NO_NOTIFY_CALLBACK";
    2.75 -    case PEP_SYNC_ILLEGAL_MESSAGE: return "PEP_SYNC_ILLEGAL_MESSAGE";
    2.76 -    case PEP_SYNC_NO_INJECT_CALLBACK: return "PEP_SYNC_NO_INJECT_CALLBACK";
    2.77 -    case PEP_SYNC_NO_CHANNEL: return "PEP_SYNC_NO_CHANNEL";
    2.78 -    case PEP_SYNC_CANNOT_ENCRYPT: return "PEP_SYNC_CANNOT_ENCRYPT";
    2.79 -    case PEP_SYNC_NO_MESSAGE_SEND_CALLBACK: return "PEP_SYNC_NO_MESSAGE_SEND_CALLBACK";
    2.80 -
    2.81 -    case PEP_CANNOT_INCREASE_SEQUENCE: return "PEP_CANNOT_INCREASE_SEQUENCE";
    2.82 -
    2.83 -    case PEP_STATEMACHINE_ERROR: return "PEP_STATEMACHINE_ERROR";
    2.84 -    case PEP_NO_TRUST: return "PEP_NO_TRUST";
    2.85 -    case PEP_STATEMACHINE_INVALID_STATE: return "PEP_STATEMACHINE_INVALID_STATE";
    2.86 -    case PEP_STATEMACHINE_INVALID_EVENT: return "PEP_STATEMACHINE_INVALID_EVENT";
    2.87 -    case PEP_STATEMACHINE_INVALID_CONDITION: return "PEP_STATEMACHINE_INVALID_CONDITION";
    2.88 -    case PEP_STATEMACHINE_INVALID_ACTION: return "PEP_STATEMACHINE_INVALID_ACTION";
    2.89 -    case PEP_STATEMACHINE_INHIBITED_EVENT: return "PEP_STATEMACHINE_INHIBITED_EVENT";
    2.90 -    case PEP_STATEMACHINE_CANNOT_SEND: return "PEP_STATEMACHINE_CANNOT_SEND";
    2.91 -
    2.92 -    case PEP_COMMIT_FAILED: return "PEP_COMMIT_FAILED";
    2.93 -    case PEP_MESSAGE_CONSUME: return "PEP_MESSAGE_CONSUME";
    2.94 -    case PEP_MESSAGE_IGNORE: return "PEP_MESSAGE_IGNORE";
    2.95 -
    2.96 -    case PEP_RECORD_NOT_FOUND: return "PEP_RECORD_NOT_FOUND";
    2.97 -    case PEP_CANNOT_CREATE_TEMP_FILE: return "PEP_CANNOT_CREATE_TEMP_FILE";
    2.98 -    case PEP_ILLEGAL_VALUE: return "PEP_ILLEGAL_VALUE";
    2.99 -    case PEP_BUFFER_TOO_SMALL: return "PEP_BUFFER_TOO_SMALL";
   2.100 -    case PEP_OUT_OF_MEMORY: return "PEP_OUT_OF_MEMORY";
   2.101 -    case PEP_UNKNOWN_ERROR: return "PEP_UNKNOWN_ERROR";
   2.102 -
   2.103 -    case PEP_VERSION_MISMATCH: return "PEP_VERSION_MISMATCH";
   2.104 -
   2.105 -    default: return "unknown status code";
   2.106 -    }
   2.107 -}
   2.108 -
   2.109 -#ifdef __cplusplus
   2.110 -} // "C"
   2.111 -#endif
   2.112 -
     3.1 --- a/src/pgp_sequoia.c	Sat May 04 01:54:28 2019 +0200
     3.2 +++ b/src/pgp_sequoia.c	Sat May 04 02:14:34 2019 +0200
     3.3 @@ -26,7 +26,7 @@
     3.4  
     3.5  // enable tracing if in debugging mode
     3.6  #if TRACING
     3.7 -#include "pEp_status_to_string.h"
     3.8 +#include "status_to_string.h"
     3.9  #  define _T(...) do {                          \
    3.10          fprintf(stderr, ##__VA_ARGS__);         \
    3.11      } while (0)
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/src/status_to_string.h	Sat May 04 02:14:34 2019 +0200
     4.3 @@ -0,0 +1,109 @@
     4.4 +#pragma once
     4.5 +
     4.6 +#ifdef __cplusplus
     4.7 +extern "C" {
     4.8 +#endif
     4.9 +
    4.10 +inline const char *pEp_status_to_string(PEP_STATUS status) {
    4.11 +    switch (status) {
    4.12 +    case PEP_STATUS_OK: return "PEP_STATUS_OK";
    4.13 +
    4.14 +    case PEP_INIT_CANNOT_LOAD_GPGME: return "PEP_INIT_CANNOT_LOAD_GPGME";
    4.15 +    case PEP_INIT_GPGME_INIT_FAILED: return "PEP_INIT_GPGME_INIT_FAILED";
    4.16 +    case PEP_INIT_NO_GPG_HOME: return "PEP_INIT_NO_GPG_HOME";
    4.17 +    case PEP_INIT_NETPGP_INIT_FAILED: return "PEP_INIT_NETPGP_INIT_FAILED";
    4.18 +    case PEP_INIT_CANNOT_DETERMINE_GPG_VERSION: return "PEP_INIT_CANNOT_DETERMINE_GPG_VERSION";
    4.19 +    case PEP_INIT_UNSUPPORTED_GPG_VERSION: return "PEP_INIT_UNSUPPORTED_GPG_VERSION";
    4.20 +    case PEP_INIT_CANNOT_CONFIG_GPG_AGENT: return "PEP_INIT_CANNOT_CONFIG_GPG_AGENT";
    4.21 +    case PEP_INIT_SQLITE3_WITHOUT_MUTEX: return "PEP_INIT_SQLITE3_WITHOUT_MUTEX";
    4.22 +    case PEP_INIT_CANNOT_OPEN_DB: return "PEP_INIT_CANNOT_OPEN_DB";
    4.23 +    case PEP_INIT_CANNOT_OPEN_SYSTEM_DB: return "PEP_INIT_CANNOT_OPEN_SYSTEM_DB";
    4.24 +    case PEP_UNKNOWN_DB_ERROR: return "PEP_UNKNOWN_DB_ERROR";
    4.25 +    case PEP_KEY_NOT_FOUND: return "PEP_KEY_NOT_FOUND";
    4.26 +    case PEP_KEY_HAS_AMBIG_NAME: return "PEP_KEY_HAS_AMBIG_NAME";
    4.27 +    case PEP_GET_KEY_FAILED: return "PEP_GET_KEY_FAILED";
    4.28 +    case PEP_CANNOT_EXPORT_KEY: return "PEP_CANNOT_EXPORT_KEY";
    4.29 +    case PEP_CANNOT_EDIT_KEY: return "PEP_CANNOT_EDIT_KEY";
    4.30 +    case PEP_KEY_UNSUITABLE: return "PEP_KEY_UNSUITABLE";
    4.31 +    case PEP_MALFORMED_KEY_RESET_MSG: return "PEP_MALFORMED_KEY_RESET_MSG";
    4.32 +    case PEP_KEY_NOT_RESET: return "PEP_KEY_NOT_RESET";
    4.33 +
    4.34 +    case PEP_KEY_IMPORTED: return "PEP_KEY_IMPORTED";
    4.35 +    case PEP_NO_KEY_IMPORTED: return "PEP_NO_KEY_IMPORTED";
    4.36 +    case PEP_KEY_IMPORT_STATUS_UNKNOWN: return "PEP_KEY_IMPORT_STATUS_UNKNOWN";
    4.37 +    
    4.38 +    case PEP_CANNOT_FIND_IDENTITY: return "PEP_CANNOT_FIND_IDENTITY";
    4.39 +    case PEP_CANNOT_SET_PERSON: return "PEP_CANNOT_SET_PERSON";
    4.40 +    case PEP_CANNOT_SET_PGP_KEYPAIR: return "PEP_CANNOT_SET_PGP_KEYPAIR";
    4.41 +    case PEP_CANNOT_SET_IDENTITY: return "PEP_CANNOT_SET_IDENTITY";
    4.42 +    case PEP_CANNOT_SET_TRUST: return "PEP_CANNOT_SET_TRUST";
    4.43 +    case PEP_KEY_BLACKLISTED: return "PEP_KEY_BLACKLISTED";
    4.44 +    case PEP_CANNOT_FIND_PERSON: return "PEP_CANNOT_FIND_PERSON";
    4.45 +
    4.46 +    case PEP_CANNOT_FIND_ALIAS: return "PEP_CANNOT_FIND_ALIAS";
    4.47 +    case PEP_CANNOT_SET_ALIAS: return "PEP_CANNOT_SET_ALIAS";
    4.48 +
    4.49 +    case PEP_UNENCRYPTED: return "PEP_UNENCRYPTED";
    4.50 +    case PEP_VERIFIED: return "PEP_VERIFIED";
    4.51 +    case PEP_DECRYPTED: return "PEP_DECRYPTED";
    4.52 +    case PEP_DECRYPTED_AND_VERIFIED: return "PEP_DECRYPTED_AND_VERIFIED";
    4.53 +    case PEP_DECRYPT_WRONG_FORMAT: return "PEP_DECRYPT_WRONG_FORMAT";
    4.54 +    case PEP_DECRYPT_NO_KEY: return "PEP_DECRYPT_NO_KEY";
    4.55 +    case PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH: return "PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH";
    4.56 +    case PEP_VERIFY_NO_KEY: return "PEP_VERIFY_NO_KEY";
    4.57 +    case PEP_VERIFIED_AND_TRUSTED: return "PEP_VERIFIED_AND_TRUSTED";
    4.58 +    case PEP_CANNOT_REENCRYPT: return "PEP_CANNOT_REENCRYPT";
    4.59 +    case PEP_CANNOT_DECRYPT_UNKNOWN: return "PEP_CANNOT_DECRYPT_UNKNOWN";
    4.60 +
    4.61 +    case PEP_TRUSTWORD_NOT_FOUND: return "PEP_TRUSTWORD_NOT_FOUND";
    4.62 +    case PEP_TRUSTWORDS_FPR_WRONG_LENGTH: return "PEP_TRUSTWORDS_FPR_WRONG_LENGTH";
    4.63 +    case PEP_TRUSTWORDS_DUPLICATE_FPR: return "PEP_TRUSTWORDS_DUPLICATE_FPR";
    4.64 +
    4.65 +    case PEP_CANNOT_CREATE_KEY: return "PEP_CANNOT_CREATE_KEY";
    4.66 +    case PEP_CANNOT_SEND_KEY: return "PEP_CANNOT_SEND_KEY";
    4.67 +
    4.68 +    case PEP_PHRASE_NOT_FOUND: return "PEP_PHRASE_NOT_FOUND";
    4.69 +
    4.70 +    case PEP_SEND_FUNCTION_NOT_REGISTERED: return "PEP_SEND_FUNCTION_NOT_REGISTERED";
    4.71 +    case PEP_CONTRAINTS_VIOLATED: return "PEP_CONTRAINTS_VIOLATED";
    4.72 +    case PEP_CANNOT_ENCODE: return "PEP_CANNOT_ENCODE";
    4.73 +
    4.74 +    case PEP_SYNC_NO_NOTIFY_CALLBACK: return "PEP_SYNC_NO_NOTIFY_CALLBACK";
    4.75 +    case PEP_SYNC_ILLEGAL_MESSAGE: return "PEP_SYNC_ILLEGAL_MESSAGE";
    4.76 +    case PEP_SYNC_NO_INJECT_CALLBACK: return "PEP_SYNC_NO_INJECT_CALLBACK";
    4.77 +    case PEP_SYNC_NO_CHANNEL: return "PEP_SYNC_NO_CHANNEL";
    4.78 +    case PEP_SYNC_CANNOT_ENCRYPT: return "PEP_SYNC_CANNOT_ENCRYPT";
    4.79 +    case PEP_SYNC_NO_MESSAGE_SEND_CALLBACK: return "PEP_SYNC_NO_MESSAGE_SEND_CALLBACK";
    4.80 +
    4.81 +    case PEP_CANNOT_INCREASE_SEQUENCE: return "PEP_CANNOT_INCREASE_SEQUENCE";
    4.82 +
    4.83 +    case PEP_STATEMACHINE_ERROR: return "PEP_STATEMACHINE_ERROR";
    4.84 +    case PEP_NO_TRUST: return "PEP_NO_TRUST";
    4.85 +    case PEP_STATEMACHINE_INVALID_STATE: return "PEP_STATEMACHINE_INVALID_STATE";
    4.86 +    case PEP_STATEMACHINE_INVALID_EVENT: return "PEP_STATEMACHINE_INVALID_EVENT";
    4.87 +    case PEP_STATEMACHINE_INVALID_CONDITION: return "PEP_STATEMACHINE_INVALID_CONDITION";
    4.88 +    case PEP_STATEMACHINE_INVALID_ACTION: return "PEP_STATEMACHINE_INVALID_ACTION";
    4.89 +    case PEP_STATEMACHINE_INHIBITED_EVENT: return "PEP_STATEMACHINE_INHIBITED_EVENT";
    4.90 +    case PEP_STATEMACHINE_CANNOT_SEND: return "PEP_STATEMACHINE_CANNOT_SEND";
    4.91 +
    4.92 +    case PEP_COMMIT_FAILED: return "PEP_COMMIT_FAILED";
    4.93 +    case PEP_MESSAGE_CONSUME: return "PEP_MESSAGE_CONSUME";
    4.94 +    case PEP_MESSAGE_IGNORE: return "PEP_MESSAGE_IGNORE";
    4.95 +
    4.96 +    case PEP_RECORD_NOT_FOUND: return "PEP_RECORD_NOT_FOUND";
    4.97 +    case PEP_CANNOT_CREATE_TEMP_FILE: return "PEP_CANNOT_CREATE_TEMP_FILE";
    4.98 +    case PEP_ILLEGAL_VALUE: return "PEP_ILLEGAL_VALUE";
    4.99 +    case PEP_BUFFER_TOO_SMALL: return "PEP_BUFFER_TOO_SMALL";
   4.100 +    case PEP_OUT_OF_MEMORY: return "PEP_OUT_OF_MEMORY";
   4.101 +    case PEP_UNKNOWN_ERROR: return "PEP_UNKNOWN_ERROR";
   4.102 +
   4.103 +    case PEP_VERSION_MISMATCH: return "PEP_VERSION_MISMATCH";
   4.104 +
   4.105 +    default: return "unknown status code";
   4.106 +    }
   4.107 +}
   4.108 +
   4.109 +#ifdef __cplusplus
   4.110 +} // "C"
   4.111 +#endif
   4.112 +