/*
** Napser Protocol Header
*/

#include <sys/types.h>

#ifndef AMSTER_NAPSTER_H
#define AMSTER_NAPSTER_H

extern u_long nap_sigmask;
extern char *nap_buf;
extern char *nap_linktype[];

typedef struct song_struct {
	char *title;
	char *md5;
	u_long size;
	int bit, freq, time;
	char *user;
	u_long ip;
	int link;
} *song, _song;

#define NAPC_LOGINERROR 0
#define NAPC_LOGIN 2
#define NAPC_LOGINRESP 3
#define NAPC_LOGINALT 6
#define NAPC_CREATEUSER 7
#define NAPC_REGSUCCESS 8
#define NAPC_REGUSED 9
#define NAPC_NICKINVALID 10
#define NAPC_NOTIFYSHARE 100
#define NAPC_REMOVESHARE 102
#define NAPC_SEARCH 200
#define NAPC_SEARCHRESULT 201
#define NAPC_SEARCHCOMPLETE 202
#define NAPC_FILEINFOREQ 203
#define NAPC_FILEINFO 204
#define NAPC_PRIVATEMSG 205
#define NAPC_GETERROR 206
#define NAPC_BROWSEUSER 211
#define NAPC_BROWSERESULT 212
#define NAPC_BROWSECOMPLETE 213
#define NAPC_FILECOUNT 214
#define NAPC_DLINC 218
#define NAPC_DLCOMPLETE 219
#define NAPC_ULINC 220
#define NAPC_ULCOMPLETE 221
#define NAPC_CHANNELJOIN 400
#define NAPC_CHANNELPART 401
#define NAPC_PUBLICMSGSEND 402
#define NAPC_PUBLICMSGRECV 403
#define NAPC_GENERALERROR 404
#define NAPC_JOINACK 405
#define NAPC_JOINMSG 406
#define NAPC_USERPART 407
#define NAPC_USERLIST 408
#define NAPC_USERLISTEND 409
#define NAPC_CHANNELTOPIC 410
#define NAPC_ALTDLREQ 500
#define NAPC_ALTDLACK 501
#define NAPC_WHOIS 603
#define NAPC_WHOISRESP 604
#define NAPC_WHOWASRESP 605
#define NAPC_UPLOADREQ 607
#define NAPC_UPLOADACCEPT 608
#define NAPC_LOCALQUEUEFULL 619
#define NAPC_REMOTEQUEUEFULL 620
#define NAPC_SYSMSG 621
#define NAPC_GLOBALMSG 628
#define NAPC_EMAILCHANGE 702

extern void nap_login_fromlist(char *server);
extern void nap_login(void);
extern void nap_logout(void);
extern void nap_listen(void);
extern void nap_send(u_int com);
extern int nap_sendbuf(u_int com, char *buf);
extern void nap_songfree(song s);
extern song nap_songdup(song s);

extern char *nap_strippath(char *name);
extern char *nap_token(char **str);
extern int nap_itoken(char **str);
extern u_long nap_ltoken(char **str);



#endif	/* AMSTER_NAPSTER_H */
