mirror of
https://github.com/etaHEN/etaHEN.git
synced 2026-01-14 20:14:39 +08:00
27 lines
771 B
C++
27 lines
771 B
C++
#include "notify.hpp"
|
|
|
|
void printf_notification(const char *fmt, ...)
|
|
{
|
|
OrbisNotificationRequest noti_buffer{};
|
|
|
|
va_list args{};
|
|
va_start(args, fmt);
|
|
int len = vsnprintf(noti_buffer.message, sizeof(noti_buffer.message), fmt, args);
|
|
va_end(args);
|
|
|
|
// these dont do anything currently
|
|
// that or the structure has changed
|
|
// lets just copy messages for now
|
|
/*
|
|
noti_buffer.type = 0;
|
|
noti_buffer.unk3 = 0;
|
|
noti_buffer.use_icon_image_uri = 0;
|
|
noti_buffer.target_id = -1;
|
|
*/
|
|
// trim newline
|
|
if (noti_buffer.message[len - 1] == '\n')
|
|
{
|
|
noti_buffer.message[len - 1] = '\0';
|
|
}
|
|
printf("Sent notification: 0x%08x with message:\n%s\n", sceKernelSendNotificationRequest(0, (OrbisNotificationRequest *)¬i_buffer, sizeof(noti_buffer), 0), noti_buffer.message);
|
|
} |