1
0
mirror of https://github.com/irssi/irssi.git synced 2025-01-03 14:56:47 -05:00
irssi/src/core/net-nonblock.h
Timo Sirainen 76605ad0ae Added bot plugin, it also has almost-functional botnet.
Changed configure.in's functionality so that you could tell what modules you
want to build in main irssi binary and it will create automatically the .c
files that need to call the module_init()/deinit() functions.

Fixed several minor things..


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@230 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-05-25 11:30:47 +00:00

39 lines
1.2 KiB
C

#ifndef __NET_NONBLOCK_H
#define __NET_NONBLOCK_H
#include "network.h"
typedef struct {
IPADDR ip; /* resolved ip addres */
int error; /* error, 0 = no error, -1 = error: */
int errlen; /* error text length */
char *errorstr; /* error string - dynamically allocated, you'll
need to free() it yourself unless it's NULL */
} RESOLVED_IP_REC;
typedef struct {
int namelen;
char *name;
int error;
int errlen;
char *errorstr;
} RESOLVED_NAME_REC;
typedef void (*NET_CALLBACK) (int, void *);
typedef void (*NET_HOST_CALLBACK) (RESOLVED_NAME_REC *, void *);
/* nonblocking gethostbyname(), PID of the resolver child is returned. */
int net_gethostbyname_nonblock(const char *addr, int pipe);
/* Get host's name, call func when finished */
int net_gethostbyaddr_nonblock(IPADDR *ip, NET_HOST_CALLBACK func, void *data);
/* get the resolved IP address. returns -1 if some error occured with read() */
int net_gethostbyname_return(int pipe, RESOLVED_IP_REC *rec);
/* Connect to server, call func when finished */
int net_connect_nonblock(const char *server, int port, const IPADDR *my_ip, NET_CALLBACK func, void *data);
/* Kill the resolver child */
void net_disconnect_nonblock(int pid);
#endif