mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-01-30 05:39:12 +02:00
Markdown update missed in 1db9e3b1.
This commit is contained in:
parent
20162ed3fe
commit
c5ee56a724
13
CODING.md
13
CODING.md
@ -189,21 +189,26 @@ This project implements variadic functions using macros (which are exempt from t
|
||||
```c
|
||||
typedef struct StoragePathCreateParam
|
||||
{
|
||||
VAR_PARAM_HEADER;
|
||||
bool errorOnExists;
|
||||
bool noParentCreate;
|
||||
mode_t mode;
|
||||
} StoragePathCreateParam;
|
||||
|
||||
#define storagePathCreateP(this, pathExp, ...) \
|
||||
storagePathCreate(this, pathExp, (StoragePathCreateParam){VAR_PARAM_INIT, __VA_ARGS__})
|
||||
#define storagePathCreateP(this, pathExp, ...) \
|
||||
storagePathCreate(this, pathExp, (StoragePathCreateParam){__VA_ARGS__})
|
||||
#define storagePathCreateP(this, pathExp) \
|
||||
storagePathCreate(this, pathExp, (StoragePathCreateParam){0})
|
||||
|
||||
void storagePathCreate(const Storage *this, const String *pathExp, StoragePathCreateParam param);
|
||||
```
|
||||
Continuation characters should be aligned at column 132 (unlike the example above that has been shortened for display purposes).
|
||||
|
||||
This function can now be called with variable parameters using the macro:
|
||||
This function can be called without variable parameters:
|
||||
```c
|
||||
storagePathCreateP(storageLocal(), "/tmp/pgbackrest");
|
||||
```
|
||||
Or with variable parameters:
|
||||
```c
|
||||
storagePathCreateP(storageLocal(), "/tmp/pgbackrest", .errorOnExists = true, .mode = 0777);
|
||||
```
|
||||
If the majority of functions in a module or object are variadic it is best to provide macros for all functions even if they do not have variable parameters. Do not use the base function when variadic macros exist.
|
||||
|
Loading…
x
Reference in New Issue
Block a user