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);
48 void (*destroy)(struct fnetnode *fn);
49 int (*setnick)(struct fnetnode *fn, wchar_t *newnick);
50 int (*reqconn)(struct fnetpeer *peer);
51 int (*sendchat)(struct fnetnode *fn, int public, wchar_t *to, wchar_t *string);
52 int (*search)(struct fnetnode *fn, struct search *srch, struct srchfnnlist *ln);
53 wchar_t *(*filebasename)(wchar_t *filename);
58 struct fnetpeerdatum *next, *prev;
66 struct fnetpeerdatum *datum;
77 struct fnetpeer *next, *prev;
91 struct fnetpeerdi *peerdi;
96 struct fnetnode *next, *prev;
102 time_t srchwait, lastsrch;
103 wchar_t *name, *pubid;
108 struct fnetpeerdatum *peerdata;
109 struct fnetpeer *peers;
110 struct wcspair *args;
113 CBCHAIN(fnetnode_ac, struct fnetnode *fn, wchar_t *attrib);
114 CBCHAIN(fnetnode_chat, struct fnetnode *fn, int public, wchar_t *name, wchar_t *peer, wchar_t *string);
115 CBCHAIN(fnetnode_unlink, struct fnetnode *fn);
116 CBCHAIN(fnetnode_destroy, struct fnetnode *fn);
117 CBCHAIN(fnetpeer_new, struct fnetnode *fn, struct fnetpeer *peer);
118 CBCHAIN(fnetpeer_del, struct fnetnode *fn, struct fnetpeer *peer);
119 CBCHAIN(fnetpeer_chdi, struct fnetnode *fn, struct fnetpeer *peer, struct fnetpeerdi *di);
122 void regfnet(struct fnet *fnet);
123 void fnetsetname(struct fnetnode *fn, wchar_t *newname);
124 void fnetsetstate(struct fnetnode *fn, int newstate);
125 int fnetsetnick(struct fnetnode *fn, wchar_t *newnick);
126 struct fnet *findfnet(wchar_t *name);
127 struct fnetnode *fnetinitconnect(wchar_t *name, wchar_t *owner, char *addr, struct wcspair *args);
128 void linkfnetnode(struct fnetnode *fn);
129 void unlinkfnetnode(struct fnetnode *fn);
130 void getfnetnode(struct fnetnode *fn);
131 void putfnetnode(struct fnetnode *fn);
132 void killfnetnode(struct fnetnode *fn);
133 struct fnetpeer *fnetaddpeer(struct fnetnode *fn, wchar_t *id, wchar_t *nick);
134 void fnetdelpeer(struct fnetpeer *peer);
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);
145 extern struct fnetnode *fnetnodes;
146 EGCBCHAIN(newfncb, struct fnetnode *);