Browse Source

replace #pragma once with include guards

ENGINE-870
Sofia Balicka 10 months ago
parent
commit
fe9a6cb363
43 changed files with 177 additions and 43 deletions
  1. +4
    -1
      src/aux_mime_msg.h
  2. +4
    -1
      src/base64.h
  3. +3
    -1
      src/baseprotocol.h
  4. +3
    -1
      src/blacklist.h
  5. +4
    -1
      src/bloblist.h
  6. +4
    -1
      src/cryptotech.h
  7. +4
    -1
      src/dynamic_api.h
  8. +5
    -1
      src/email.h
  9. +5
    -1
      src/etpan_mime.h
  10. +4
    -1
      src/fsm_common.h
  11. +4
    -1
      src/growing_buf.h
  12. +4
    -1
      src/identity_list.h
  13. +5
    -1
      src/internal_format.h
  14. +4
    -1
      src/key_reset.h
  15. +5
    -1
      src/keymanagement.h
  16. +4
    -1
      src/keyreset_command.h
  17. +4
    -1
      src/labeled_int_list.h
  18. +4
    -1
      src/map_asn1.h
  19. +4
    -1
      src/message.h
  20. +4
    -1
      src/message_api.h
  21. +4
    -1
      src/mime.h
  22. +4
    -1
      src/openpgp_compat.h
  23. +3
    -1
      src/pEpEngine.h
  24. +5
    -0
      src/pEp_internal.h
  25. +3
    -1
      src/pEp_string.h
  26. +4
    -1
      src/pgp_sequoia.h
  27. +4
    -1
      src/pgp_sequoia_internal.h
  28. +4
    -1
      src/platform.h
  29. +4
    -0
      src/platform_unix.h
  30. +4
    -1
      src/platform_windows.h
  31. +4
    -1
      src/resource_id.h
  32. +5
    -0
      src/status_to_string.h
  33. +4
    -1
      src/stringlist.h
  34. +4
    -1
      src/stringpair.h
  35. +4
    -1
      src/sync_api.h
  36. +3
    -1
      src/timestamp.h
  37. +4
    -1
      src/trans_auto.h
  38. +3
    -1
      src/transport.h
  39. +4
    -1
      src/wrappers.h
  40. +4
    -2
      sync/gen_codec.ysl2
  41. +3
    -1
      sync/gen_message_func.ysl2
  42. +10
    -3
      sync/gen_statemachine.ysl2
  43. +4
    -1
      test/src/locked_queue.hh

+ 4
- 1
src/aux_mime_msg.h View File

@ -12,7 +12,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef AUX_MIME_MSG_H
#define AUX_MIME_MSG_H
#ifdef ENIGMAIL_MAY_USE_THIS
@ -182,3 +183,5 @@ DYNAMIC_API PEP_STATUS MIME_decrypt_message(
#endif
#endif
#endif

+ 4
- 1
src/base64.h View File

@ -6,7 +6,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef BASE64_H
#define BASE64_H
#include "dynamic_api.h"
#include "bloblist.h"
@ -31,3 +32,5 @@ bloblist_t* base64_str_to_binary_blob(const char* input, int length);
#ifdef __cplusplus
}
#endif
#endif

+ 3
- 1
src/baseprotocol.h View File

@ -7,7 +7,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef BASEPROTOCOL_H
#define BASEPROTOCOL_H
#include "message.h"
@ -174,3 +175,4 @@ PEP_STATUS try_base_prepare_message(
}
#endif
#endif

+ 3
- 1
src/blacklist.h View File

@ -13,7 +13,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef BLACKLIST_H
#define BLACKLIST_H
#include "pEpEngine.h"
@ -103,3 +104,4 @@ DYNAMIC_API PEP_STATUS blacklist_retrieve(
}
#endif
#endif

+ 4
- 1
src/bloblist.h View File

@ -5,7 +5,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef BLOBLIST_H
#define BLOBLIST_H
#include <stddef.h>
@ -188,3 +189,5 @@ DYNAMIC_API bloblist_t* bloblist_join(bloblist_t* first, bloblist_t* second);
#ifdef __cplusplus
}
#endif
#endif

+ 4
- 1
src/cryptotech.h View File

@ -5,7 +5,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef CRYPTOTECH_H
#define CRYPTOTECH_H
#include "pEpEngine.h"
#include "bloblist.h"
@ -279,3 +280,5 @@ PEP_STATUS init_cryptotech(PEP_SESSION session, bool in_first);
*
*/
void release_cryptotech(PEP_SESSION session, bool out_last);
#endif

+ 4
- 1
src/dynamic_api.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef DYNAMIC_API_H
#define DYNAMIC_API_H
#ifdef WIN32
#ifdef _EXPORT_PEP_ENGINE_DLL
@ -16,3 +17,5 @@
#define DYNAMIC_API
#endif
#endif

+ 5
- 1
src/email.h View File

@ -4,7 +4,9 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef EMAIL_H
#define EMAIL_H
#include "transport.h"
@ -30,3 +32,5 @@ PEP_STATUS email_sendto(PEP_SESSION session, const message *msg);
*
*/
PEP_STATUS email_readnext(PEP_SESSION session, message **msg, PEP_transport_t **via);
#endif

+ 5
- 1
src/etpan_mime.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef ETPAN_MIME_H
#define ETPAN_MIME_H
#define _EXPORT_PEP_ENGINE_DLL
@ -314,3 +315,6 @@ int _get_content_type(
char **type,
char **charset
);
#endif

+ 4
- 1
src/fsm_common.h View File

@ -6,7 +6,9 @@
* @author Volker Birk
*/
#pragma once
#ifndef FSM_COMMON_H
#define FSM_COMMON_H
#ifdef __cplusplus
extern "C" {
@ -51,3 +53,4 @@ enum {
}
#endif
#endif

+ 4
- 1
src/growing_buf.h View File

@ -5,8 +5,9 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef GROWING_BUF_H
#define GROWING_BUF_H
#include "pEpEngine.h"
@ -75,3 +76,5 @@ int growing_buf_consume(const void *src, size_t size, growing_buf_t *dst);
}
#endif
#endif

+ 4
- 1
src/identity_list.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef IDENTITY_LIST_H
#define IDENTITY_LIST_H
#include "pEpEngine.h"
@ -120,3 +121,5 @@ PEP_STATUS set_all_userids_in_list(identity_list* id_list, const char* user_id);
#ifdef __cplusplus
}
#endif
#endif

+ 5
- 1
src/internal_format.h View File

@ -4,7 +4,9 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef INTERNAL_FORMAT_H
#define INTERNAL_FORMAT_H
#include "message.h"
#include "cryptotech.h"
@ -74,3 +76,5 @@ DYNAMIC_API PEP_STATUS decode_internal(
#ifdef __cplusplus
}
#endif
#endif

+ 4
- 1
src/key_reset.h View File

@ -5,7 +5,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef KEY_RESET_H
#define KEY_RESET_H
#include "pEpEngine.h"
#include "keymanagement.h"
@ -271,3 +272,5 @@ PEP_STATUS PER_to_key_reset_commands(const char *cmds, size_t size, keyreset_com
#ifdef __cplusplus
}
#endif
#endif

+ 5
- 1
src/keymanagement.h View File

@ -4,7 +4,9 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef KEYMANAGEMENT_H
#define KEYMANAGEMENT_H
#include "pEpEngine.h"
@ -576,3 +578,5 @@ PEP_STATUS get_valid_pubkey(PEP_SESSION session,
#ifdef __cplusplus
}
#endif
#endif

+ 4
- 1
src/keyreset_command.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef KEYRESET_COMMAND_H
#define KEYRESET_COMMAND_H
#include "dynamic_api.h"
#include "pEpEngine.h"
@ -192,3 +193,5 @@ DYNAMIC_API void free_keyreset_command_list(keyreset_command_list * command_list
}
#endif
#endif

+ 4
- 1
src/labeled_int_list.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef LABELED_INT_LIST_H
#define LABELED_INT_LIST_H
#include "dynamic_api.h"
#include "stringpair.h"
@ -72,3 +73,5 @@ DYNAMIC_API int labeled_int_list_length(const labeled_int_list_t *labeled_int_li
#ifdef __cplusplus
}
#endif
#endif

+ 4
- 1
src/map_asn1.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef MAP_ASN1_H
#define MAP_ASN1_H
#include "pEpEngine.h"
#include "identity_list.h"
@ -95,3 +96,5 @@ identity_list *IdentityList_to_identity_list(IdentityList_t *list, identity_list
#ifdef __cplusplus
}
#endif
#endif

+ 4
- 1
src/message.h View File

@ -6,7 +6,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef MESSAGE_H
#define MESSAGE_H
#include <time.h>
@ -235,3 +236,5 @@ DYNAMIC_API message_ref_list *message_ref_list_add(message_ref_list *msg_list,
#ifdef __cplusplus
}
#endif
#endif

+ 4
- 1
src/message_api.h View File

@ -5,7 +5,8 @@
*/
#pragma once
#ifndef MESSAGE_API_H
#define MESSAGE_API_H
#include "pEpEngine.h"
#include "keymanagement.h"
@ -712,3 +713,5 @@ DYNAMIC_API PEP_STATUS probe_encrypt(PEP_SESSION session, const char *fpr);
#ifdef __cplusplus
}
#endif
#endif

+ 4
- 1
src/mime.h View File

@ -5,7 +5,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef MIME_H
#define MIME_H
#include "message.h"
@ -111,3 +112,5 @@ DYNAMIC_API PEP_STATUS mime_decode_message(
#ifdef __cplusplus
}
#endif
#endif

+ 4
- 1
src/openpgp_compat.h View File

@ -5,7 +5,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef OPENPGP_COMPAT_H
#define OPENPGP_COMPAT_H
#ifdef __cplusplus
extern "C" {
@ -43,3 +44,5 @@ DYNAMIC_API PEP_STATUS OpenPGP_list_keyinfo (
#ifdef __cplusplus
}
#endif
#endif

+ 3
- 1
src/pEpEngine.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef PEP_ENGINE_H
#define PEP_ENGINE_H
#ifdef __cplusplus
extern "C" {
@ -2266,3 +2267,4 @@ PEP_STATUS has_partner_contacted_address(PEP_SESSION session, const char* partne
#ifdef __cplusplus
}
#endif
#endif

+ 5
- 0
src/pEp_internal.h View File

@ -6,6 +6,9 @@
// maximum attachment size to import as key 25MB, maximum of 20 attachments
#ifndef PEP_INTERNAL_H
#define PEP_INTERNAL_H
#define MAX_KEY_SIZE (25 * 1024 * 1024)
#define MAX_KEYS_TO_IMPORT 20
@ -760,3 +763,5 @@ static inline int Sqlite3_step(sqlite3_stmt* stmt)
} while (rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
return rc;
}
#endif

+ 3
- 1
src/pEp_string.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef PeP_STRING_H
#define PeP_STRING_H
#include <string.h>
#include "dynamic_api.h"
@ -66,3 +67,4 @@ DYNAMIC_API char * string_dup(const char *src, size_t len);
}
#endif
#endif

+ 4
- 1
src/pgp_sequoia.h View File

@ -13,7 +13,8 @@
* @todo tidy up tabs
*/
#pragma once
#ifndef PGP_SEQUOIA_H
#define PGP_SEQUOIA_H
#include "pEpEngine.h"
@ -423,3 +424,5 @@ PEP_STATUS pgp_config_cipher_suite(PEP_SESSION session,
PEP_CIPHER_SUITE suite);
#define PGP_BINARY_PATH pgp_binary
#endif

+ 4
- 1
src/pgp_sequoia_internal.h View File

@ -4,6 +4,9 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef PGP_SEQUOIA_INTERNAL_H
#define PGP_SEQUOIA_INTERNAL_H
#include <sequoia/openpgp.h>
#endif

+ 4
- 1
src/platform.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef PLATFORM_H
#define PLATFORM_H
#ifdef __cplusplus
extern "C" {
@ -19,3 +20,5 @@ extern "C" {
#ifdef __cplusplus
}
#endif
#endif

+ 4
- 0
src/platform_unix.h View File

@ -4,6 +4,9 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#ifndef PLATFORM_UNIX_H
#define PLATFORM_UNIX_H
#ifndef __APPLE__
#define _POSIX_C_SOURCE 200809L
#endif
@ -152,3 +155,4 @@ typedef uuid_t pEpUUID;
#ifdef __cplusplus
}
#endif
#endif

+ 4
- 1
src/platform_windows.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef PLATFORM_WINDOWS_H
#define PLATFORM_WINDOWS_H
// Windows platform specifica
@ -275,3 +276,5 @@ void uuid_unparse_upper(pEpUUID uu, uuid_string_t out);
#ifdef __cplusplus
}
#endif
#endif

+ 4
- 1
src/resource_id.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef RESOURCE_ID_H
#define RESOURCE_ID_H
/* structs to contain info about parsed resource ids (filenames, uids) */
/**
@ -104,3 +105,5 @@ bool is_file_uri(char* str);
*
*/
bool is_cid_uri(const char* str);
#endif

+ 5
- 0
src/status_to_string.h View File

@ -4,6 +4,10 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
* @todo generate this file
*/
#ifndef STATUS_TO_STRING_H
#define STATUS_TO_STRING_H
#ifdef __cplusplus
extern "C" {
#endif
@ -178,3 +182,4 @@ static inline const char *pEp_comm_type_to_string(PEP_comm_type ct) {
#ifdef __cplusplus
} // "C"
#endif
#endif

+ 4
- 1
src/stringlist.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef STRINGLIST_H
#define STRINGLIST_H
#include "dynamic_api.h"
@ -211,3 +212,5 @@ void dedup_stringlist(stringlist_t* stringlist);
#ifdef __cplusplus
}
#endif
#endif

+ 4
- 1
src/stringpair.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef STRINGPAIR_H
#define STRINGPAIR_H
#include "dynamic_api.h"
@ -227,3 +228,5 @@ DYNAMIC_API stringpair_list_t *stringpair_list_delete_by_key(
#ifdef __cplusplus
}
#endif
#endif

+ 4
- 1
src/sync_api.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef SYNC_API_H
#define SYNC_API_H
#include "message.h"
@ -308,3 +309,5 @@ DYNAMIC_API PEP_STATUS disable_identity_for_sync(PEP_SESSION session,
#ifdef __cplusplus
}
#endif
#endif

+ 3
- 1
src/timestamp.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef TIMESTAMP_H
#define TIMESTAMP_H
#include <time.h>
#include "dynamic_api.h"
@ -93,3 +94,4 @@ DYNAMIC_API timestamp * timestamp_dup(const timestamp *src);
}
#endif
#endif

+ 4
- 1
src/trans_auto.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef TRANS_AUTO_H
#define TRANS_AUTO_H
#include "transport.h"
@ -20,3 +21,5 @@ PEP_STATUS auto_sendto(PEP_SESSION session, const message *msg);
*
*/
PEP_STATUS auto_readnext(PEP_SESSION session, message **msg, PEP_transport_t **via);
#endif

+ 3
- 1
src/transport.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef TRANSPORT_H
#define TRANSPORT_H
#include "pEpEngine.h"
#include "message.h"
@ -59,3 +60,4 @@ typedef uint64_t transports_mask;
}
#endif
#endif

+ 4
- 1
src/wrappers.h View File

@ -4,7 +4,8 @@
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef WRAPPERS_H
#define WRAPPERS_H
#include "platform.h"
@ -260,3 +261,5 @@ static inline int Close(int fildes)
return r;
}
#endif

+ 4
- 2
sync/gen_codec.ysl2 View File

@ -26,8 +26,9 @@ tstylesheet {
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef «yml:ucase(@name)»_CODEC_H
#define «yml:ucase(@name)»_CODEC_H
#include "pEpEngine.h"
@ -116,6 +117,7 @@ tstylesheet {
#ifdef __cplusplus
}
#endif
#endif
||
document "generated/{yml:lcase(@name)}_codec.c", "text"


+ 3
- 1
sync/gen_message_func.ysl2 View File

@ -30,7 +30,8 @@ template "protocol", mode=header
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef «yml:ucase(@name)»_FUNC_H
#define «yml:ucase(@name)»_FUNC_H
#ifdef __cplusplus
extern "C" {
@ -172,6 +173,7 @@ PEP_STATUS update_«@name»_message(PEP_SESSION session, «@name»_t *msg);
#ifdef __cplusplus
}
#endif
#endif
||


+ 10
- 3
sync/gen_statemachine.ysl2 View File

@ -24,7 +24,8 @@ tstylesheet {
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef «yml:ucase(@name)»_EVENT_H
#define «yml:ucase(@name)»_EVENT_H
#include "pEpEngine.h"
@ -88,6 +89,7 @@ tstylesheet {
#ifdef __cplusplus
}
#endif
#endif
||
@ -156,7 +158,8 @@ tstylesheet {
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef «yml:ucase(@name)»_IMPL_H
#define «yml:ucase(@name)»_IMPL_H
#include "fsm_common.h"
#include "«@name»_event.h"
@ -330,6 +333,7 @@ tstylesheet {
#ifdef __cplusplus
}
#endif
#endif
||
}
@ -1376,7 +1380,8 @@ tstylesheet {
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#pragma once
#ifndef «yml:ucase(@name)»_FSM_H
#define «yml:ucase(@name)»_FSM_H
#include "«../@name»_impl.h"
@ -1474,6 +1479,7 @@ tstylesheet {
#ifdef __cplusplus
}
#endif
#endif
||
}
@ -1752,3 +1758,4 @@ tstylesheet {
| }
}
}

+ 4
- 1
test/src/locked_queue.hh View File

@ -1,4 +1,5 @@
#pragma once
#ifndef LOCKED_QUEUE_H
#define LOCKED_QUEUE_H
#include <list>
#include <mutex>
@ -59,3 +60,5 @@ namespace utility
}
};
}
#endif

Loading…
Cancel
Save