Subversion Repositories SvarDOS

Compare Revisions

No changes between revisions

Ignore whitespace Rev 1345 → Rev 1346

/sved/trunk/deflang.c
1,8 → 1,8
/* THIS FILE HAS BEEN GENERATED BY TLUMACZ (PART OF THE SVARLANG LIBRARY) */
const unsigned short svarlang_memsz = 376u;
const unsigned short svarlang_string_count = 24u;
const unsigned short svarlang_memsz = 399u;
const unsigned short svarlang_string_count = 26u;
 
char svarlang_mem[376] = {
char svarlang_mem[399] = {
0x46,0x31,0x3d,0x48,0x45,0x4c,0x50,0x00,
0x4e,0x45,0x57,0x20,0x46,0x49,0x4c,0x45,0x00,
0x53,0x41,0x56,0x45,0x44,0x00,
15,6 → 15,8
0x4c,0x6f,0x61,0x64,0x3a,0x00,
0x50,0x72,0x65,0x73,0x73,0x20,0x45,0x53,0x43,0x20,0x74,0x6f,0x20,0x63,0x61,0x6e,
0x63,0x65,0x6c,0x2e,0x00,
0x45,0x52,0x52,0x4f,0x52,0x00,
0x46,0x49,0x4c,0x45,0x20,0x4e,0x4f,0x54,0x20,0x46,0x4f,0x55,0x4e,0x44,0x00,
0x75,0x73,0x61,0x67,0x65,0x3a,0x20,0x73,0x76,0x65,0x64,0x20,0x5b,0x66,0x69,0x6c,
0x65,0x2e,0x74,0x78,0x74,0x5d,0x00,
0x46,0x32,0x20,0x20,0x4e,0x65,0x77,0x20,0x66,0x69,0x6c,0x65,0x00,
37,7 → 39,7
0x50,0x72,0x65,0x73,0x73,0x20,0x61,0x6e,0x79,0x20,0x6b,0x65,0x79,0x00
};
 
unsigned short svarlang_dict[48] = {
unsigned short svarlang_dict[52] = {
0x0000,0x0000,
0x0001,0x0008,
0x0002,0x0011,
47,19 → 49,21
0x0006,0x005b,
0x0007,0x0064,
0x0008,0x006a,
0x0100,0x007f,
0x0800,0x0096,
0x0801,0x00a3,
0x0802,0x00b1,
0x0803,0x00ba,
0x0804,0x00c9,
0x0805,0x00e1,
0x0806,0x00ea,
0x0807,0x00ec,
0x0808,0x00f8,
0x0809,0x00fa,
0x080a,0x0119,
0x080b,0x0137,
0x080c,0x0155,
0x080d,0x0157
0x000a,0x007f,
0x000b,0x0085,
0x0100,0x0094,
0x0800,0x00ab,
0x0801,0x00b8,
0x0802,0x00c6,
0x0803,0x00cf,
0x0804,0x00de,
0x0805,0x00f6,
0x0806,0x00ff,
0x0807,0x0101,
0x0808,0x010d,
0x0809,0x010f,
0x080a,0x012e,
0x080b,0x014c,
0x080c,0x016a,
0x080d,0x016c
};
/sved/trunk/nls/en_utf8.txt
13,6 → 13,8
0.6:Save as:
0.7:Load:
0.8:Press ESC to cancel.
0.10:ERROR
0.11:FILE NOT FOUND
 
 
################
/sved/trunk/sved.c
25,7 → 25,6
 
#include <dos.h> /* _dos_open(), _dos_read(), _dos_close(), ... */
#include <fcntl.h> /* O_RDONLY, O_WRONLY */
#include <stdlib.h>
#include <string.h>
 
#include "mdr\bios.h"
533,13 → 532,13
}
 
 
static struct file *loadfile(const char *fname) {
/* returns 0 on success, 1 on file not found, 2 on other error */
static unsigned char loadfile(struct file *db, const char *fname) {
char buff[512]; /* read one entire sector at a time (faster) */
char *buffptr;
unsigned int len, llen;
int fd;
unsigned char eolfound;
static struct file db[1];
 
bzero(db, sizeof(db));
memcpy(db->fname, fname, strlen(fname));
547,9 → 546,7
if (*fname == 0) goto SKIPLOADING;
 
if (_dos_open(fname, O_RDONLY, &fd) != 0) {
mdr_coutraw_puts("Failed to open file:");
mdr_coutraw_puts(fname);
return(NULL);
return(1);
}
 
db->lfonly = 1;
592,7 → 589,6
 
/* append content, if line is non-empty */
if ((llen > 0) && (line_append(db, buffptr, llen) != 0)) {
mdr_coutraw_puts("out of memory");
goto IOERR;
}
 
599,8 → 595,6
/* add a new line if necessary */
if (eolfound) {
if (line_add(db, NULL, 0) != 0) {
/* TODO ERROR HANDLING */
mdr_coutraw_puts("out of memory");
goto IOERR;
}
eolfound = 0;
623,11 → 617,11
if ((db->cursor == NULL) || (db->cursor->len != 0)) line_add(db, NULL, 0);
db_rewind(db);
 
return(db);
return(0);
 
IOERR:
_dos_close(fd);
return(NULL);
return(2);
}
 
 
726,8 → 720,9
 
 
int main(void) {
static struct file dbarr[1];
const char *fname;
struct file *db;
struct file *db = dbarr;
 
{
char nlspath[128], lang[8];
742,8 → 737,16
}
 
/* load file */
db = loadfile(fname);
if (db == NULL) return(1);
{
unsigned char err = loadfile(db, fname);
if (err == 1) {
mdr_coutraw_puts(svarlang_str(0,11)); /* file not found */
return(1);
} else if (err != 0) {
mdr_coutraw_puts(svarlang_str(0,10)); /* ERROR */
return(1);
}
}
 
if (mdr_cout_init(&screenw, &screenh)) {
/* load color scheme if mdr_cout_init returns a color flag */
897,8 → 900,18
/* ask for filename */
ui_getstring(svarlang_str(0,7), fname, sizeof(fname));
if (fname[0] != 0) {
unsigned char err;
clear_file(db);
db = loadfile(fname);
err = loadfile(db, fname);
if (err != 0) {
if (err == 1) {
ui_msg(svarlang_str(0,11), NULL, SCHEME_ERR); /* file not found */
} else {
ui_msg(svarlang_str(0,10), NULL, SCHEME_ERR); /* ERROR */
}
mdr_bios_tickswait(44); /* 3s */
clear_file(db);
}
}
uidirty.from = 0;
uidirty.to = 0xff;
/sved/trunk/sved.lng
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream