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;
107 struct fnetpeerdatum *peerdata;
108 struct fnetpeer *peers;
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, 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 struct fnetpeer *fnetfindpeer(struct fnetnode *fn, wchar_t *id);
135 void fnetpeersetstr(struct fnetpeer *peer, wchar_t *id, wchar_t *value);
136 void fnetpeersetnum(struct fnetpeer *peer, wchar_t *id, int value);
137 void fnetpeersetlnum(struct fnetpeer *peer, wchar_t *id, long long value);
138 void fnetpeerunset(struct fnetpeer *peer, wchar_t *id);
139 struct fnetnode *findfnetnode(int id);
140 void fnethandlechat(struct fnetnode *fn, int public, wchar_t *name, wchar_t *peer, wchar_t *chat);
141 int fnetsendchat(struct fnetnode *fn, int public, wchar_t *to, wchar_t *string);
142 int fnetsearch(struct fnetnode *fn, struct search *srch, struct srchfnnlist *ln);
144 extern struct fnetnode *fnetnodes;
145 EGCBCHAIN(newfncb, struct fnetnode *);