Commit 3740b569 authored by Bob Halley's avatar Bob Halley

the great type change

parent 26ec6d66
......@@ -31,7 +31,7 @@
#include <dns/name.h>
static void
print_wirename(isc_region_t name) {
print_wirename(isc_region_t *name) {
unsigned char *ccurr, *cend;
ccurr = name->base;
......@@ -49,9 +49,9 @@ main(int argc, char *argv[]) {
unsigned char c[255];
unsigned int tbytes;
dns_result_t result;
struct dns_name name, oname, compname;
struct isc_region source, target, r;
dns_name_t origin, comp;
dns_name_t name, oname, compname;
isc_region_t source, target, r;
dns_name_t *origin, *comp;
isc_boolean_t downcase = ISC_FALSE;
argc--;
......
......@@ -37,14 +37,14 @@
#include <arpa/inet.h>
isc_memctx_t mctx = NULL;
isc_memctx_t *mctx = NULL;
int sockets_active = 0;
static isc_boolean_t my_send(isc_task_t task, isc_event_t event);
static isc_boolean_t my_recv(isc_task_t task, isc_event_t event);
static isc_boolean_t my_send(isc_task_t *task, isc_event_t *event);
static isc_boolean_t my_recv(isc_task_t *task, isc_event_t *event);
static isc_boolean_t
my_callback(isc_task_t task, isc_event_t event)
my_callback(isc_task_t *task, isc_event_t *event)
{
char *name = event->arg;
......@@ -56,7 +56,7 @@ my_callback(isc_task_t task, isc_event_t event)
}
static isc_boolean_t
my_shutdown(isc_task_t task, isc_event_t event)
my_shutdown(isc_task_t *task, isc_event_t *event)
{
char *name = event->arg;
......@@ -68,15 +68,15 @@ my_shutdown(isc_task_t task, isc_event_t event)
}
static isc_boolean_t
my_recv(isc_task_t task, isc_event_t event)
my_recv(isc_task_t *task, isc_event_t *event)
{
isc_socket_t sock;
isc_socketevent_t dev;
struct isc_region region;
isc_socket_t *sock;
isc_socketevent_t *dev;
isc_region_t region;
char buf[1024];
sock = event->sender;
dev = (isc_socketevent_t)event;
dev = (isc_socketevent_t *)event;
printf("Socket %s (sock %p, base %p, length %d, n %d, result %d)\n",
(char *)(event->arg), sock,
......@@ -125,13 +125,13 @@ my_recv(isc_task_t task, isc_event_t event)
}
static isc_boolean_t
my_send(isc_task_t task, isc_event_t event)
my_send(isc_task_t *task, isc_event_t *event)
{
isc_socket_t sock;
isc_socketevent_t dev;
isc_socket_t *sock;
isc_socketevent_t *dev;
sock = event->sender;
dev = (isc_socketevent_t)event;
dev = (isc_socketevent_t *)event;
printf("my_send: %s task %p\n\t(sock %p, base %p, length %d, n %d, result %d)\n",
(char *)(event->arg), task, sock,
......@@ -146,13 +146,13 @@ my_send(isc_task_t task, isc_event_t event)
}
static isc_boolean_t
my_http_get(isc_task_t task, isc_event_t event)
my_http_get(isc_task_t *task, isc_event_t *event)
{
isc_socket_t sock;
isc_socketevent_t dev;
isc_socket_t *sock;
isc_socketevent_t *dev;
sock = event->sender;
dev = (isc_socketevent_t)event;
dev = (isc_socketevent_t *)event;
printf("my_http_get: %s task %p\n\t(sock %p, base %p, length %d, n %d, result %d)\n",
(char *)(event->arg), task, sock,
......@@ -168,15 +168,15 @@ my_http_get(isc_task_t task, isc_event_t event)
}
static isc_boolean_t
my_connect(isc_task_t task, isc_event_t event)
my_connect(isc_task_t *task, isc_event_t *event)
{
isc_socket_t sock;
isc_socket_connev_t dev;
struct isc_region region;
isc_socket_t *sock;
isc_socket_connev_t *dev;
isc_region_t region;
char buf[1024];
sock = event->sender;
dev = (isc_socket_connev_t)event;
dev = (isc_socket_connev_t *)event;
printf("%s: Connection result: %d\n", (char *)(event->arg),
dev->result);
......@@ -205,15 +205,15 @@ my_connect(isc_task_t task, isc_event_t event)
}
static isc_boolean_t
my_listen(isc_task_t task, isc_event_t event)
my_listen(isc_task_t *task, isc_event_t *event)
{
char *name = event->arg;
isc_socket_newconnev_t dev;
struct isc_region region;
isc_socket_t oldsock;
isc_socket_newconnev_t *dev;
isc_region_t region;
isc_socket_t *oldsock;
int ret;
dev = (isc_socket_newconnev_t)event;
dev = (isc_socket_newconnev_t *)event;
printf("newcon %s (task %p, oldsock %p, newsock %p, result %d)\n",
name, task, event->sender, dev->newsocket, dev->result);
......@@ -252,14 +252,14 @@ my_listen(isc_task_t task, isc_event_t event)
}
static isc_boolean_t
timeout(isc_task_t task, isc_event_t event)
timeout(isc_task_t *task, isc_event_t *event)
{
isc_socket_t sock = event->arg;
isc_socket_t *sock = event->arg;
printf("Timeout, canceling IO on socket %p (task %p)\n", sock, task);
isc_socket_cancel(sock, NULL, ISC_SOCKCANCEL_ALL);
isc_timer_detach((isc_timer_t *)&event->sender);
isc_timer_detach((isc_timer_t **)&event->sender);
return (0);
}
......@@ -267,17 +267,17 @@ timeout(isc_task_t task, isc_event_t event)
int
main(int argc, char *argv[])
{
isc_taskmgr_t manager = NULL;
isc_task_t t1 = NULL, t2 = NULL;
isc_timermgr_t timgr = NULL;
struct isc_time expires, now;
struct isc_interval interval;
isc_timer_t ti1 = NULL;
isc_event_t event;
isc_taskmgr_t *manager = NULL;
isc_task_t *t1 = NULL, *t2 = NULL;
isc_timermgr_t *timgr = NULL;
isc_time_t expires, now;
isc_interval_t interval;
isc_timer_t *ti1 = NULL;
isc_event_t *event;
unsigned int workers;
isc_socketmgr_t socketmgr;
isc_socket_t so1, so2;
struct isc_sockaddr sockaddr;
isc_socketmgr_t *socketmgr;
isc_socket_t *so1, *so2;
isc_sockaddr_t sockaddr;
unsigned int addrlen;
......
......@@ -28,10 +28,10 @@
#include <isc/result.h>
#include <isc/timer.h>
isc_memctx_t mctx = NULL;
isc_memctx_t *mctx = NULL;
static isc_boolean_t
my_callback(isc_task_t task, isc_event_t event)
my_callback(isc_task_t *task, isc_event_t *event)
{
int i, j;
char *name = event->arg;
......@@ -46,7 +46,7 @@ my_callback(isc_task_t task, isc_event_t event)
}
static isc_boolean_t
my_shutdown(isc_task_t task, isc_event_t event) {
my_shutdown(isc_task_t *task, isc_event_t *event) {
char *name = event->arg;
printf("shutdown %s (%p)\n", name, task);
......@@ -56,7 +56,7 @@ my_shutdown(isc_task_t task, isc_event_t event) {
}
static isc_boolean_t
my_tick(isc_task_t task, isc_event_t event)
my_tick(isc_task_t *task, isc_event_t *event)
{
char *name = event->arg;
......@@ -68,13 +68,13 @@ my_tick(isc_task_t task, isc_event_t event)
void
main(int argc, char *argv[]) {
isc_taskmgr_t manager = NULL;
isc_task_t t1 = NULL, t2 = NULL;
isc_task_t t3 = NULL, t4 = NULL;
isc_event_t event;
isc_taskmgr_t *manager = NULL;
isc_task_t *t1 = NULL, *t2 = NULL;
isc_task_t *t3 = NULL, *t4 = NULL;
isc_event_t *event;
unsigned int workers;
isc_timermgr_t timgr;
isc_timer_t ti1, ti2;
isc_timermgr_t *timgr;
isc_timer_t *ti1, *ti2;
struct isc_time absolute;
struct isc_interval interval;
......
......@@ -28,13 +28,13 @@
#include <isc/result.h>
#include <isc/timer.h>
isc_memctx_t mctx = NULL;
isc_task_t t1, t2, t3;
isc_timer_t ti1, ti2, ti3;
isc_memctx_t *mctx = NULL;
isc_task_t *t1, *t2, *t3;
isc_timer_t *ti1, *ti2, *ti3;
int tick_count = 0;
static isc_boolean_t
shutdown_task(isc_task_t task, isc_event_t event) {
shutdown_task(isc_task_t *task, isc_event_t *event) {
char *name = event->arg;
printf("task %p shutdown %s\n", task, name);
......@@ -44,7 +44,7 @@ shutdown_task(isc_task_t task, isc_event_t event) {
}
static isc_boolean_t
tick(isc_task_t task, isc_event_t event)
tick(isc_task_t *task, isc_event_t *event)
{
char *name = event->arg;
......@@ -57,8 +57,8 @@ tick(isc_task_t task, isc_event_t event)
isc_timer_touch(ti3);
if (ti3 != NULL && tick_count == 7) {
struct isc_time expires, now;
struct isc_interval interval;
isc_time_t expires, now;
isc_interval_t interval;
(void)isc_time_get(&now);
isc_interval_set(&interval, 5, 0);
......@@ -76,7 +76,7 @@ tick(isc_task_t task, isc_event_t event)
}
static isc_boolean_t
timeout(isc_task_t task, isc_event_t event)
timeout(isc_task_t *task, isc_event_t *event)
{
char *name = event->arg;
char *type;
......@@ -103,11 +103,11 @@ timeout(isc_task_t task, isc_event_t event)
void
main(int argc, char *argv[]) {
isc_taskmgr_t manager = NULL;
isc_timermgr_t timgr = NULL;
isc_taskmgr_t *manager = NULL;
isc_timermgr_t *timgr = NULL;
unsigned int workers;
struct isc_time expires, now;
struct isc_interval interval;
isc_time_t expires, now;
isc_interval_t interval;
if (argc > 1)
workers = atoi(argv[1]);
......
......@@ -18,6 +18,8 @@
#ifndef DNS_NAME_H
#define DNS_NAME_H 1
#include <dns/types.h>
/*****
***** Module Info
*****/
......@@ -93,7 +95,7 @@
*** Properties
***/
dns_labeltype_t dns_label_type(dns_label_t label);
dns_labeltype_t dns_label_type(dns_label_t *label);
/*
* Get the type of 'label'.
*
......@@ -111,7 +113,7 @@ dns_labeltype_t dns_label_type(dns_label_t label);
*** Bitstring Labels
***/
unsigned int dns_label_countbits(dns_label_t label);
unsigned int dns_label_countbits(dns_label_t *label);
/*
* The number of bits in a bitstring label.
*
......@@ -127,7 +129,7 @@ unsigned int dns_label_countbits(dns_label_t label);
* The number of bits in the bitstring label.
*/
dns_bitlabel_t dns_label_getbit(dns_label_t label, unsigned int n);
dns_bitlabel_t dns_label_getbit(dns_label_t *label, unsigned int n);
/*
* The 'n'th most significant bit of 'label'.
*
......@@ -179,13 +181,13 @@ struct dns_name {
unsigned char offsets[128];
};
extern dns_name_t dns_rootname;
extern dns_name_t *dns_rootname;
/***
*** Initialization
***/
void dns_name_init(dns_name_t name);
void dns_name_init(dns_name_t *name);
/*
* Make 'name' empty.
*
......@@ -201,7 +203,7 @@ void dns_name_init(dns_name_t name);
*** Properties
***/
isc_boolean_t dns_name_isabsolute(dns_name_t name);
isc_boolean_t dns_name_isabsolute(dns_name_t *name);
/*
* Does 'name' end in the root label?
*
......@@ -220,7 +222,7 @@ isc_boolean_t dns_name_isabsolute(dns_name_t name);
*** Comparisons
***/
int dns_name_compare(dns_name_t name1, dns_name_t name2);
int dns_name_compare(dns_name_t *name1, dns_name_t *name2);
/*
* Determine the relative ordering under the DNSSEC order relation of
* 'name1' and 'name2'.
......@@ -241,7 +243,7 @@ int dns_name_compare(dns_name_t name1, dns_name_t name2);
*/
isc_boolean_t
dns_name_issubdomain(dns_name_t name1, dns_name_t name2);
dns_name_issubdomain(dns_name_t *name1, dns_name_t *name2);
/*
* Is 'name1' a subdomain of 'name2'?
*
......@@ -273,7 +275,7 @@ dns_name_issubdomain(dns_name_t name1, dns_name_t name2);
*** Labels
***/
unsigned int dns_name_countlabels(dns_name_t name);
unsigned int dns_name_countlabels(dns_name_t *name);
/*
* How many labels does 'name' have?
*
......@@ -292,7 +294,7 @@ unsigned int dns_name_countlabels(dns_name_t name);
* The number of labels in 'name'.
*/
void dns_name_getlabel(dns_name_t name, unsigned int n, dns_label_t label);
void dns_name_getlabel(dns_name_t *name, unsigned int n, dns_label_t *label);
/*
* Make 'label' refer to the 'n'th least significant label of 'name'.
*
......@@ -309,10 +311,10 @@ void dns_name_getlabel(dns_name_t name, unsigned int n, dns_label_t label);
* n < dns_label_countlabels(name)
*/
void dns_name_getlabelsequence(dns_name_t source,
void dns_name_getlabelsequence(dns_name_t *source,
unsigned int first,
unsigned int n,
dns_name_t target);
dns_name_t *target);
/*
* Make 'target' refer to the 'n' labels including and following 'first'
* in 'source'.
......@@ -332,7 +334,7 @@ void dns_name_getlabelsequence(dns_name_t source,
*** Conversions
***/
void dns_name_fromregion(dns_name_t name, isc_region_t r);
void dns_name_fromregion(dns_name_t *name, isc_region_t *r);
/*
* Make 'name' refer to region 'r'.
*
......@@ -342,7 +344,7 @@ void dns_name_fromregion(dns_name_t name, isc_region_t r);
* The length of 'r' is <= 255.
*/
void dns_name_toregion(dns_name_t name, isc_region_t r);
void dns_name_toregion(dns_name_t *name, isc_region_t *r);
/*
* Make 'r' refer to 'name'.
*
......@@ -353,11 +355,11 @@ void dns_name_toregion(dns_name_t name, isc_region_t r);
* 'r' is a valid region.
*/
dns_result_t dns_name_fromwire(dns_name_t name,
isc_region_t source,
dns_decompression_t dctx,
dns_result_t dns_name_fromwire(dns_name_t *name,
isc_region_t *source,
dns_decompression_t *dctx,
isc_boolean_t downcase,
isc_region_t target);
isc_region_t *target);
/*
* Copy the possibly-compressed name at source into target, decompressing it.
*
......@@ -404,9 +406,9 @@ dns_result_t dns_name_fromwire(dns_name_t name,
* Resource Limit: Not enough space in buffer
*/
dns_result_t dns_name_towire(dns_name_t name,
dns_compression_t cctx,
isc_region_t target, unsigned int *bytesp);
dns_result_t dns_name_towire(dns_name_t *name,
dns_compression_t *cctx,
isc_region_t *target, unsigned int *bytesp);
/*
* Convert 'name' into wire format, compressing it as specified by the
* compression context 'cctx', and storing the result in 'target'.
......@@ -439,11 +441,11 @@ dns_result_t dns_name_towire(dns_name_t name,
* Resource Limit: Not enough space in buffer
*/
dns_result_t dns_name_fromtext(dns_name_t name,
isc_region_t source,
dns_name_t origin,
dns_result_t dns_name_fromtext(dns_name_t *name,
isc_region_t *source,
dns_name_t *origin,
isc_boolean_t downcase,
isc_region_t target);
isc_region_t *target);
/*
* Convert the textual representation of a DNS name at source
* into uncompressed wire form stored in target.
......@@ -483,9 +485,9 @@ dns_result_t dns_name_fromtext(dns_name_t name,
* Resource Limit: Not enough space in buffer
*/
dns_result_t dns_name_totext(dns_name_t name,
dns_result_t dns_name_totext(dns_name_t *name,
isc_boolean_t omit_final_dot,
isc_region_t target, unsigned int *bytesp);
isc_region_t *target, unsigned int *bytesp);
/*
* Convert 'name' into text format, storing the result in 'target'.
*
......
......@@ -22,10 +22,10 @@
#include <isc/boolean.h>
typedef isc_region_t dns_label_t;
typedef struct dns_name * dns_name_t;
typedef struct dns_lex * dns_lex_t;
typedef struct dns_compression * dns_compression_t;
typedef struct dns_decompression * dns_decompression_t;
typedef struct dns_name dns_name_t;
typedef struct dns_lex dns_lex_t;
typedef struct dns_compression dns_compression_t;
typedef struct dns_decompression dns_decompression_t;
typedef enum {
dns_labeltype_ordinary = 0,
......
......@@ -115,10 +115,10 @@ static unsigned char maptolower[] = {
static struct dns_name root = { "", 1, 1 };
dns_name_t dns_rootname = &root;
dns_name_t *dns_rootname = &root;
static void set_offsets(dns_name_t, isc_boolean_t);
static void compact(dns_name_t);
static void set_offsets(dns_name_t *, isc_boolean_t);
static void compact(dns_name_t *);
/*
* Yes, get_bit and set_bit are lame. We define them here so they can
......@@ -150,7 +150,7 @@ set_bit(unsigned char *array, unsigned int index, unsigned int bit) {
}
dns_labeltype_t
dns_label_type(dns_label_t label) {
dns_label_type(dns_label_t *label) {
/*
* Get the type of 'label'.
*/
......@@ -167,7 +167,7 @@ dns_label_type(dns_label_t label) {
}
unsigned int
dns_label_countbits(dns_label_t label) {
dns_label_countbits(dns_label_t *label) {
unsigned int count;
/*
......@@ -186,7 +186,7 @@ dns_label_countbits(dns_label_t label) {
}
dns_bitlabel_t
dns_label_getbit(dns_label_t label, unsigned int n) {
dns_label_getbit(dns_label_t *label, unsigned int n) {
unsigned int count, bit;
/*
......@@ -213,7 +213,7 @@ dns_label_getbit(dns_label_t label, unsigned int n) {
}
void
dns_name_init(dns_name_t name) {
dns_name_init(dns_name_t *name) {
/*
* Make 'name' empty.
*/
......@@ -224,7 +224,7 @@ dns_name_init(dns_name_t name) {
}
isc_boolean_t
dns_name_isabsolute(dns_name_t name) {
dns_name_isabsolute(dns_name_t *name) {
/*
* Does 'name' end in the root label?
*/
......@@ -237,7 +237,7 @@ dns_name_isabsolute(dns_name_t name) {
}
int
dns_name_compare(dns_name_t name1, dns_name_t name2) {
dns_name_compare(dns_name_t *name1, dns_name_t *name2) {
unsigned int l1, l2, l, count1, count2, count;
unsigned int b1, b2, n;
unsigned char c1, c2;
......@@ -341,7 +341,7 @@ dns_name_compare(dns_name_t name1, dns_name_t name2) {
}
isc_boolean_t
dns_name_issubdomain(dns_name_t name1, dns_name_t name2) {
dns_name_issubdomain(dns_name_t *name1, dns_name_t *name2) {
isc_boolean_t a1, a2;
unsigned int l1, l2, count1, count2;
unsigned int b1, b2, n;
......@@ -417,7 +417,7 @@ dns_name_issubdomain(dns_name_t name1, dns_name_t name2) {
}
unsigned int
dns_name_countlabels(dns_name_t name) {
dns_name_countlabels(dns_name_t *name) {
/*
* How many labels does 'name' have?
*/
......@@ -430,7 +430,7 @@ dns_name_countlabels(dns_name_t name) {
}
void
dns_name_getlabel(dns_name_t name, unsigned int n, dns_label_t label) {
dns_name_getlabel(dns_name_t *name, unsigned int n, dns_label_t *label) {
/*
* Make 'label' refer to the 'n'th least significant label of 'name'.
*/
......@@ -447,9 +447,9 @@ dns_name_getlabel(dns_name_t name, unsigned int n, dns_label_t label) {
}
void
dns_name_getlabelsequence(dns_name_t source,
dns_name_getlabelsequence(dns_name_t *source,
unsigned int first, unsigned int n,
dns_name_t target)
dns_name_t *target)
{
/*
* Make 'target' refer to the 'n' labels including and following
......@@ -473,7 +473,7 @@ dns_name_getlabelsequence(dns_name_t source,
}
void
dns_name_fromregion(dns_name_t name, isc_region_t r) {
dns_name_fromregion(dns_name_t *name, isc_region_t *r) {
/*
* Make 'name' refer to region 'r'.
*/
......@@ -492,7 +492,7 @@ dns_name_fromregion(dns_name_t name, isc_region_t r) {
}
void
dns_name_toregion(dns_name_t name, isc_region_t r) {
dns_name_toregion(dns_name_t *name, isc_region_t *r) {
/*
* Make 'r' refer to 'name'.
*/
......@@ -506,9 +506,9 @@ dns_name_toregion(dns_name_t name, isc_region_t r) {
dns_result_t
dns_name_fromtext(dns_name_t name, isc_region_t source,
dns_name_t origin, isc_boolean_t downcase,
isc_region_t target)
dns_name_fromtext(dns_name_t *name, isc_region_t *source,
dns_name_t *origin, isc_boolean_t downcase,
isc_region_t *target)
{
unsigned char *ndata, *label;
char *tdata;
......@@ -957,8 +957,8 @@ dns_name_fromtext(dns_name_t name, isc_region_t source,
}