#ifndef __JLIKE_FAKE_H__
#define __JLIKE_FAKE_H__


#if defined(__cplusplus)
#define EXTERN_C	extern "C"
EXTERN_C {
#else
#define EXTERN_C
#endif

#ifndef JLIKE_API
#define JLIKE_API
#endif

#define CA_APP_CTRL		0
#define CA_REMOCON_CTRL		1
#define CA_UI_CTRL		2
#define CA_SETUP_CTRL		3
#define CA_TUNER_CTRL		4
#define CA_DIVX_CTRL		5
#define CA_MUSIC_CTRL		6
#define CA_IMAGE_CTRL		7
#define CA_RADIO_CTRL_X		8
#define CA_CELRUNTV_CTRL	9
#define CA_FILE_CTRL		10
#define CA_RADIO_CTRL		11
#define CA_MEDIA_CTRL		12
#define CA_CDOWNLOAD_CTRL		13

#define JBUFFER_SIZE (8*1024)

#ifdef _LINUX
#define JLIKE_PACKED __attribute__((packed))
#else
#define JLIKE_PACKED
#endif

int ca_open(char *src);
int ca_open_key(char *src);
void ca_close(int sock);
int ca_read(int sock, void *buf, int size);
int ca_write(int sock, void *buf, int size);
int ca_peek(int sock, void *buf, int size); //Dummy
void ca_set_dest(char *dest); //New

#if defined(__cplusplus)
}
#endif

typedef struct {
	unsigned short L;
	unsigned short D;
	unsigned short S;
	unsigned char F;
	unsigned char P;
	int stamp;
	int section;
} JLIKE_PACKED jlike_packet_header_st;

typedef struct {
	jlike_packet_header_st header;
	char buf[JBUFFER_SIZE];
} JLIKE_PACKED jlike_packet_st;

#endif //__JLIKE_FAKE_H__
