//svarlang.lib/trunk/autoload.c |
---|
1,7 → 1,7 |
/* This file is part of the svarlang project and is published under the terms |
* of the MIT license. |
* |
* Copyright (C) 2021-2022 Mateusz Viste |
* Copyright (C) 2021-2023 Mateusz Viste |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
//svarlang.lib/trunk/history.txt |
---|
1,4 → 1,7 |
20230629 |
- deflang.c has each message on a different line so it is nicer to VCSes |
20230628 |
- added support for \e sequences in translation strings |
- implemented svarlang_getver() |
//svarlang.lib/trunk/svarlang.c |
---|
1,7 → 1,7 |
/* This file is part of the svarlang project and is published under the terms |
* of the MIT license. |
* |
* Copyright (C) 2021-2022 Mateusz Viste |
* Copyright (C) 2021-2023 Mateusz Viste |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
//svarlang.lib/trunk/svarlang.h |
---|
26,7 → 26,7 |
#define SVARLANG_H |
/* library version */ |
#define SVARLANGVER "20230628" |
#define SVARLANGVER "20230629" |
/* returns a pointer to a string with the SvarLANG's library version, |
* independently of the SVARLANGVER string above. */ |
//svarlang.lib/trunk/tlumacz.c |
---|
317,14 → 317,26 |
ecode = 1; |
} else { |
unsigned short allocsz = biggest_langsz + (biggest_langsz / 20); |
printf("biggest lang block is %u bytes -> allocating a %u bytes buffe (5%% safety margin)r\n", biggest_langsz, allocsz); |
unsigned short nextstringin = 0, nextnlat = 40; |
printf("biggest lang block is %u bytes -> allocating a %u bytes buffer (5%% safety margin)\n", biggest_langsz, allocsz); |
fprintf(fd, "/* THIS FILE HAS BEEN GENERATED BY TLUMACZ (PART OF THE SVARLANG LIBRARY) */\r\n"); |
fprintf(fd, "const unsigned short svarlang_memsz = %uu;\r\n", allocsz); |
fprintf(fd, "char svarlang_mem[%u] = {\r\n", allocsz); |
fprintf(fd, "char svarlang_mem[%u] = {", allocsz); |
for (i = 0; i < refblocksz; i++) { |
if (nextstringin == 0) { |
fprintf(fd, "\r\n"); |
nextnlat = i + 40; |
nextstringin = 4 + (refblock[i + 3] << 8) + refblock[i + 2]; |
if (nextstringin == 4) nextstringin = 20000; /* last string in block */ |
} |
if (i == nextnlat) { |
nextnlat += 40; |
fprintf(fd, "\r\n"); |
} |
nextnlat--; |
nextstringin--; |
fprintf(fd, "%u", refblock[i]); |
if (i + 1 < refblocksz) fprintf(fd, ","); |
if ((i & 15) == 15) fprintf(fd, "\r\n"); |
} |
fprintf(fd, "};\r\n"); |
fclose(fd); |
//svarlang.lib/trunk/version.c |
---|
1,7 → 1,7 |
/* This file is part of the svarlang project and is published under the terms |
* of the MIT license. |
* |
* Copyright (C) 2021-2022 Mateusz Viste |
* Copyright (C) 2021-2023 Mateusz Viste |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |