/*
** Napser Protocol Header
*/

#ifndef INCL_NAPSTER_H
#define INCL_NAPSTER_H

#define NAP_SWAPIP(x) ( ((x&0xFF)<<24) | ((x&0xFF00)<<8) | ((x&0xFF0000)>>8) | (x>>24) )

extern unsigned long nap_sigmask;
extern const char *nap_linktype[];

#define NAP_ERROR 0
#define NAP_LOGIN 2
#define NAP_LOGINRESP 3
#define NAP_CREATEUSER 7
#define NAP_SEARCH 200
#define NAP_SEARCHRESULT 201
#define NAP_SEARCHCOMPLETE 202
#define NAP_FILEINFOREQ 203
#define NAP_FILEINFO 204
#define NAP_PRIVATEMSG 205
#define NAP_FILECOUNT 214
#define NAP_REMOTEQUEUEFULL 620
#define NAP_SYSMSG 621

typedef struct songdata_struct {
	char title[256];
	char chksum[40];
	unsigned long size;
	int bitrate,freq,time;
	char user[20];
	int link;
} *songdata, _songdata;


int nap_login(void);
void nap_logout(void);
int nap_listen(void);
void nap_search(char *keys, int max);
void nap_request(songdata sd);
void nap_msg(char *nick, char *msg);
char *nap_getlinktype(int link);


#endif /* INCL_NAPSTER_H */
