Files
bind9/bin/tests/system/dyndb/driver/instance.h
T
Ondřej SurýandEvan Hunt f3635bcc14 Use #pragma once as header guards
Unify the header guard style and replace the inconsistent include guards
with #pragma once.

The #pragma once is widely and very well supported in all compilers that
BIND 9 supports, and #pragma once was already in use in several new or
refactored headers.

Using simpler method will also allow us to automate header guard checks
as this is simpler to programatically check.

For reference, here are the reasons for the change taken from
Wikipedia[1]:

> In the C and C++ programming languages, #pragma once is a non-standard
> but widely supported preprocessor directive designed to cause the
> current source file to be included only once in a single compilation.
>
> Thus, #pragma once serves the same purpose as include guards, but with
> several advantages, including: less code, avoidance of name clashes,
> and sometimes improvement in compilation speed. On the other hand,
> #pragma once is not necessarily available in all compilers and its
> implementation is tricky and might not always be reliable.

1. https://en.wikipedia.org/wiki/Pragma_once
2021-10-13 00:49:15 -07:00

47 lines
925 B
C

/**
* Driver instance object.
*
* Copyright (C) 2009-2015 Red Hat ; see COPYRIGHT for license
*/
#pragma once
#include <stdbool.h>
#include <dns/fixedname.h>
#include <dns/name.h>
#include <dns/types.h>
struct sample_instance {
isc_mem_t *mctx;
char *db_name;
dns_dbimplementation_t *db_imp;
/* These are needed for zone creation. */
dns_view_t *view;
dns_zonemgr_t *zmgr;
isc_task_t *task;
bool exiting;
dns_zone_t *zone1;
dns_fixedname_t zone1_fn;
dns_name_t *zone1_name;
dns_zone_t *zone2;
dns_fixedname_t zone2_fn;
dns_name_t *zone2_name;
};
typedef struct sample_instance sample_instance_t;
isc_result_t
new_sample_instance(isc_mem_t *mctx, const char *db_name, int argc, char **argv,
const dns_dyndbctx_t *dctx,
sample_instance_t **sample_instp);
isc_result_t
load_sample_instance_zones(sample_instance_t *inst);
void
destroy_sample_instance(sample_instance_t **sample_instp);