ref: f543197b49de47a7e8b73941fae8b488248bff4b
parent: e5f850290c4034d4946e3a5e9cc8bd368272f93b
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon Apr 26 02:38:34 EDT 2021
add a bit of portmidi stubs
--- /dev/null
+++ b/include/npe/portmidi.h
@@ -1,0 +1,34 @@
+#ifndef _npe_portmidi_h_
+#define _npe_portmidi_h_
+
+#pragma lib "libnpe_portmidi.a"
+
+typedef struct PmStream PmStream;
+typedef struct PmEvent PmEvent;
+typedef struct PmDeviceInfo PmDeviceInfo;
+typedef int PmError;
+typedef int PmDeviceID;
+typedef int PmTimestamp;
+typedef PmTimestamp (*PmTimeProcPtr)(void *);
+
+#pragma incomplete PmStream
+
+struct PmEvent {
+ int message;
+};
+
+struct PmDeviceInfo {
+ char *name;
+};
+
+enum {
+ pmNoError,
+};
+
+int Pm_Initialize(void);
+int Pm_CountDevices(void);
+int Pm_OpenInput(PmStream **, PmDeviceID, void *, int, PmTimeProcPtr, void *);
+PmDeviceInfo *Pm_GetDeviceInfo(PmDeviceID);
+int Pm_Read(PmStream *, PmEvent *, int);
+
+#endif
--- /dev/null
+++ b/libnpe_portmidi/mkfile
@@ -1,0 +1,17 @@
+</$objtype/mkfile
+
+LIB=/$objtype/lib/libnpe_portmidi.a
+CFLAGS=$CFLAGS -p -I../include/npe -D__plan9__ -D__${objtype}__
+
+HFILES=\
+
+OFILES=\
+ pm.$O\
+
+UPDATE=\
+ mkfile\
+ $HFILES\
+ ${OFILES:%.$O=%.c}\
+ ${LIB:/$objtype/%=/386/%}\
+
+</sys/src/cmd/mksyslib
--- /dev/null
+++ b/libnpe_portmidi/pm.c
@@ -1,0 +1,33 @@
+#include <u.h>
+#include <libc.h>
+#include "portmidi.h"
+
+int
+Pm_Initialize(void)
+{
+ return 0;
+}
+
+int
+Pm_CountDevices(void)
+{
+ return 0;
+}
+
+int
+Pm_OpenInput(PmStream **, PmDeviceID, void *, int, PmTimeProcPtr, void *)
+{
+ return -1;
+}
+
+PmDeviceInfo *
+Pm_GetDeviceInfo(PmDeviceID)
+{
+ return nil;
+}
+
+int
+Pm_Read(PmStream *, PmEvent *, int)
+{
+ return -1;
+}
--- a/mkfile
+++ b/mkfile
@@ -2,6 +2,7 @@
LIBS=\
libnpe\
+ libnpe_portmidi\
libnpe_pthread\
libnpe_sdl2\