2 * Dolda Connect - Modular multiuser Direct Connect-style client
3 * Copyright (C) 2004 Fredrik Tolf <fredrik@dolda2000.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
47 void (*connect)(struct fnetnode *fn, struct socket *sk);
48 void (*destroy)(struct fnetnode *fn);
49 void (*kill)(struct fnetnode *fn);
50 int (*setnick)(struct fnetnode *fn, wchar_t *newnick);
51 int (*reqconn)(struct fnetpeer *peer);
52 int (*sendchat)(struct fnetnode *fn, int public, wchar_t *to, wchar_t *string);
53 int (*search)(struct fnetnode *fn, struct search *srch, struct srchfnnlist *ln);
54 wchar_t *(*filebasename)(wchar_t *filename);
59 struct fnetpeerdatum *next, *prev;
67 struct fnetpeerdatum *datum;
78 struct fnetpeer *next, *prev;
92 struct fnetpeerdi *peerdi;
97 struct fnetnode *next, *prev;
104 time_t srchwait, lastsrch;
105 wchar_t *name, *pubid;
109 struct fnetpeerdatum *peerdata;
110 struct fnetpeer *peers;
111 struct wcspair *args;
114 CBCHAIN(fnetnode_ac, struct fnetnode *fn, wchar_t *attrib);
115 CBCHAIN(fnetnode_chat, struct fnetnode *fn, int public, wchar_t *name, wchar_t *peer, wchar_t *string);
116 CBCHAIN(fnetnode_unlink, struct fnetnode *fn);
117 CBCHAIN(fnetnode_destroy, struct fnetnode *fn);
118 CBCHAIN(fnetpeer_new, struct fnetnode *fn, struct fnetpeer *peer);
119 CBCHAIN(fnetpeer_del, struct fnetnode *fn, struct fnetpeer *peer);
120 CBCHAIN(fnetpeer_chdi, struct fnetnode *fn, struct fnetpeer *peer, struct fnetpeerdi *di);
123 void regfnet(struct fnet *fnet);
124 void fnetsetname(struct fnetnode *fn, wchar_t *newname);
125 void fnetsetstate(struct fnetnode *fn, int newstate);
126 int fnetsetnick(struct fnetnode *fn, wchar_t *newnick);
127 struct fnet *findfnet(wchar_t *name);
128 struct fnetnode *fnetinitconnect(wchar_t *name, wchar_t *owner, char *addr, struct wcspair *args);
129 void linkfnetnode(struct fnetnode *fn);
130 void unlinkfnetnode(struct fnetnode *fn);
131 void getfnetnode(struct fnetnode *fn);
132 void putfnetnode(struct fnetnode *fn);
133 void killfnetnode(struct fnetnode *fn);
134 struct fnetpeer *fnetaddpeer(struct fnetnode *fn, wchar_t *id, wchar_t *nick);
135 void fnetdelpeer(struct fnetpeer *peer);
136 struct fnetpeer *fnetfindpeer(struct fnetnode *fn, wchar_t *id);
137 void fnetpeersetstr(struct fnetpeer *peer, wchar_t *id, wchar_t *value);
138 void fnetpeersetnum(struct fnetpeer *peer, wchar_t *id, int value);
139 void fnetpeersetlnum(struct fnetpeer *peer, wchar_t *id, long long value);
140 void fnetpeerunset(struct fnetpeer *peer, wchar_t *id);
141 struct fnetnode *findfnetnode(int id);
142 void fnethandlechat(struct fnetnode *fn, int public, wchar_t *name, wchar_t *peer, wchar_t *chat);
143 int fnetsendchat(struct fnetnode *fn, int public, wchar_t *to, wchar_t *string);
144 int fnetsearch(struct fnetnode *fn, struct search *srch, struct srchfnnlist *ln);
146 extern struct fnetnode *fnetnodes;
147 EGCBCHAIN(newfncb, struct fnetnode *);