common.h 1.17 KB
#ifndef __BB_SYSAPP_COMMON_H_
#define __BB_SYSAPP_COMMON_H_

#include <PR/R4300.h>
#include <PR/bbtypes.h>

#define KEYLIST_SIZE       16384
#define CERTBUF_SIZE       16384
#define CRLBUF_SIZE        16384

#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif

#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)

#define ALIGN_DCACHE __attribute__((aligned(DCACHE_LINESIZE)))

/*
 *  Globals with hard-coded parameters (params in globals.c)
 */
extern const char gSaCertFname[];
extern const char gSaRlFname[];
extern const char gSaAppExt[];
extern const char gSaRecExt[];
extern const char gSaTicketFname[];
extern const char gSaRecryptKeyFname[];
extern const char gSaClubTitle[];

/* extra stdlib funcs  */
int strcmp(const char *s,const char *t);
void *memset(char *s,int c,size_t n);
int memcmp(const void *s1, const void *s2, size_t n);
int strncmp(const char *s,const char *t,int n);

#define NIBBLE_TO_ASCII(v) ((v)<10?('0'+(v)):('a'+(v)-10))
void osBbSaCidToAppName(BbContentId cid, const char *ext, char *name);

#undef PRINTF

#ifdef _DEBUG
#define PRINTF          osSyncPrintf
#else
#define	PRINTF(format, args...)
#endif

#endif

#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif

#endif