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