Skip to content

Commit 4302e8b

Browse files
authored
docs: improve Doxygen rendering on C bindings (#405)
When `LD_EXPORT` appears on the same line as the function name, Doxygen doesn't render the function name nicely and it's confusing. This fixes a bunch of instances that I found in the C bindings.
1 parent 59f8beb commit 4302e8b

File tree

7 files changed

+38
-17
lines changed

7 files changed

+38
-17
lines changed

libs/client-sdk/include/launchdarkly/client_side/bindings/c/config/builder.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,14 @@ struct LDPersistence {
9292
* passing a custom implementation into configuration.
9393
* @param backend Implementation to initialize.
9494
*/
95-
LD_EXPORT(void) LDPersistence_Init(struct LDPersistence* implementation);
95+
LD_EXPORT(void)
96+
LDPersistence_Init(struct LDPersistence* implementation);
9697

9798
/**
9899
* Constructs a client-side config builder.
99100
*/
100-
LD_EXPORT(LDClientConfigBuilder) LDClientConfigBuilder_New(char const* sdk_key);
101+
LD_EXPORT(LDClientConfigBuilder)
102+
LDClientConfigBuilder_New(char const* sdk_key);
101103

102104
/**
103105
* Sets a custom URL for the polling service.
@@ -325,7 +327,8 @@ LDDataSourceStreamBuilder_InitialReconnectDelayMs(LDDataSourceStreamBuilder b,
325327
*
326328
* @param b Builder to free.
327329
*/
328-
LD_EXPORT(void) LDDataSourceStreamBuilder_Free(LDDataSourceStreamBuilder b);
330+
LD_EXPORT(void)
331+
LDDataSourceStreamBuilder_Free(LDDataSourceStreamBuilder b);
329332

330333
/**
331334
* Creates a new DataSource builder for the Polling method.
@@ -353,7 +356,8 @@ LDDataSourcePollBuilder_IntervalS(LDDataSourcePollBuilder b,
353356
*
354357
* @param b Builder to free.
355358
*/
356-
LD_EXPORT(void) LDDataSourcePollBuilder_Free(LDDataSourcePollBuilder b);
359+
LD_EXPORT(void)
360+
LDDataSourcePollBuilder_Free(LDDataSourcePollBuilder b);
357361

358362
/**
359363
* This should be used for wrapper SDKs to set the wrapper name.
@@ -468,14 +472,16 @@ LDClientConfigBuilder_Logging_Custom(LDClientConfigBuilder b,
468472
* LDPersistenceCustomBuilder_Free.
469473
* @return New builder.
470474
*/
471-
LD_EXPORT(LDPersistenceCustomBuilder) LDPersistenceCustomBuilder_New();
475+
LD_EXPORT(LDPersistenceCustomBuilder)
476+
LDPersistenceCustomBuilder_New();
472477

473478
/**
474479
* Frees a custom persistence builder. Do not call if the builder was consumed
475480
* by the config builder.
476481
* @param b Builder to free.
477482
*/
478-
LD_EXPORT(void) LDPersistenceCustomBuilder_Free(LDPersistenceCustomBuilder b);
483+
LD_EXPORT(void)
484+
LDPersistenceCustomBuilder_Free(LDPersistenceCustomBuilder b);
479485

480486
/**
481487
* Sets a custom persistence implementation.

libs/client-sdk/include/launchdarkly/client_side/bindings/c/config/config.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ typedef struct _LDClientConfig* LDClientConfig;
1919
*
2020
* @param config Config to free.
2121
*/
22-
LD_EXPORT(void) LDClientConfig_Free(LDClientConfig config);
22+
LD_EXPORT(void)
23+
LDClientConfig_Free(LDClientConfig config);
2324

2425
#ifdef __cplusplus
2526
}

libs/client-sdk/include/launchdarkly/client_side/bindings/c/sdk.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,16 @@ LDClientSDK_Start(LDClientSDK sdk,
120120
* @param sdk SDK. Must not be NULL.
121121
* @return True if initialized.
122122
*/
123-
LD_EXPORT(bool) LDClientSDK_Initialized(LDClientSDK sdk);
123+
LD_EXPORT(bool)
124+
LDClientSDK_Initialized(LDClientSDK sdk);
124125

125126
/**
126127
* Tracks that the current context performed an event for the given event name.
127128
* @param sdk SDK. Must not be NULL.
128129
* @param event_name Name of the event. Must not be NULL.
129130
*/
130-
LD_EXPORT(void) LDClientSDK_TrackEvent(LDClientSDK sdk, char const* event_name);
131+
LD_EXPORT(void)
132+
LDClientSDK_TrackEvent(LDClientSDK sdk, char const* event_name);
131133

132134
/**
133135
* Tracks that the current context performed an event for the given event
@@ -421,7 +423,8 @@ LDClientSDK_AllFlags(LDClientSDK sdk);
421423
* Frees the SDK's resources, shutting down any connections. May block.
422424
* @param sdk SDK.
423425
*/
424-
LD_EXPORT(void) LDClientSDK_Free(LDClientSDK sdk);
426+
LD_EXPORT(void)
427+
LDClientSDK_Free(LDClientSDK sdk);
425428

426429
/**
427430
* Listen for changes for the specific flag.
@@ -545,7 +548,8 @@ LDDataSourceStatus_GetLastError(LDDataSourceStatus status);
545548
* encountered an unrecoverable error or that the SDK was explicitly shut
546549
* down.
547550
*/
548-
LD_EXPORT(time_t) LDDataSourceStatus_StateSince(LDDataSourceStatus status);
551+
LD_EXPORT(time_t)
552+
LDDataSourceStatus_StateSince(LDDataSourceStatus status);
549553

550554
typedef void (*DataSourceStatusCallbackFn)(LDDataSourceStatus status,
551555
void* user_data);
@@ -619,7 +623,8 @@ LDClientSDK_DataSourceStatus_Status(LDClientSDK sdk);
619623
* Frees the data source status.
620624
* @param status The data source status to free.
621625
*/
622-
LD_EXPORT(void) LDDataSourceStatus_Free(LDDataSourceStatus status);
626+
LD_EXPORT(void)
627+
LDDataSourceStatus_Free(LDDataSourceStatus status);
623628

624629
#ifdef __cplusplus
625630
}

libs/common/include/launchdarkly/bindings/c/export.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* @file export.h
3+
* @brief Export macros for C bindings
4+
*/
15
#pragma once
26

37
#ifdef DOXYGEN_SHOULD_SKIP_THIS

libs/server-sdk/include/launchdarkly/server_side/bindings/c/config/builder.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ typedef struct _LDServerHttpPropertiesTlsBuilder*
2828
/**
2929
* Constructs a client-side config builder.
3030
*/
31-
LD_EXPORT(LDServerConfigBuilder) LDServerConfigBuilder_New(char const* sdk_key);
31+
LD_EXPORT(LDServerConfigBuilder)
32+
LDServerConfigBuilder_New(char const* sdk_key);
3233

3334
/**
3435
* Sets a custom URL for the polling service.

libs/server-sdk/include/launchdarkly/server_side/bindings/c/config/config.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ typedef struct _LDCServerConfig* LDServerConfig;
1717
* not need to be freed.
1818
* @param config Config to free.
1919
*/
20-
LD_EXPORT(void) LDServerConfig_Free(LDServerConfig config);
20+
LD_EXPORT(void)
21+
LDServerConfig_Free(LDServerConfig config);
2122

2223
#ifdef __cplusplus
2324
}

libs/server-sdk/include/launchdarkly/server_side/bindings/c/sdk.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ LDServerSDK_Start(LDServerSDK sdk,
117117
* @param sdk SDK. Must not be NULL.
118118
* @return True if initialized.
119119
*/
120-
LD_EXPORT(bool) LDServerSDK_Initialized(LDServerSDK sdk);
120+
LD_EXPORT(bool)
121+
LDServerSDK_Initialized(LDServerSDK sdk);
121122

122123
/**
123124
* Tracks that the given context performed an event with the given event name.
@@ -397,7 +398,8 @@ LDServerSDK_AllFlagsState(LDServerSDK sdk,
397398
* Frees the SDK's resources, shutting down any connections. May block.
398399
* @param sdk SDK.
399400
*/
400-
LD_EXPORT(void) LDServerSDK_Free(LDServerSDK sdk);
401+
LD_EXPORT(void)
402+
LDServerSDK_Free(LDServerSDK sdk);
401403

402404
typedef struct _LDServerDataSourceStatus* LDServerDataSourceStatus;
403405

@@ -572,7 +574,8 @@ LDServerSDK_DataSourceStatus_Status(LDServerSDK sdk);
572574
* Frees the data source status.
573575
* @param status The data source status to free.
574576
*/
575-
LD_EXPORT(void) LDServerDataSourceStatus_Free(LDServerDataSourceStatus status);
577+
LD_EXPORT(void)
578+
LDServerDataSourceStatus_Free(LDServerDataSourceStatus status);
576579

577580
#ifdef __cplusplus
578581
}

0 commit comments

Comments
 (0)