Skip to content

Commit

Permalink
refactor: use extern for forward decls in headers
Browse files Browse the repository at this point in the history
  • Loading branch information
uyjulian committed Dec 6, 2024
1 parent 42ca0ba commit 0b3c5f6
Show file tree
Hide file tree
Showing 220 changed files with 2,860 additions and 2,858 deletions.
188 changes: 94 additions & 94 deletions common/include/libcdvd-common.h

Large diffs are not rendered by default.

62 changes: 31 additions & 31 deletions common/include/libsd-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,47 +152,47 @@ typedef int (*SdIntrCallback)(void *data);
extern "C" {
#endif

int sceSdQuit();
int sceSdInit(int flag);
SdIntrCallback sceSdSetIRQCallback(SdIntrCallback cb);
SdIntrCallback sceSdSetTransCallback(s32 core, SdIntrCallback cb);
extern int sceSdQuit();
extern int sceSdInit(int flag);
extern SdIntrCallback sceSdSetIRQCallback(SdIntrCallback cb);
extern SdIntrCallback sceSdSetTransCallback(s32 core, SdIntrCallback cb);

void sceSdSetParam(u16 entry, u16 value);
u16 sceSdGetParam(u16 entry);
extern void sceSdSetParam(u16 entry, u16 value);
extern u16 sceSdGetParam(u16 entry);

void sceSdSetCoreAttr(u16 entry, u16 value);
u16 sceSdGetCoreAttr(u16 entry);
int sceSdClearEffectWorkArea(int core, int channel, int effect_mode);
extern void sceSdSetCoreAttr(u16 entry, u16 value);
extern u16 sceSdGetCoreAttr(u16 entry);
extern int sceSdClearEffectWorkArea(int core, int channel, int effect_mode);

void sceSdSetAddr(u16 entry, u32 value);
u32 sceSdGetAddr(u16 entry);
extern void sceSdSetAddr(u16 entry, u32 value);
extern u32 sceSdGetAddr(u16 entry);

void sceSdSetSwitch(u16 entry, u32 value);
u32 sceSdGetSwitch(u16 entry);
extern void sceSdSetSwitch(u16 entry, u32 value);
extern u32 sceSdGetSwitch(u16 entry);

u16 sceSdNote2Pitch(u16 center_note, u16 center_fine, u16 note, s16 fine);
u16 sceSdPitch2Note(u16 center_note, u16 center_fine, u16 pitch);
extern u16 sceSdNote2Pitch(u16 center_note, u16 center_fine, u16 note, s16 fine);
extern u16 sceSdPitch2Note(u16 center_note, u16 center_fine, u16 pitch);

int sceSdSetEffectAttr(int core, sceSdEffectAttr *attr);
void sceSdGetEffectAttr(int core, sceSdEffectAttr *attr);
extern int sceSdSetEffectAttr(int core, sceSdEffectAttr *attr);
extern void sceSdGetEffectAttr(int core, sceSdEffectAttr *attr);

int sceSdProcBatch(sceSdBatch *batch, u32 *rets, u32 num);
int sceSdProcBatchEx(sceSdBatch *batch, u32 *rets, u32 num, u32 voice);
extern int sceSdProcBatch(sceSdBatch *batch, u32 *rets, u32 num);
extern int sceSdProcBatchEx(sceSdBatch *batch, u32 *rets, u32 num, u32 voice);

int sceSdVoiceTrans(s16 chan, u16 mode, u8 *iopaddr, u32 *spuaddr, u32 size);
int sceSdBlockTrans(s16 chan, u16 mode, u8 *iopaddr, u32 size, ...);
u32 sceSdVoiceTransStatus(s16 channel, s16 flag);
u32 sceSdBlockTransStatus(s16 channel, s16 flag);
extern int sceSdVoiceTrans(s16 chan, u16 mode, u8 *iopaddr, u32 *spuaddr, u32 size);
extern int sceSdBlockTrans(s16 chan, u16 mode, u8 *iopaddr, u32 size, ...);
extern u32 sceSdVoiceTransStatus(s16 channel, s16 flag);
extern u32 sceSdBlockTransStatus(s16 channel, s16 flag);

sceSdTransIntrHandler sceSdSetTransIntrHandler(int channel, sceSdTransIntrHandler func, void *arg);
sceSdSpu2IntrHandler sceSdSetSpu2IntrHandler(sceSdSpu2IntrHandler func, void *arg);
extern sceSdTransIntrHandler sceSdSetTransIntrHandler(int channel, sceSdTransIntrHandler func, void *arg);
extern sceSdSpu2IntrHandler sceSdSetSpu2IntrHandler(sceSdSpu2IntrHandler func, void *arg);

void *sceSdGetTransIntrHandlerArgument(int arg);
void *sceSdGetSpu2IntrHandlerArgument();
int sceSdStopTrans(int channel);
int sceSdCleanEffectWorkArea(int core, int channel, int effect_mode);
int sceSdSetEffectMode(int core, sceSdEffectAttr *param);
int sceSdSetEffectModeParams(int core, sceSdEffectAttr *attr);
extern void *sceSdGetTransIntrHandlerArgument(int arg);
extern void *sceSdGetSpu2IntrHandlerArgument();
extern int sceSdStopTrans(int channel);
extern int sceSdCleanEffectWorkArea(int core, int channel, int effect_mode);
extern int sceSdSetEffectMode(int core, sceSdEffectAttr *param);
extern int sceSdSetEffectModeParams(int core, sceSdEffectAttr *attr);

#ifdef __cplusplus
}
Expand Down
40 changes: 20 additions & 20 deletions common/include/netman.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,37 +105,37 @@ enum NETMAN_NETIF_IOCTL_CODES {
// Initialization and deinitialization functions, for the EE side.
#ifdef _EE

int NetManInit(void);
void NetManDeinit(void);
extern int NetManInit(void);
extern void NetManDeinit(void);

#endif

// Network Interface (IF) control.
int NetManGetGlobalNetIFLinkState(void);
int NetManSetMainIF(const char *name);
int NetManQueryMainIF(char *name);
extern int NetManGetGlobalNetIFLinkState(void);
extern int NetManSetMainIF(const char *name);
extern int NetManQueryMainIF(char *name);

//*** System functions for either the Network IF driver or the network protocol stack ***
// For the network protocol stack to initialize/deinitialize NETMAN.
int NetManRegisterNetworkStack(const struct NetManNetProtStack *stack);
void NetManUnregisterNetworkStack(void);
extern int NetManRegisterNetworkStack(const struct NetManNetProtStack *stack);
extern void NetManUnregisterNetworkStack(void);

/* Common network Interface (IF) management functions. Used by the user program and the protocol stack. */
int NetManIoctl(unsigned int command, void *args, unsigned int args_len, void *output, unsigned int length);
int NetManSetLinkMode(int mode);
extern int NetManIoctl(unsigned int command, void *args, unsigned int args_len, void *output, unsigned int length);
extern int NetManSetLinkMode(int mode);

/* Network Interface (IF) management functions. Used by the protocol stack. */
void NetManNetIFXmit(void); // Notify the interface of available packets. May be called from the interrupt context.
extern void NetManNetIFXmit(void); // Notify the interface of available packets. May be called from the interrupt context.

/* Network protocol stack management functions. Used by the Network InterFace (IF) driver. */
void *NetManNetProtStackAllocRxPacket(unsigned int length, void **payload);
void NetManNetProtStackFreeRxPacket(void *packet);
void NetManNetProtStackEnQRxPacket(void *packet);
int NetManTxPacketNext(void **payload);
void NetManTxPacketDeQ(void);
extern void *NetManNetProtStackAllocRxPacket(unsigned int length, void **payload);
extern void NetManNetProtStackFreeRxPacket(void *packet);
extern void NetManNetProtStackEnQRxPacket(void *packet);
extern int NetManTxPacketNext(void **payload);
extern void NetManTxPacketDeQ(void);

int NetManTxPacketAfter(void **payload); // For EE only, for NETMAN's internal use.
void NetManNetProtStackReallocRxPacket(void *packet, unsigned int length); // For EE only, for NETMAN's internal use.
extern int NetManTxPacketAfter(void **payload); // For EE only, for NETMAN's internal use.
extern void NetManNetProtStackReallocRxPacket(void *packet, unsigned int length); // For EE only, for NETMAN's internal use.

/* NETIF flags. */
/** Set internally by NETMAN. Do not set externally. */
Expand Down Expand Up @@ -167,9 +167,9 @@ struct NetManNetIF
#define NETMAN_MAX_NETIF_COUNT 2

/* Network InterFace (IF) management functions. Used by the network InterFace (IF). */
int NetManRegisterNetIF(struct NetManNetIF *NetIF);
void NetManUnregisterNetIF(const char *name);
void NetManToggleNetIFLinkState(int NetIFID, unsigned char state); // Also toggles NETMAN_NETIF_EVF_UP and NETMAN_NETIF_EVF_DOWN
extern int NetManRegisterNetIF(struct NetManNetIF *NetIF);
extern void NetManUnregisterNetIF(const char *name);
extern void NetManToggleNetIFLinkState(int NetIFID, unsigned char state); // Also toggles NETMAN_NETIF_EVF_UP and NETMAN_NETIF_EVF_DOWN

#ifdef _IOP

Expand Down
20 changes: 10 additions & 10 deletions common/include/ps2snd.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,18 @@ extern "C" {
#endif

#ifdef _EE
int sndLoadSample(void *buf, u32 spuaddr, int size);
u32 sndQueryMaxFreeMemSize(void);
extern int sndLoadSample(void *buf, u32 spuaddr, int size);
extern u32 sndQueryMaxFreeMemSize(void);
#endif

int sndStreamOpen(char *file, u32 voices, u32 flags, u32 bufaddr, u32 bufsize);
int sndStreamClose(void);
int sndStreamPlay(void);
int sndStreamPause(void);
int sndStreamSetPosition(int block);
int sndStreamGetPosition(void);
int sndStreamSetVolume(int left, int right);
u32 sndQueryMaxFreeMemSize();
extern int sndStreamOpen(char *file, u32 voices, u32 flags, u32 bufaddr, u32 bufsize);
extern int sndStreamClose(void);
extern int sndStreamPlay(void);
extern int sndStreamPause(void);
extern int sndStreamSetPosition(int block);
extern int sndStreamGetPosition(void);
extern int sndStreamSetVolume(int left, int right);
extern u32 sndQueryMaxFreeMemSize();

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion common/include/sys/random.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
extern "C" {
#endif

ssize_t getrandom (void *buf, size_t buflen, unsigned int flags);
extern ssize_t getrandom (void *buf, size_t buflen, unsigned int flags);

#ifdef __cplusplus
}
Expand Down
32 changes: 16 additions & 16 deletions common/sbus/include/ps2_sbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,26 @@ typedef struct st_SIF2_CmdHandler
} SIF2_CmdHandler;

// SBUS
int SBUS_init(void);
int SBUS_deinit(void);
void *SBUS_set_irq_handler(int irq, SBUS_IrqHandlerFunc func, void *param);
int SBUS_rem_irq_handler(int irq);
u32 SBUS_get_reg(int reg_no);
void SBUS_set_reg(int reg_no, u32 val);
int SBUS_interrupt_remote(int irq);
extern int SBUS_init(void);
extern int SBUS_deinit(void);
extern void *SBUS_set_irq_handler(int irq, SBUS_IrqHandlerFunc func, void *param);
extern int SBUS_rem_irq_handler(int irq);
extern u32 SBUS_get_reg(int reg_no);
extern void SBUS_set_reg(int reg_no, u32 val);
extern int SBUS_interrupt_remote(int irq);

// SIF2
int SIF2_init(void);
int SIF2_deinit(void);
int SIF2_set_dma(u32 addr, u32 size, u32 attr);
void SIF2_sync_dma(void);
extern int SIF2_init(void);
extern int SIF2_deinit(void);
extern int SIF2_set_dma(u32 addr, u32 size, u32 attr);
extern void SIF2_sync_dma(void);

// SIF2 Command
int SIF2_init_cmd(void);
int SIF2_set_cmd_handler(int cid, SIF2_CmdHandlerFunc func, void *param);
int SIF2_rem_cmd_handler(int cid);
void SIF2_send_cmd(u32 cid, void *extra, int extra_size);
void SBUS_check_intr(void);
extern int SIF2_init_cmd(void);
extern int SIF2_set_cmd_handler(int cid, SIF2_CmdHandlerFunc func, void *param);
extern int SIF2_rem_cmd_handler(int cid);
extern void SIF2_send_cmd(u32 cid, void *extra, int extra_size);
extern void SBUS_check_intr(void);

// SBUS
#define I_SBUS_init DECLARE_IMPORT(4, SBUS_init)
Expand Down
32 changes: 16 additions & 16 deletions ee/debug/include/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@
extern "C" {
#endif

void init_scr(void);
void scr_printf(const char *, ...) __attribute__((format(printf,1,2)));
void scr_vprintf(const char *format, va_list opt);
void scr_putchar(int x, int y, u32 color, int ch);
void ps2GetStackTrace(unsigned int* results,int max);
void scr_setXY(int x, int y);
int scr_getX(void);
int scr_getY(void);
void scr_clear(void);
void scr_clearline(int Y);
void scr_clearchar(int X, int Y);
void scr_setbgcolor(u32 color);
void scr_setfontcolor(u32 color);
void scr_setcursorcolor(u32 color);
void scr_setCursor(int enable);
int scr_getCursor(void);
extern void init_scr(void);
extern void scr_printf(const char *, ...) __attribute__((format(printf,1,2)));
extern void scr_vprintf(const char *format, va_list opt);
extern void scr_putchar(int x, int y, u32 color, int ch);
extern void ps2GetStackTrace(unsigned int* results,int max);
extern void scr_setXY(int x, int y);
extern int scr_getX(void);
extern int scr_getY(void);
extern void scr_clear(void);
extern void scr_clearline(int Y);
extern void scr_clearchar(int X, int Y);
extern void scr_setbgcolor(u32 color);
extern void scr_setfontcolor(u32 color);
extern void scr_setcursorcolor(u32 color);
extern void scr_setCursor(int enable);
extern int scr_getCursor(void);
#ifdef __cplusplus
}
#endif
Expand Down
36 changes: 18 additions & 18 deletions ee/debug/include/hwbp.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,46 +65,46 @@ extern "C" {
#endif

/** Initialise the Breakpoint controller */
void InitBPC(void);
extern void InitBPC(void);
/** Set an instruction BP */
void SetInstructionBP(u32 addr, u32 mask, u32 options);
extern void SetInstructionBP(u32 addr, u32 mask, u32 options);
/** Set a data address BP *
* Options is one or more of the BPC settings for data address
* Note you must set BPC_DRE and/or BPC_DWE in the options
*/
void SetDataAddrBP(u32 addr, u32 mask, u32 options);
extern void SetDataAddrBP(u32 addr, u32 mask, u32 options);
/** Set a data value BP */
void SetDataValueBP(u32 addr, u32 mask, u32 value, u32 vmask, u32 options);
extern void SetDataValueBP(u32 addr, u32 mask, u32 value, u32 vmask, u32 options);

/** Get the BPC register */
u32 GetBPC(void);
extern u32 GetBPC(void);
/** Set the BPC register */
void SetBPC(u32 bpc);
extern void SetBPC(u32 bpc);

/** Get the instruction address register */
u32 GetIAB(void);
extern u32 GetIAB(void);
/** Set the instruction address register */
void SetIAB(u32 val);
extern void SetIAB(u32 val);
/** Get the instruction address mask register */
u32 GetIABM(void);
extern u32 GetIABM(void);
/** Set the instruction address mask register */
void SetIABM(u32 val);
extern void SetIABM(u32 val);
/** Get the data address register */
u32 GetDAB(void);
extern u32 GetDAB(void);
/** Set the data address register */
void SetDAB(u32 val);
extern void SetDAB(u32 val);
/** Get the data address register */
u32 GetDABM(void);
extern u32 GetDABM(void);
/** Set the data address mask register */
void SetDABM(u32 val);
extern void SetDABM(u32 val);
/** Get the data value mask register */
u32 GetDVB(void);
extern u32 GetDVB(void);
/** Set the data value register */
void SetDVB(u32 val);
extern void SetDVB(u32 val);
/** Get the data value mask register */
u32 GetDVBM(void);
extern u32 GetDVBM(void);
/** Set the data value mask register */
void SetDVBM(u32 val);
extern void SetDVBM(u32 val);

#ifdef __cplusplus
}
Expand Down
4 changes: 2 additions & 2 deletions ee/debug/include/screenshot.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
extern "C" {
#endif

int ps2_screenshot_file( const char* pFilename,unsigned int VramAdress,
extern int ps2_screenshot_file( const char* pFilename,unsigned int VramAdress,
unsigned int Width, unsigned int Height, unsigned int Psm );

int ps2_screenshot( void* pTemp, unsigned int VramAdress,unsigned int x,unsigned int y,
extern int ps2_screenshot( void* pTemp, unsigned int VramAdress,unsigned int x,unsigned int y,
unsigned int Width, unsigned int Height, unsigned int Psm );

#ifdef __cplusplus
Expand Down
Loading

0 comments on commit 0b3c5f6

Please sign in to comment.