1 #include <sys/types.h> 2 #include <sys/stat.h> 3 #include <stdio.h> 4 #include <stdlib.h> 5 6 #include <wdns.h> 7 8 int main(void)9main(void) { 10 11 /* to do compile-time checking, do something like the following: */ 12 #if WDNS_LIBRARY_VERSION_NUMBER > 9001 13 printf("your install of libwdns supports compile-time versioning "); 14 printf("(WDNS_LIBRARY_VERSION_NUMBER == %lu)\n", 15 WDNS_LIBRARY_VERSION_NUMBER); 16 /* to do run-time checking, do something like the following: */ 17 printf("libwdns run-time version is %d\n", wdns_get_version_number()); 18 19 /* and to emit a stringified version number, do this: */ 20 printf("this program was linked against libwdns version %s\n", 21 wdns_get_version()); 22 return (EXIT_SUCCESS); 23 #else 24 printf("your install of libwdns predates versioning, consider an upgrade\n"); 25 return (EXIT_SUCCESS); 26 #endif 27 } 28