added missing #pragma once and C++ function name mangling protection

This commit is contained in:
matthias.ringwald@gmail.com 2013-05-23 14:57:16 +00:00
parent bdabec0ff1
commit eed533f622
15 changed files with 117 additions and 3 deletions

View File

@ -42,6 +42,10 @@
#pragma once
#if defined __cplusplus
extern "C" {
#endif
typedef void * memory_pool_t;
// initialize memory pool with with given storage, block size and count
@ -52,3 +56,7 @@ void * memory_pool_get(memory_pool_t *pool);
// return previously reserved block to memory pool
void memory_pool_free(memory_pool_t *pool, void * block);
#if defined __cplusplus
}
#endif

View File

@ -47,6 +47,10 @@
#include <stdint.h>
#if defined __cplusplus
extern "C" {
#endif
typedef enum {
POWER_WILL_SLEEP = 1,
POWER_WILL_WAKE_UP
@ -74,3 +78,7 @@ typedef struct {
void (*hw_error)(void);
} bt_control_t;
#if defined __cplusplus
}
#endif

View File

@ -41,9 +41,14 @@
*
* Created by Matthias Ringwald on 5/19/09.
*/
#pragma once
#include "bt_control.h"
#if defined __cplusplus
extern "C" {
#endif
extern bt_control_t bt_control_iphone;
int bt_control_iphone_power_management_enabled(void);
@ -54,5 +59,7 @@ void iphone_system_bt_set_enabled(int enabled);
int iphone_system_has_csr(void);
#if defined __cplusplus
}
#endif

View File

@ -40,6 +40,8 @@
* allow to funnel debug & error messages
*/
#pragma once
#include "config.h"
#include "hci_dump.h"

View File

@ -46,6 +46,10 @@
#include <stdint.h>
#if defined __cplusplus
extern "C" {
#endif
typedef enum {
HCI_DUMP_BLUEZ = 0,
HCI_DUMP_PACKETLOGGER,
@ -57,3 +61,7 @@ void hci_dump_set_max_packets(int packets); // -1 for unlimited
void hci_dump_packet(uint8_t packet_type, uint8_t in, uint8_t *packet, uint16_t len);
void hci_dump_log(const char * format, ...);
void hci_dump_close(void);
#if defined __cplusplus
}
#endif

View File

@ -47,6 +47,10 @@
#include <btstack/utils.h>
#include <btstack/hci_cmds.h>
#if defined __cplusplus
extern "C" {
#endif
typedef enum {
COMMAND_REJECT = 1,
CONNECTION_REQUEST,
@ -65,3 +69,7 @@ uint16_t l2cap_create_signaling_internal(uint8_t * acl_buffer,hci_con_handle_t h
uint8_t l2cap_next_sig_id(void);
uint16_t l2cap_next_local_cid(void);
#if defined __cplusplus
}
#endif

View File

@ -46,8 +46,15 @@
#include "hci.h"
#if defined __cplusplus
extern "C" {
#endif
void platform_iphone_status_handler(BLUETOOTH_STATE state);
void platform_iphone_register_window_manager_restart(void (*callback)());
void platform_iphone_register_preferences_changed(void (*callback)());
int platform_iphone_logging_enabled(void);
#if defined __cplusplus
}
#endif

View File

@ -42,6 +42,10 @@
#include <btstack/utils.h>
#if defined __cplusplus
extern "C" {
#endif
typedef struct {
// management
@ -93,3 +97,7 @@ typedef struct {
char service_name[MAX_NAME_LEN];
uint8_t channel;
} db_mem_service_t;
#if defined __cplusplus
}
#endif

View File

@ -38,6 +38,8 @@
* RFCOMM.h
*/
#pragma once
#include <btstack/btstack.h>
#include <btstack/utils.h>

View File

@ -46,11 +46,16 @@
#ifdef HAVE_TIME
#include <sys/time.h>
#endif
#if defined __cplusplus
extern "C" {
#endif
#ifdef HAVE_TIME
// compare timeval or timers - NULL is assumed to be before the Big Bang
int run_loop_timeval_compare(struct timeval *a, struct timeval *b);
int run_loop_timer_compare(timer_source_t *a, timer_source_t *b);
#endif
//
@ -66,3 +71,8 @@ typedef struct {
void (*execute)(void);
void (*dump_timer)(void);
} run_loop_t;
#if defined __cplusplus
}
#endif

View File

@ -40,6 +40,10 @@
#include "config.h"
#if defined __cplusplus
extern "C" {
#endif
typedef enum {
SDP_ErrorResponse = 1,
SDP_ServiceSearchRequest,
@ -101,3 +105,6 @@ uint32_t sdp_register_service_internal(void *connection, service_record_item_t *
// Unregister service record internally.
void sdp_unregister_service_internal(void *connection, uint32_t service_record_handle);
#if defined __cplusplus
}
#endif

View File

@ -38,8 +38,14 @@
* sdp_client.h
*/
#pragma once
#include <btstack/utils.h>
#if defined __cplusplus
extern "C" {
#endif
/* SDP Client */
/* Queries the SDP service of the remote device given a service search pattern
@ -47,3 +53,7 @@ and a list of attribute IDs. The remote data is handled by the SDP parser. The
SDP parser delivers attribute values and done event via a registered callback. */
void sdp_client_query(bd_addr_t remote, uint8_t * des_serviceSearchPattern, uint8_t * des_attributeIDList);
#if defined __cplusplus
}
#endif

View File

@ -38,6 +38,8 @@
* sdp_parser.h
*/
#pragma once
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@ -45,6 +47,10 @@
#include <btstack/sdp_util.h>
#if defined __cplusplus
extern "C" {
#endif
/* SDP Parser */
// Data Element stream parser helper
@ -92,3 +98,9 @@ void sdp_parser_handle_done(uint8_t status);
// Registers a callback to receive attribute value data and parse complete event.
void sdp_parser_register_callback(void (*sdp_callback)(sdp_parser_event_t* event));
#if defined __cplusplus
}
#endif

View File

@ -38,9 +38,15 @@
* sdp_rfcomm_query.h
*/
#pragma once
#include <btstack/utils.h>
#include "sdp_parser.h"
#if defined __cplusplus
extern "C" {
#endif
/* SDP Queries */
// Basic SDP Query event type
@ -78,3 +84,7 @@ void sdp_query_rfcomm_channel_and_name_for_search_pattern(bd_addr_t remote, uint
// Registers a callback to receive RFCOMM service and query complete event.
void sdp_query_rfcomm_register_callback(void(*sdp_app_callback)(sdp_query_event_t * event, void * context), void * context);
#if defined __cplusplus
}
#endif

View File

@ -1,3 +1,4 @@
/*
* Copyright (C) 2009-2012 by Matthias Ringwald
*
@ -46,6 +47,9 @@
#include <stdint.h>
#if defined __cplusplus
extern "C" {
#endif
/** opaque connection type */
typedef struct connection connection_t;
@ -118,3 +122,6 @@ void socket_connection_retry_parked(void);
*/
int socket_connection_has_parked_connections(void);
#if defined __cplusplus
}
#endif