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);
58 struct fnetpeerdatum *next, *prev;
66 struct fnetpeerdatum *datum;
90 struct fnetpeerdi *peerdi;
95 struct fnetnode *next, *prev;
102 time_t srchwait, lastsrch;
103 wchar_t *name, *pubid;
107 struct fnetpeerdatum *peerdata;
109 struct wcspair *args;
112 CBCHAIN(fnetnode_ac, struct fnetnode *fn, wchar_t *attrib);
113 CBCHAIN(fnetnode_chat, struct fnetnode *fn, int public, wchar_t *name, wchar_t *peer, wchar_t *string);
114 CBCHAIN(fnetnode_unlink, struct fnetnode *fn);
115 CBCHAIN(fnetnode_destroy, struct fnetnode *fn);
116 CBCHAIN(fnetpeer_new, struct fnetnode *fn, struct fnetpeer *peer);
117 CBCHAIN(fnetpeer_del, struct fnetnode *fn, struct fnetpeer *peer);
118 CBCHAIN(fnetpeer_chdi, struct fnetnode *fn, struct fnetpeer *peer, struct fnetpeerdi *di);
121 void regfnet(struct fnet *fnet);
122 void fnetsetname(struct fnetnode *fn, wchar_t *newname);
123 void fnetsetstate(struct fnetnode *fn, int newstate);
124 int fnetsetnick(struct fnetnode *fn, wchar_t *newnick);
125 struct fnet *findfnet(wchar_t *name);
126 struct fnetnode *fnetinitconnect(wchar_t *name, wchar_t *owner, char *addr, struct wcspair *args);
127 void linkfnetnode(struct fnetnode *fn);
128 void unlinkfnetnode(struct fnetnode *fn);
129 void getfnetnode(struct fnetnode *fn);
130 void putfnetnode(struct fnetnode *fn);
131 void killfnetnode(struct fnetnode *fn);
132 struct fnetpeer *fnetaddpeer(struct fnetnode *fn, wchar_t *id, wchar_t *nick);
133 void fnetdelpeer(struct fnetpeer *peer);
134 void fnetpeerdm(struct fnetnode *fn);
135 struct fnetpeer *fnetfindpeer(struct fnetnode *fn, wchar_t *id);
136 void fnetpeersetstr(struct fnetpeer *peer, wchar_t *id, wchar_t *value);
137 void fnetpeersetnum(struct fnetpeer *peer, wchar_t *id, int value);
138 void fnetpeersetlnum(struct fnetpeer *peer, wchar_t *id, long long value);
139 void fnetpeerunset(struct fnetpeer *peer, wchar_t *id);
140 struct fnetnode *findfnetnode(int id);
141 void fnethandlechat(struct fnetnode *fn, int public, wchar_t *name, wchar_t *peer, wchar_t *chat);
142 int fnetsendchat(struct fnetnode *fn, int public, wchar_t *to, wchar_t *string);
143 int fnetsearch(struct fnetnode *fn, struct search *srch, struct srchfnnlist *ln);
144 wchar_t *fnfilebasename(wchar_t *path);
146 extern struct fnetnode *fnetnodes;
147 EGCBCHAIN(newfncb, struct fnetnode *);