src/status_to_string.h
author Volker Birk <vb@pep-project.org>
Fri, 17 May 2019 17:59:06 +0200
branchsync
changeset 3720 9ed76a79d784
parent 3642 e0f68de8e543
child 3747 82fe58af7b53
permissions -rw-r--r--
...
     1 #pragma once
     2 
     3 #ifdef __cplusplus
     4 extern "C" {
     5 #endif
     6 
     7 static inline const char *pEp_status_to_string(PEP_STATUS status) {
     8     switch (status) {
     9     case PEP_STATUS_OK: return "PEP_STATUS_OK";
    10 
    11     case PEP_INIT_CANNOT_LOAD_GPGME: return "PEP_INIT_CANNOT_LOAD_GPGME";
    12     case PEP_INIT_GPGME_INIT_FAILED: return "PEP_INIT_GPGME_INIT_FAILED";
    13     case PEP_INIT_NO_GPG_HOME: return "PEP_INIT_NO_GPG_HOME";
    14     case PEP_INIT_NETPGP_INIT_FAILED: return "PEP_INIT_NETPGP_INIT_FAILED";
    15     case PEP_INIT_CANNOT_DETERMINE_GPG_VERSION: return "PEP_INIT_CANNOT_DETERMINE_GPG_VERSION";
    16     case PEP_INIT_UNSUPPORTED_GPG_VERSION: return "PEP_INIT_UNSUPPORTED_GPG_VERSION";
    17     case PEP_INIT_CANNOT_CONFIG_GPG_AGENT: return "PEP_INIT_CANNOT_CONFIG_GPG_AGENT";
    18     case PEP_INIT_SQLITE3_WITHOUT_MUTEX: return "PEP_INIT_SQLITE3_WITHOUT_MUTEX";
    19     case PEP_INIT_CANNOT_OPEN_DB: return "PEP_INIT_CANNOT_OPEN_DB";
    20     case PEP_INIT_CANNOT_OPEN_SYSTEM_DB: return "PEP_INIT_CANNOT_OPEN_SYSTEM_DB";
    21     case PEP_UNKNOWN_DB_ERROR: return "PEP_UNKNOWN_DB_ERROR";
    22     case PEP_KEY_NOT_FOUND: return "PEP_KEY_NOT_FOUND";
    23     case PEP_KEY_HAS_AMBIG_NAME: return "PEP_KEY_HAS_AMBIG_NAME";
    24     case PEP_GET_KEY_FAILED: return "PEP_GET_KEY_FAILED";
    25     case PEP_CANNOT_EXPORT_KEY: return "PEP_CANNOT_EXPORT_KEY";
    26     case PEP_CANNOT_EDIT_KEY: return "PEP_CANNOT_EDIT_KEY";
    27     case PEP_KEY_UNSUITABLE: return "PEP_KEY_UNSUITABLE";
    28     case PEP_MALFORMED_KEY_RESET_MSG: return "PEP_MALFORMED_KEY_RESET_MSG";
    29     case PEP_KEY_NOT_RESET: return "PEP_KEY_NOT_RESET";
    30 
    31     case PEP_KEY_IMPORTED: return "PEP_KEY_IMPORTED";
    32     case PEP_NO_KEY_IMPORTED: return "PEP_NO_KEY_IMPORTED";
    33     case PEP_KEY_IMPORT_STATUS_UNKNOWN: return "PEP_KEY_IMPORT_STATUS_UNKNOWN";
    34     
    35     case PEP_CANNOT_FIND_IDENTITY: return "PEP_CANNOT_FIND_IDENTITY";
    36     case PEP_CANNOT_SET_PERSON: return "PEP_CANNOT_SET_PERSON";
    37     case PEP_CANNOT_SET_PGP_KEYPAIR: return "PEP_CANNOT_SET_PGP_KEYPAIR";
    38     case PEP_CANNOT_SET_IDENTITY: return "PEP_CANNOT_SET_IDENTITY";
    39     case PEP_CANNOT_SET_TRUST: return "PEP_CANNOT_SET_TRUST";
    40     case PEP_KEY_BLACKLISTED: return "PEP_KEY_BLACKLISTED";
    41     case PEP_CANNOT_FIND_PERSON: return "PEP_CANNOT_FIND_PERSON";
    42 
    43     case PEP_CANNOT_FIND_ALIAS: return "PEP_CANNOT_FIND_ALIAS";
    44     case PEP_CANNOT_SET_ALIAS: return "PEP_CANNOT_SET_ALIAS";
    45 
    46     case PEP_UNENCRYPTED: return "PEP_UNENCRYPTED";
    47     case PEP_VERIFIED: return "PEP_VERIFIED";
    48     case PEP_DECRYPTED: return "PEP_DECRYPTED";
    49     case PEP_DECRYPTED_AND_VERIFIED: return "PEP_DECRYPTED_AND_VERIFIED";
    50     case PEP_DECRYPT_WRONG_FORMAT: return "PEP_DECRYPT_WRONG_FORMAT";
    51     case PEP_DECRYPT_NO_KEY: return "PEP_DECRYPT_NO_KEY";
    52     case PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH: return "PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH";
    53     case PEP_VERIFY_NO_KEY: return "PEP_VERIFY_NO_KEY";
    54     case PEP_VERIFIED_AND_TRUSTED: return "PEP_VERIFIED_AND_TRUSTED";
    55     case PEP_CANNOT_REENCRYPT: return "PEP_CANNOT_REENCRYPT";
    56     case PEP_CANNOT_DECRYPT_UNKNOWN: return "PEP_CANNOT_DECRYPT_UNKNOWN";
    57 
    58     case PEP_TRUSTWORD_NOT_FOUND: return "PEP_TRUSTWORD_NOT_FOUND";
    59     case PEP_TRUSTWORDS_FPR_WRONG_LENGTH: return "PEP_TRUSTWORDS_FPR_WRONG_LENGTH";
    60     case PEP_TRUSTWORDS_DUPLICATE_FPR: return "PEP_TRUSTWORDS_DUPLICATE_FPR";
    61 
    62     case PEP_CANNOT_CREATE_KEY: return "PEP_CANNOT_CREATE_KEY";
    63     case PEP_CANNOT_SEND_KEY: return "PEP_CANNOT_SEND_KEY";
    64 
    65     case PEP_PHRASE_NOT_FOUND: return "PEP_PHRASE_NOT_FOUND";
    66 
    67     case PEP_SEND_FUNCTION_NOT_REGISTERED: return "PEP_SEND_FUNCTION_NOT_REGISTERED";
    68     case PEP_CONTRAINTS_VIOLATED: return "PEP_CONTRAINTS_VIOLATED";
    69     case PEP_CANNOT_ENCODE: return "PEP_CANNOT_ENCODE";
    70 
    71     case PEP_SYNC_NO_NOTIFY_CALLBACK: return "PEP_SYNC_NO_NOTIFY_CALLBACK";
    72     case PEP_SYNC_ILLEGAL_MESSAGE: return "PEP_SYNC_ILLEGAL_MESSAGE";
    73     case PEP_SYNC_NO_INJECT_CALLBACK: return "PEP_SYNC_NO_INJECT_CALLBACK";
    74     case PEP_SYNC_NO_CHANNEL: return "PEP_SYNC_NO_CHANNEL";
    75     case PEP_SYNC_CANNOT_ENCRYPT: return "PEP_SYNC_CANNOT_ENCRYPT";
    76     case PEP_SYNC_NO_MESSAGE_SEND_CALLBACK: return "PEP_SYNC_NO_MESSAGE_SEND_CALLBACK";
    77 
    78     case PEP_CANNOT_INCREASE_SEQUENCE: return "PEP_CANNOT_INCREASE_SEQUENCE";
    79 
    80     case PEP_STATEMACHINE_ERROR: return "PEP_STATEMACHINE_ERROR";
    81     case PEP_NO_TRUST: return "PEP_NO_TRUST";
    82     case PEP_STATEMACHINE_INVALID_STATE: return "PEP_STATEMACHINE_INVALID_STATE";
    83     case PEP_STATEMACHINE_INVALID_EVENT: return "PEP_STATEMACHINE_INVALID_EVENT";
    84     case PEP_STATEMACHINE_INVALID_CONDITION: return "PEP_STATEMACHINE_INVALID_CONDITION";
    85     case PEP_STATEMACHINE_INVALID_ACTION: return "PEP_STATEMACHINE_INVALID_ACTION";
    86     case PEP_STATEMACHINE_INHIBITED_EVENT: return "PEP_STATEMACHINE_INHIBITED_EVENT";
    87     case PEP_STATEMACHINE_CANNOT_SEND: return "PEP_STATEMACHINE_CANNOT_SEND";
    88 
    89     case PEP_COMMIT_FAILED: return "PEP_COMMIT_FAILED";
    90     case PEP_MESSAGE_CONSUME: return "PEP_MESSAGE_CONSUME";
    91     case PEP_MESSAGE_IGNORE: return "PEP_MESSAGE_IGNORE";
    92 
    93     case PEP_RECORD_NOT_FOUND: return "PEP_RECORD_NOT_FOUND";
    94     case PEP_CANNOT_CREATE_TEMP_FILE: return "PEP_CANNOT_CREATE_TEMP_FILE";
    95     case PEP_ILLEGAL_VALUE: return "PEP_ILLEGAL_VALUE";
    96     case PEP_BUFFER_TOO_SMALL: return "PEP_BUFFER_TOO_SMALL";
    97     case PEP_OUT_OF_MEMORY: return "PEP_OUT_OF_MEMORY";
    98     case PEP_UNKNOWN_ERROR: return "PEP_UNKNOWN_ERROR";
    99 
   100     case PEP_VERSION_MISMATCH: return "PEP_VERSION_MISMATCH";
   101 
   102     default: return "unknown status code";
   103     }
   104 }
   105 
   106 #ifdef __cplusplus
   107 } // "C"
   108 #endif
   109