USRAPPS := init login CLIShell cat ls mount
USRAPPS += bomb lspci
USRAPPS += ip dhcpclient ping telnet irc wget telnetd
-USRAPPS += axwin3
+USRAPPS += axwin3 gui_ate
ALL_DYNMODS = $(addprefix all-,$(DYNMODS))
ALL_MODULES := $(addprefix all-,$(MODULES))
create_run_dialog();
AxWin3_RegisterAction(gSidebar, "Interface>Run", (tAxWin3_HotkeyCallback)mainmenu_run_dialog);
-// AxWin3_RegisterAction(gSidebar, "Interface>Terminal", mainmenu_app_terminal);
-// AxWin3_RegisterAction(gSidebar, "Interface>TextEdit", mainmenu_app_textedit);
+ AxWin3_RegisterAction(gSidebar, "Interface>Terminal", (tAxWin3_HotkeyCallback)mainmenu_app_terminal);
+ AxWin3_RegisterAction(gSidebar, "Interface>TextEdit", (tAxWin3_HotkeyCallback)mainmenu_app_textedit);
// Idle loop
AxWin3_MainLoop();
void mainmenu_app_textedit(void *unused)
{
_SysDebug("TODO: Launch text editor");
+// spawn("/Acess/Apps/AxWin/3.0/ate");
}
void mainmenu_app_terminal(void *unused)
#include <common.h>
#include <wm_renderer.h>
#include <richtext_messages.h>
+#include <stdio.h> // sscanf
#define LINES_PER_BLOCK 30
return ret;
}
-inline int Renderer_RichText_RenderText_Act(tWindow *Window, tRichText_Window *info, int X, int Row, const char *Text, int Bytes, tColour FG, tColour BG)
+static inline int Renderer_RichText_RenderText_Act(tWindow *Window, tRichText_Window *info, int X, int Row, const char *Text, int Bytes, tColour FG, tColour BG)
{
int rwidth;
// TODO: Fill only what is needed
INCFILES := stdio.h stdlib.h\r
\r
OBJ = stub.o heap.o stdlib.o env.o fileIO.o string.o select.o rand.o\r
-OBJ += perror.o\r
+OBJ += perror.o scanf.o\r
OBJ += arch/$(ARCHDIR).ao\r
# signals.o\r
DEPFILES := $(OBJ:%.o=%.d)\r
extern int fprintf(FILE *fp, const char *format, ...);
extern int vfprintf(FILE *fp, const char *format, va_list args);
+// scanf
+extern int scanf(const char *format, ...);
+extern int fscanf(FILE *stream, const char *format, ...);
+extern int sscanf(const char *str, const char *format, ...);
+extern int vscanf(const char *format, va_list ap);
+extern int vsscanf(const char *str, const char *format, va_list ap);
+extern int vfscanf(FILE *stream, const char *format, va_list ap);
+
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;
--- /dev/null
+/*
+ * Acess2 C Library
+ * - By John Hodge (thePowersGang)
+ *
+ * scanf.c
+ * - *scanf family of functions
+ */
+#include <stdio.h>
+#include <stdarg.h>
+
+// === CODE ===
+int _vcscanf(int (*__getc)(void *), void *h, const char *format, va_list ap)
+{
+ // TODO: Impliment
+ return 0;
+}
+
+int _vsscanf_getc(void *h)
+{
+ const char **ibuf = h;
+ return *(*ibuf)++; // Dereference, read, increment
+}
+
+int vscanf(const char *format, va_list ap)
+{
+ return vfscanf(stdin, format, ap);
+}
+
+int vsscanf(const char *str, const char *format, va_list ap)
+{
+ return _vcscanf(_vsscanf_getc, &str, format, ap);
+}
+
+int _vfscanf_getc(void *h)
+{
+ return fgetc(h); // TODO: Handle -1 -> 0
+}
+
+int vfscanf(FILE *stream, const char *format, va_list ap)
+{
+ return _vcscanf(_vfscanf_getc, stream, format, ap);
+}
+
+int scanf(const char *format, ...)
+{
+ va_list args;
+ int rv;
+ va_start(args, format);
+ rv = vfscanf(stdin, format, args);
+ va_end(args);
+ return rv;
+}
+int fscanf(FILE *stream, const char *format, ...)
+{
+ va_list args;
+ int rv;
+ va_start(args, format);
+ rv = vfscanf(stream, format, args);
+ va_end(args);
+ return rv;
+}
+int sscanf(const char *str, const char *format, ...)
+{
+ va_list args;
+ int rv;
+ va_start(args, format);
+ rv = vsscanf(str, format, args);
+ va_end(args);
+ return rv;
+}
+