1 /*
2 napster code base by Drago (drago@0x00.org)
3 released: 11-30-99
4 */
5 
6 #include "napi.h"
7 
motdhook(char * s)8 void motdhook(char *s) {
9 	printf("MOTD: %s\n", s);
10 }
11 
statshook(_N_STATS * s)12 void statshook(_N_STATS *s) {
13 	printf("Stats: Libraries==%d Songs==%d Gigs==%d\n", s->libraries, s->songs, s->gigs);
14 }
15 
main(void)16 int main(void) {
17 	_N_SERVER *s;
18 	_N_AUTH a={"dragotest", "nap"};
19 	n_SetMotdHook(motdhook);
20 	n_SetStatsHook(statshook);
21 	s=n_GetServer();
22 	if (!n_Connect(s, &a)) {
23 		printf("Error connecting\n");
24 		return 1;
25 	}
26 	while(1) n_Loop();
27 }
28