1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 3.2//EN">
4 <TITLE> AW: [IRCServices] nick.db version
8 format (Addendum)
6 <LINK REL=
"Index" HREF=
"index.html" >
7 <LINK REL=
"made" HREF=
"mailto:ircservices%40ircservices.za.net?Subject=AW%3A%20%5BIRCServices%5D%20nick.db%20version%208%20format%20%28Addendum%29&In-Reply-To=EMEAJDMIHJFMOHONHAEDGEDECCAA.Georges%40Berscheid.lu">
8 <META NAME=
"robots" CONTENT=
"index,nofollow">
9 <META http-equiv=
"Content-Type" content=
"text/html; charset=us-ascii">
10 <LINK REL=
"Previous" HREF=
"001875.html">
11 <LINK REL=
"Next" HREF=
"001877.html">
13 <BODY BGCOLOR=
"#ffffff">
14 <H1>AW: [IRCServices] nick.db version
8 format (Addendum)
</H1>
15 <B>Johan Yves August Grasmo
</B>
16 <A HREF=
"mailto:ircservices%40ircservices.za.net?Subject=AW%3A%20%5BIRCServices%5D%20nick.db%20version%208%20format%20%28Addendum%29&In-Reply-To=EMEAJDMIHJFMOHONHAEDGEDECCAA.Georges%40Berscheid.lu"
17 TITLE=
"AW: [IRCServices] nick.db version 8 format (Addendum)">johanyg at ifi.uio.no
19 <I>Wed May
16 20:
59:
01 PDT
2001</I>
21 <LI>Previous message:
<A HREF=
"001875.html">AW: [IRCServices] nick.db version
8 format (Addendum)
23 <LI>Next message:
<A HREF=
"001877.html">AW: AW: [IRCServices] nick.db version
8 format (Addendum)
25 <LI> <B>Messages sorted by:
</B>
26 <a href=
"date.html#1876">[ date ]
</a>
27 <a href=
"thread.html#1876">[ thread ]
</a>
28 <a href=
"subject.html#1876">[ subject ]
</a>
29 <a href=
"author.html#1876">[ author ]
</a>
34 <PRE>On Wed,
16 May
2001 20:
54:
28 +
0200 Georges Berscheid
<Georges Berscheid
<<A HREF=
"http://www.ircservices.za.net/mailman/listinfo/ircservices">Georges at berscheid.lu
</A>>> wrote:
38 ><i> if you want to link services to your mysql db, use the C API which is
39 </I>><i> documented at
<A HREF=
"http://www.mysql.com/doc/C/_/C_API_function_overview.html">http://www.mysql.com/doc/C/_/C_API_function_overview.html
</A>
41 Thank you very much Georges.
43 My main problem wasn't that I couldn't fetch the information
44 from the mysql-db, but I didn't seem to construct the
46 Below is a snippet of my code in load_ns_dbase in nickserv.c
48 Sorry for spamming like this, but I'm on the brink of giving
56 while ((row = mysql_fetch_row(res))) {
58 ni = scalloc( sizeof *ni,
1 );
61 strcpy(ni-
>nick,row[
1]);
62 strcpy(ni-
>pass,row[
0]);
63 ni-
>email = sstrdup(row[
2]);
65 log(
"debug: Loading user from mysql : %s %s %s
",
71 ni-
>accesscount =
0;
74 ni-
>time_registered =
0;
77 ni-
>status
&= ~NS_TEMPORARY;
79 if (!ni-
>last_usermask)
80 ni-
>last_usermask = sstrdup(
"@
");
81 if (!ni-
>last_realname)
82 ni-
>last_realname = sstrdup(
"");
83 ni-
>id_timestamp =
999936289;
85 log(
"debug: Loaded users from database, found %d nicks
", i);
89 /* Adjust next/prev pointers for all records.
90 Remember: i points past the last element */
91 nicklists[
0 ]-
>prev = NULL;
92 for ( j =
0; j
< i; ++j ) {
94 nicklists[ j ]-
>prev = nicklists[ j-
1 ];
95 nicklists[ j-
1 ]-
>next = nicklists[ j ];
98 nicklists[ i-
1 ]-
>next = NULL;
100 /* ... and insert sentinel */
101 nicklists[ i ] = NULL;
114 <LI>Previous message:
<A HREF=
"001875.html">AW: [IRCServices] nick.db version
8 format (Addendum)
116 <LI>Next message:
<A HREF=
"001877.html">AW: AW: [IRCServices] nick.db version
8 format (Addendum)
118 <LI> <B>Messages sorted by:
</B>
119 <a href=
"date.html#1876">[ date ]
</a>
120 <a href=
"thread.html#1876">[ thread ]
</a>
121 <a href=
"subject.html#1876">[ subject ]
</a>
122 <a href=
"author.html#1876">[ author ]
</a>