From a0937e1f3e8afb628de3431263529d7f1f203421 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 4 Dec 2013 16:36:28 +0100 Subject: [PATCH] [API 0.358] Get rid of stdbool.h --- spec/example-all-functions.c | 3 +-- spec/example-simple-answers.c | 2 +- spec/example-synchronous.c | 2 +- spec/example-tree.c | 2 +- spec/getdns_core_only.h | 5 ++--- spec/index.html | 16 ++++++++-------- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/spec/example-all-functions.c b/spec/example-all-functions.c index 5f41e516..f9dab153 100644 --- a/spec/example-all-functions.c +++ b/spec/example-all-functions.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #define UNUSED_PARAM(x) ((void)(x)) @@ -13,7 +12,7 @@ getdns_return_t retregular; char * retcharstar; /* The args */ -bool boolarg; +int boolarg; char * charstararg; getdns_callback_t callbackarg; uint16_t regulararg; diff --git a/spec/example-simple-answers.c b/spec/example-simple-answers.c index 031af9e2..12148007 100644 --- a/spec/example-simple-answers.c +++ b/spec/example-simple-answers.c @@ -57,7 +57,7 @@ int main() { /* Create the DNS context for this call */ struct getdns_context_t *this_context = NULL; - getdns_return_t context_create_return = getdns_context_create(&this_context, true); + getdns_return_t context_create_return = getdns_context_create(&this_context, 1); if (context_create_return != GETDNS_RETURN_GOOD) { fprintf(stderr, "Trying to create the context failed: %d", context_create_return); diff --git a/spec/example-synchronous.c b/spec/example-synchronous.c index a6ec1ef3..df4a6f27 100644 --- a/spec/example-synchronous.c +++ b/spec/example-synchronous.c @@ -10,7 +10,7 @@ int main() getdns_return_t this_ret; /* Holder for all function returns */ /* Create the DNS context for this call */ struct getdns_context_t *this_context = NULL; - getdns_return_t context_create_return = getdns_context_create(&this_context, true); + getdns_return_t context_create_return = getdns_context_create(&this_context, 1); if (context_create_return != GETDNS_RETURN_GOOD) { fprintf(stderr, "Trying to create the context failed: %d", context_create_return); diff --git a/spec/example-tree.c b/spec/example-tree.c index 9bda28ec..73c8d205 100644 --- a/spec/example-tree.c +++ b/spec/example-tree.c @@ -96,7 +96,7 @@ int main() { /* Create the DNS context for this call */ struct getdns_context_t *this_context = NULL; - getdns_return_t context_create_return = getdns_context_create(&this_context, true); + getdns_return_t context_create_return = getdns_context_create(&this_context, 1); if (context_create_return != GETDNS_RETURN_GOOD) { fprintf(stderr, "Trying to create the context failed: %d", context_create_return); diff --git a/spec/getdns_core_only.h b/spec/getdns_core_only.h index e20ebf5a..4c322a77 100644 --- a/spec/getdns_core_only.h +++ b/spec/getdns_core_only.h @@ -1,11 +1,10 @@ -/* Created at 2013-12-04-16-33-53*/ +/* Created at 2013-12-04-16-35-54*/ #ifndef GETDNS_H #define GETDNS_H #include #include #include -#include #define GETDNS_COMPILATION_COMMENT The API implementation should fill in something here, such as a compilation version string and date, and change it each time the API is compiled. @@ -341,7 +340,7 @@ getdns_service( getdns_return_t getdns_context_create( getdns_context_t *context, - bool set_from_os + int set_from_os ); void diff --git a/spec/index.html b/spec/index.html index 23fdf132..212f31ca 100644 --- a/spec/index.html +++ b/spec/index.html @@ -324,13 +324,13 @@ that affect how DNS calls are made. For most applications, a default context is
getdns_return_t getdns_context_create( getdns_context_t *context, - bool set_from_os + int set_from_os );

The call to getdns_context_create immediately returns a context that can be used with other API calls; that context contains the API's default values. Most applications will -want set_from_os set to true.

+want set_from_os set to 1.

To clean up the context, including cleaning up all outstanding transactions that were called using this context, use the function:

@@ -1385,7 +1385,7 @@ function.

{ /* Create the DNS context for this call */ struct getdns_context_t *this_context = NULL; - getdns_return_t context_create_return = getdns_context_create(&this_context, true); + getdns_return_t context_create_return = getdns_context_create(&this_context, 1); if (context_create_return != GETDNS_RETURN_GOOD) { fprintf(stderr, "Trying to create the context failed: %d", context_create_return); @@ -1533,7 +1533,7 @@ their TTLs.

{ /* Create the DNS context for this call */ struct getdns_context_t *this_context = NULL; - getdns_return_t context_create_return = getdns_context_create(&this_context, true); + getdns_return_t context_create_return = getdns_context_create(&this_context, 1); if (context_create_return != GETDNS_RETURN_GOOD) { fprintf(stderr, "Trying to create the context failed: %d", context_create_return); @@ -1626,7 +1626,7 @@ as it is for the synchronous example, it is just done in main().

getdns_return_t this_ret; /* Holder for all function returns */ /* Create the DNS context for this call */ struct getdns_context_t *this_context = NULL; - getdns_return_t context_create_return = getdns_context_create(&this_context, true); + getdns_return_t context_create_return = getdns_context_create(&this_context, 1); if (context_create_return != GETDNS_RETURN_GOOD) { fprintf(stderr, "Trying to create the context failed: %d", context_create_return); @@ -1769,10 +1769,10 @@ a single thread.

See above for the method for creating and destroying contexts. When the context is used in the API for the first time and set_from_os is -true, the API starts replacing some of the values with values from the OS, such as +1, the API starts replacing some of the values with values from the OS, such as those that would be found in res_query(3), /etc/resolv.conf, and so on, then proceeds with the new function. Some advanced users will not want the API to change the values to the OS's defaults; if -set_from_os is false, the API will not do any updates to the initial +set_from_os is 0, the API will not do any updates to the initial values based on changes in the OS. For example, this might be useful if the API is acting as a stub resolver that is using a specific upstream recursive resolver chosen by the application, not the one that might come back from DHCP.

@@ -2112,7 +2112,7 @@ default is the realloc function.

9. The Generated Files

-

There is a tarball that includes the .h files, +

There is a tarball that includes the .h files, the examples, and so on. The examples all make, even though there is no API implementation, based on a pseudo-implementation in the tarball; see make-examples-PLATFORM.sh. Note that this currently builds fine on the Macintosh and Ubuntu; help is definitely appreciated on making the build process