3 * - adns multi-threaded API
6 * This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2, or (at your option)
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #ifndef ADNSMT_H_INCLUDED
26 #define ADNSMT_H_INCLUDED
30 typedef struct adns_mt__state *adns_mt_state;
31 typedef struct adns_mt__query *adns_mt_query;
33 int adns_mt_init(adns_mt_state *newstate_r, adns_initflags flags,
34 FILE *diagfile /*0=>stderr*/);
36 int adns_mt_init_strcfg(adns_mt_state *newstate_r, adns_initflags flags,
37 FILE *diagfile /*0=>discard*/, const char *configtext);
39 int adns_mt_synchronous(adns_mt_state adts,
42 adns_queryflags flags,
43 adns_answer **answer_r);
45 int adns_mt_submit(adns_mt_state adts,
48 adns_queryflags flags,
50 adns_mt_query *query_r);
52 int adns_mt_wait(adns_mt_state adts,
53 adns_mt_query *query_io,
54 adns_answer **answer_r,
57 void adns_mt_cancel(adns_mt_query query);
58 /* Do not cancel a query while another thread is waiting for it ! */
60 void adns_mt_finish(adns_mt_state);
61 /* You may call this even if you have queries outstanding;
62 * they will be cancelled. NB the comment about _mt_cancel above.