Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 8385 → Rev 8384

/programs/other/tte/notify.c
File deleted
Property changes:
Deleted: svn:executable
-*
\ No newline at end of property
/programs/other/tte/console_obj.h
File deleted
Property changes:
Deleted: svn:executable
-*
\ No newline at end of property
/programs/other/tte/Makefile
1,23 → 1,2
CC = kos32-gcc
LD = kos32-ld
 
SDK_DIR = $(abspath ../../../contrib/sdk)
 
CFLAGS = -c -fno-ident -fomit-frame-pointer -fno-ident -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32
LDFLAGS = -static -S -nostdlib -T $(SDK_DIR)/sources/newlib/app.lds --image-base 0
 
INCLUDES = -I $(SDK_DIR)/sources/newlib/libc/include
LIBPATH = -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib
 
default:
$(CC) $(CFLAGS) -O2 $(INCLUDES) getline.c
$(CC) $(CFLAGS) -O2 $(INCLUDES) -DGCC_BUILD tte.c
$(CC) $(CFLAGS) -O0 $(INCLUDES) notify.c
kos32-ld $(LDFLAGS) $(LIBPATH) --subsystem native -o tte getline.o tte.o notify.o -lgcc -lc.dll
objcopy tte -O binary
 
TCC:
kos32-tcc -DTCC_BUILD tte.c getline.c notify.c -lck -o tte -I ../../develop/ktcc/trunk/libc/include
 
clean:
rm *.o
tte:
wine kos32-tcc.exe tte.c getline.c -lck -o tte
/programs/other/tte/tte.c
44,16 → 44,10
///#include <termios.h>
#include <time.h>
///#include <unistd.h>
 
#ifdef TCC_BUILD
#include <conio.h>
#endif
#ifdef GCC_BUILD
#include "console_obj.h"
#endif
 
/// Notify
void notify(char *text);
#include "notify.h"
 
 
/*** Define section ***/
510,10 → 504,10
 
case 6: // Ctrl+F
return CTRL_KEY('f');
/*
 
case 8: // Ctrl+H
return CTRL_KEY('h');
*/
 
case 24: // Ctrl+X
return CTRL_KEY('x');
1798,15 → 1792,7
}
 
int main(int argc, char* argv[]) {
#ifdef TCC_BUILD
con_init_console_dll_param(con_def_wnd_width, con_def_wnd_height, con_def_wnd_width, con_def_wnd_height, "TinyTextEditor");
#endif
#ifdef GCC_BUILD
load_console();
con_init(con_def_wnd_width, con_def_wnd_height, con_def_wnd_width, con_def_wnd_height, "TinyTextEditor");
#endif
initEditor();
int arg_response = handleArgs(argc, argv);
if (arg_response == 1) {
/programs/other/tte/notify.h
0,0 → 1,29
typedef unsigned int uint32_t;
 
static inline
int start_app(char *app_name, char *args){
#pragma pack(push, 1)
struct file_op_t
{
uint32_t fn;
uint32_t flags;
char* args;
uint32_t res1, res2;
char zero;
char* app_name __attribute__((packed));
} file_op;
#pragma pack(pop)
memset(&file_op, 0, sizeof(file_op));
file_op.fn = 7;
file_op.args = args;
file_op.app_name = app_name;
 
register int val;
asm volatile ("int $0x40":"=a"(val):"a"(70), "b"(&file_op));
 
return val;
}
 
void notify(char *text) {
start_app("/sys/@notify", text);
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property