• R/O
  • SSH
  • HTTPS

svardos: Commit


Commit MetaInfo

Revision613 (tree)
Time2022-02-04 07:33:16
Authormateuszviste

Log Message

replaced Kitten by SvarLANG

Change Summary

Incremental Difference

--- pkg/kitten/kitten.h (revision 612)
+++ pkg/kitten/kitten.h (nonexistent)
@@ -1,78 +0,0 @@
1-/* Functions that emulate UNIX catgets, some small DOS file functions */
2-
3-/* Copyright (C) 1999,2000 Jim Hall <jhall@freedos.org> */
4-/* Kitten version by Tom Ehlert, heavily modified by Eric Auer 2003 */
5-
6-/*
7- This library is free software; you can redistribute it and/or
8- modify it under the terms of the GNU Lesser General Public
9- License as published by the Free Software Foundation; either
10- version 2.1 of the License, or (at your option) any later version.
11-
12- This library is distributed in the hope that it will be useful,
13- but WITHOUT ANY WARRANTY; without even the implied warranty of
14- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15- Lesser General Public License for more details.
16-
17- You should have received a copy of the GNU Lesser General Public
18- License along with this library; if not, write to the Free Software
19- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20-*/
21-
22-
23-#ifndef _CATGETS_H
24-#define _CATGETS_H
25-
26-#ifdef __cplusplus
27-extern "C"
28-{
29-#endif
30-
31-#ifdef NO_KITTEN
32-
33-#define kittengets(x,y,z) (z)
34-#define kittenclose()
35-#define kittenopen(a)
36-
37-#else
38-
39-/* Data types */
40-
41-#define nl_catd int
42-
43-/* Functions */
44-
45-#define catgets(catalog, set,message_number,message) kittengets(set,message_number,message)
46-#define catopen(name,flag) kittenopen(name)
47-#define catclose(catalog) kittenclose()
48-
49-
50- char *kittengets (int set_number, int message_number, char *message);
51- nl_catd kittenopen (char *name);
52- void kittenclose (void);
53-
54- int get_line (int file, char *buffer, int size);
55-
56-#ifndef _MICROC_
57-#ifndef __DJGPP__
58-
59- int dos_open (char *filename, int mode);
60-#define open(filename,mode) dos_open(filename,mode)
61-
62- int dos_read (int file, void *ptr, unsigned count);
63-#define read(file, ptr, count) dos_read(file,ptr,count)
64-
65- int dos_write (int file, void *ptr, unsigned count);
66-#define write(file, ptr, count) dos_write(file,ptr,count)
67-
68- void dos_close (int file);
69-#define close(file) dos_close(file)
70-
71-#endif /*DJGPP*/
72-#endif /*Micro-C */
73-#endif /*NO_KITTEN */
74-#ifdef __cplusplus
75-}
76-#endif
77-
78-#endif /* _CATGETS_H */
--- pkg/kitten/kitten.c (revision 612)
+++ pkg/kitten/kitten.c (nonexistent)
@@ -1,698 +0,0 @@
1-/* Functions that emulate UNIX catgets */
2-
3-/* Copyright (C) 1999,2000,2001 Jim Hall <jhall@freedos.org> */
4-/* Kitten version 2003 by Tom Ehlert, heavily modified by Eric Auer 2003 */
5-
6-/*
7- This library is free software; you can redistribute it and/or
8- modify it under the terms of the GNU Lesser General Public
9- License as published by the Free Software Foundation; either
10- version 2.1 of the License, or (at your option) any later version.
11-
12- This library is distributed in the hope that it will be useful,
13- but WITHOUT ANY WARRANTY; without even the implied warranty of
14- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15- Lesser General Public License for more details.
16-
17- You should have received a copy of the GNU Lesser General Public
18- License along with this library; if not, write to the Free Software
19- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20-*/
21-
22-#ifndef NO_KITTEN
23-
24-#include <stdio.h> /* sprintf */
25-#ifndef _MICROC_
26-#include <stdlib.h> /* getenv */
27-#include <string.h> /* strchr */
28-#include <dos.h>
29-#ifndef __PACIFIC__
30-#include <fcntl.h>
31-#else
32-#define O_RDONLY 0
33-#define O_TEXT 0
34-#endif
35-#else
36-#include <intr.h>
37-#include <file.h>
38-#define O_RDONLY READONLY
39-#define O_TEXT 0
40-#endif
41-/* assert we are running in small model */
42-/* else pointer below has to be done correctly */
43-/* char verify_small_pointers[sizeof(void*) == 2 ? 1 : -1]; */
44-
45-#include "kitten.h"
46-
47-char catcontents[8192];
48-
49-struct catstring
50-{
51- char key1;
52- char key2;
53- char *text;
54-};
55-
56-/* Micro-C does not support typedef */
57-#define catstring_t struct catstring
58-
59-catstring_t catpoints[128];
60-
61-
62-/* Local prototypes */
63-
64-int catread (char *catfile); /* Reads a catfile into the hash */
65-char *processEscChars (char *line); /* Converts c escape sequences to chars */
66-
67-int get_char (int file); /* not meant for external use */
68-/* external use would cause consistency problems if */
69-/* value or related file of the file handle changes */
70-
71-int mystrtoul (char *src, int base, int size);
72-
73-
74-/* Globals */
75-
76-nl_catd _kitten_catalog = 0; /* _kitten_catalog descriptor or 0 */
77-char catfile[128]; /* full path to _kitten_catalog */
78-
79-char getlbuf[8192]; /* read buffer for better speed */
80-char *getlp; /* current point in buffer */
81-int getlrem = -1; /* remaining bytes in buffer */
82-char lastcr = 0; /* for 2byte CR LF sequences */
83-
84-
85-#ifndef _MICROC_
86-#ifndef __DJGPP__
87-
88-/* DOS handle based file usage */
89-
90-int
91-dos_open (char *filename, int mode)
92-{
93- union REGS r;
94- struct SREGS s;
95-#ifndef __WATCOMC__
96- if (mode); /* mode ignored - readonly supported */
97-#endif
98- r.h.ah = 0x3d;
99- r.h.al = 0; /* read mode only supoported now !! */
100- r.x.dx = FP_OFF (filename);
101- s.ds = FP_SEG (filename);
102- intdosx (&r, &r, &s);
103- return ((r.x.cflag) ? -1 : (int) r.x.ax);
104-}
105-
106-
107-int
108-dos_read (int file, void *ptr, unsigned count)
109-{
110- union REGS r;
111- struct SREGS s;
112- r.h.ah = 0x3f;
113- r.x.bx = file;
114- r.x.cx = count;
115- r.x.dx = FP_OFF (ptr);
116- s.ds = FP_SEG (ptr);
117- intdosx (&r, &r, &s);
118- return ((r.x.cflag) ? 0 : r.x.ax);
119-}
120-
121-
122-int
123-dos_write (int file, void *ptr, unsigned count)
124-{
125- union REGS r;
126- struct SREGS s;
127- r.h.ah = 0x40;
128- r.x.bx = file;
129- r.x.cx = count;
130- r.x.dx = FP_OFF (ptr);
131- s.ds = FP_SEG (ptr);
132- intdosx (&r, &r, &s);
133- return ((r.x.cflag) ? 0 : r.x.ax);
134-}
135-
136-
137-void
138-dos_close (int file)
139-{
140- union REGS r;
141- r.h.ah = 0x3e;
142- r.x.bx = file;
143- intdos (&r, &r);
144-}
145-
146-#endif /*DJGPP*/
147-#endif /*Micro-C */
148-/* Functions */
149-/**
150- * On success, catgets() returns a pointer to an internal
151- * buffer area containing the null-terminated message string.
152- * On failure, catgets() returns the value 'message'.
153- */
154-char *
155-kittengets (int setnum, int msgnum, char *message)
156-{
157-/* In Micro-C, variables must be defined at the start of the
158- * function and may not be immediately assigned a value
159- */
160-#ifdef _MICROC_
161- int i;
162- i = 0;
163-#else
164- int i = 0;
165-#endif
166-
167- while ((catpoints[i].key1 != setnum) || (catpoints[i].key2 != msgnum))
168- {
169- if ((catpoints[i].text == NULL) || (i > 127)) /* at EOF */
170- return message;
171- i++;
172- }
173-
174- if (catpoints[i].text == NULL)
175- return message;
176- else
177- return (catpoints[i].text);
178-}
179-
180-
181-/**
182- * Initialize kitten for program (name).
183- */
184-
185-nl_catd
186-kittenopen (char *name)
187-{
188- /* catopen() returns a message _kitten_catalog descriptor *
189- * of type nl_catd on success. On failure, it returns -1. */
190-
191- char catlang[3]; /* from LANG environment var. */
192- char *nlsptr; /* ptr to NLSPATH */
193- char *lang; /* ptr to LANG */
194- int i;
195-#ifdef _MICROC_
196- char *tok;
197- int toklen;
198-#endif
199-
200- /* Open the _kitten_catalog file */
201- /* The value of `_kitten_catalog' will be set based on catread */
202-
203- if (_kitten_catalog)
204- { /* Already one open */
205- write (1, "cat already open\r\n", strlen ("cat already open\r\n"));
206- return (-1);
207- }
208-
209- for (i = 0; i < 128; i++)
210- catpoints[i].text = NULL;
211-
212- if (strchr (name, '\\'))
213- {
214- /* unusual case: 'name' is a filename */
215- write (1, "found \\\r\n", 9);
216- _kitten_catalog = catread (name);
217- if (_kitten_catalog)
218- return (_kitten_catalog);
219- }
220-
221- /* If the message _kitten_catalog file name does not contain a directory *
222- * separator, then we need to try to locate the message _kitten_catalog. */
223-
224- /* We will need the value of LANG, and may need a 2-letter abbrev of
225- LANG later on, so get it now. */
226-
227- lang = getenv ("LANG");
228-
229- if (lang == NULL)
230- {
231- /* printf("no lang= found\n"); *//* not fatal, though */
232- /* Return failure - we won't be able to locate the cat file */
233- return (-1);
234- }
235-
236- if ((strlen (lang) < 2) || ((strlen (lang) > 2) && (lang[2] != '-')))
237- {
238- /* Return failure - we won't be able to locate the cat file */
239- return (-1);
240- }
241-
242- memcpy (catlang, lang, 2);
243- /* we copy the full LANG value or the part before "-" if "-" found */
244- catlang[2] = '\0';
245-
246- /* step through NLSPATH */
247-
248- nlsptr = getenv ("NLSPATH");
249-
250- if (nlsptr == NULL)
251- {
252- /* printf("no NLSPATH= found\n"); *//* not fatal either */
253- /* Return failure - we won't be able to locate the cat file */
254- return (-1);
255- }
256-
257- catfile[0] = '\0';
258-
259- while (nlsptr && nlsptr[0])
260- {
261-#ifdef _MICROC_
262- tok = strchr (nlsptr, ';');
263-#else
264- char *tok = strchr (nlsptr, ';');
265- int toklen;
266-#endif
267-
268- if (tok == NULL)
269- toklen = strlen (nlsptr); /* last segment */
270- else
271- toklen = tok - nlsptr; /* segment terminated by ';' */
272-
273- /* catfile = malloc(toklen+1+strlen(name)+1+strlen(lang)+1); */
274- /* Try to find the _kitten_catalog file in each path from NLSPATH */
275-
276- if ((toklen + 6 + strlen (name)) > sizeof (catfile))
277- {
278- write (1, "NLSPATH overflow\r\n", strlen ("NLSPATH overflow\r\n"));
279- return 0; /* overflow in NLSPATH, should never happen */
280- }
281-
282- /* Rule #1: %NLSPATH%\%LANG%\cat */
283-
284- memcpy (catfile, nlsptr, toklen);
285- strcpy (catfile + toklen, "\\");
286- strcat (catfile, catlang);
287- strcat (catfile, "\\");
288- strcat (catfile, name);
289- _kitten_catalog = catread (catfile);
290- if (_kitten_catalog)
291- return (_kitten_catalog);
292-
293- /* Rule #2: %NLSPATH%\cat.%LANG% */
294-
295- /* memcpy(catfile, nlsptr, toklen); */
296- strcpy (catfile + toklen, "\\");
297- strcat (catfile, name);
298- strcat (catfile, ".");
299- strcat (catfile, catlang);
300- _kitten_catalog = catread (catfile);
301- if (_kitten_catalog)
302- return (_kitten_catalog);
303-
304- /* Grab next tok for the next while iteration */
305-
306- nlsptr = tok;
307- if (nlsptr)
308- nlsptr++;
309-
310- } /* while tok */
311-
312- /* We could not find it. Return failure. */
313-
314- return (-1);
315-}
316-
317-
318-/**
319- * Load a message catalog into memory.
320- */
321-
322-int
323-catread (char *catfile)
324-{
325- int file; /* pointer to the catfile */
326- int i;
327- char *where;
328- char *tok;
329-#ifdef _MICROC_
330- char *msg;
331- char *key;
332- int key1;
333- int key2;
334-#endif
335-
336- /* Get the whole catfile into a buffer and parse it */
337-
338- file = open (catfile, O_RDONLY | O_TEXT);
339- if (file < 0)
340- /* Cannot open the file. Return failure */
341- return 0;
342-
343- for (i = 0; i < 128; i++)
344- catpoints[i].text = NULL;
345-
346- for (i = 0; (unsigned int) i < sizeof (catcontents); i++)
347- catcontents[i] = '\0';
348-
349- /* Read the file into memory */
350- i = read (file, catcontents, sizeof (catcontents) - 1);
351-
352- if ((i == sizeof (catcontents) - 1) || (i < 1))
353- return 0; /* file was too big or too small */
354-
355- where = catcontents;
356- i = 0; /* catpoints entry */
357-
358- do
359- {
360-#ifndef _MICROC_
361- char *msg;
362- char *key;
363- int key1 = 0;
364- int key2 = 0;
365-#else
366- key1 = 0;
367- key2 = 0;
368-#endif
369-
370- tok = strchr (where, '\n');
371-
372- if (tok == NULL)
373- { /* done? */
374- close (file);
375- return 1; /* success */
376- }
377-
378- tok[0] = '\0'; /* terminate here */
379- tok--; /* guess: \r before \n */
380- if (tok[0] != '\r')
381- tok++; /* if not, go back */
382- else
383- {
384- tok[0] = '\0'; /* terminate here already */
385- tok++;
386- }
387- tok++; /* this is where the next line starts */
388-
389- if ((where[0] >= '0') && (where[0] <= '9') &&
390- ((msg = strchr (where, ':')) != NULL))
391- {
392- /* Skip everything which starts with # or with no digit */
393- /* Entries look like "1.2:This is a message" */
394-
395- msg[0] = '\0'; /* remove : */
396- msg++; /* go past the : */
397-
398- if ((key = strchr (where, '.')) != NULL)
399- {
400- key[0] = '\0'; /* turn . into terminator */
401- key++; /* go past the . */
402- key1 = mystrtoul (where, 10, strlen (where));
403- key2 = mystrtoul (key, 10, strlen (key));
404-
405- if ((key1 >= 0) && (key2 >= 0))
406- {
407- catpoints[i].key1 = key1;
408- catpoints[i].key2 = key2;
409- catpoints[i].text = processEscChars (msg);
410- if (catpoints[i].text == NULL) /* ESC parse error */
411- catpoints[i].text = msg;
412- i++; /* next entry! */
413- } /* valid keys */
414-
415- } /* . found */
416-
417- } /* : and digit found */
418-
419- where = tok; /* go to next line */
420-
421- }
422- while (1);
423-#ifdef __PACIFIC__
424- return 0;
425-#endif
426-}
427-
428-
429-void
430-kittenclose (void)
431-{
432- /* close a message _kitten_catalog */
433- _kitten_catalog = 0;
434-}
435-
436-
437-/**
438- * Parse a string that represents an unsigned integer.
439- * Returns -1 if an error is found. The first size
440- * chars of the string are parsed.
441- */
442-
443-int
444-mystrtoul (char *src, int base, int size)
445-{
446-#ifdef _MICROC_
447- int ret;
448- int digit;
449- int ch;
450- ret = 0;
451-#else
452- int ret = 0;
453-#endif
454-
455- for (; size > 0; size--)
456- {
457-#ifdef _MICROC_
458- ch = *src;
459-#else
460- int digit;
461- int ch = *src;
462-#endif
463- src++;
464-
465- if (ch >= '0' && ch <= '9')
466- digit = ch - '0';
467- else if (ch >= 'A' && ch <= 'Z')
468- digit = ch - 'A' + 10;
469- else if (ch >= 'a' && ch <= 'z')
470- digit = ch - 'a' + 10;
471- else
472- return -1;
473-
474- if (digit >= base)
475- return -1;
476-
477- ret = ret * base + digit;
478- } /* for */
479-
480- return ret;
481-}
482-
483-
484-/**
485- * Process strings, converting \n, \t, \v, \b, \r, \f, \\,
486- * \ddd, \xdd and \x0dd to actual chars.
487- * (Note: \x is an extension to support hexadecimal)
488- * This is used to allow the messages to use c escape sequences.
489- * Modifies the line in-place (always same size or shorter).
490- * Returns a pointer to input string.
491- */
492-
493-char *
494-processEscChars (char *line)
495-{
496- /* used when converting \xdd and \ddd (hex or octal) characters */
497- char ch;
498-#ifdef _MICROC_
499- char *src;
500- char *dst;
501- int chx;
502- src = line;
503- dst = line;
504-#else
505- char *src = line;
506- char *dst = line; /* possible as dst is shorter than src */
507-#endif
508-
509- if (line == NULL)
510- return line;
511-
512- /* cycle through copying characters, except when a \ is encountered. */
513- while (*src != '\0')
514- {
515- ch = *src;
516- src++;
517-
518- if (ch == '\\')
519- {
520- ch = *src; /* what follows slash? */
521- src++;
522-
523- switch (ch)
524- {
525- case '\\': /* a single slash */
526- *dst = '\\';
527- dst++;
528- break;
529- case 'n': /* a newline (linefeed) */
530- *dst = '\n';
531- dst++;
532- break;
533- case 'r': /* a carriage return */
534- *dst = '\r';
535- dst++;
536- break;
537- case 't': /* a horizontal tab */
538- *dst = '\t';
539- dst++;
540- break;
541- case 'v': /* a vertical tab */
542- *dst = '\v';
543- dst++;
544- break;
545- case 'b': /* a backspace */
546- *dst = '\b';
547- dst++;
548- break;
549- case 'a': /* alert */
550- *dst = '\a';
551- dst++;
552- break;
553- case 'f': /* formfeed */
554- *dst = '\f';
555- dst++;
556- break;
557- case 'x': /* extension supporting hex numbers \xdd or \x0dd */
558- {
559-#ifdef _MICROC_
560- chx = mystrtoul (src, 16, 2); /* get value */
561-#else
562- int chx = mystrtoul (src, 16, 2); /* get value */
563-#endif
564- if (chx >= 0)
565- { /* store character */
566- *dst = chx;
567- dst++;
568- src += 2;
569- }
570- else /* error so just store x (loose slash) */
571- {
572- *dst = *src;
573- dst++;
574- }
575- }
576- break;
577- default: /* just store letter (loose slash) or handle octal */
578- {
579-#ifdef _MICROC_
580- chx = mystrtoul (src, 8, 3); /* get value */
581-#else
582- int chx = mystrtoul (src, 8, 3); /* get value */
583-#endif
584- if (chx >= 0)
585- { /* store character */
586- *dst = chx;
587- dst++;
588- src += 3;
589- }
590- else
591- {
592- *dst = *src;
593- dst++;
594- }
595- }
596- break;
597- } /* switch */
598- } /* if backslash */
599- else
600- {
601- *dst = ch;
602- dst++;
603- }
604- } /* while */
605-
606- /* ensure '\0' terminated */
607- *dst = '\0';
608-
609- return line;
610-}
611-
612-
613-int
614-get_char (int file)
615-{
616-#ifdef _MICROC_
617- int rval;
618- rval = -1;
619-#else
620- int rval = -1;
621-#endif
622-
623- if (getlrem <= 0)
624- { /* (re)init buffer */
625- getlrem = read (file, getlbuf, sizeof (getlbuf));
626- if (getlrem <= 0)
627- return -1; /* fail: read error / EOF */
628- getlp = getlbuf; /* init pointer */
629- }
630-
631- if (getlrem > 0)
632- { /* consume byte from buffer */
633- rval = getlp[0];
634- getlp++;
635- getlrem--;
636- }
637-
638- return rval;
639-}
640-
641-
642-/**
643- * Read a line of text from file. You must call this with
644- * a null buffer or null size to flush buffers when you are
645- * done with a file before using it on the next file. Cannot
646- * be used for 2 files at the same time.
647- */
648-
649-int
650-get_line (int file, char *str, int size)
651-{
652- int ch;
653-#ifdef _MICROC_
654- int success;
655- success = 0;
656-#else
657- int success = 0;
658-#endif
659-
660- if ((size == 0) || (str == NULL))
661- { /* re-init get_line buffers */
662- getlp = getlbuf;
663- getlrem = -1;
664- lastcr = 0;
665- return 0;
666- }
667-
668- str[0] = '\0';
669-
670- while ((size > 0) && (success == 0))
671- {
672- ch = get_char (file);
673- if (ch < 0)
674- break; /* (can cause fail if no \n found yet) */
675-
676- if (ch == '\r')
677- ch = get_char (file); /* ignore \r */
678-
679- str[0] = ch;
680-
681- if ((ch == '\n') || (ch == '\r'))
682- { /* done? */
683- str[0] = '\0';
684- return 1; /* success */
685- }
686-
687- str++;
688- size--;
689-
690- } /* while */
691-
692- str[0] = '\0'; /* terminate buffer */
693-
694- return success;
695-
696-}
697-
698-#endif /*NO_KITTEN */
--- pkg/nls_utf8/pkg_de.txt (revision 612)
+++ pkg/nls_utf8/pkg_de.txt (revision 613)
@@ -3,7 +3,6 @@
33 # Time-stamp: "2017-03-09 22:50:34 joerg"
44 #
55 # Language..: German
6-# Codepage..: 850
76 # Translator: Jörg Jenderek
87 # Version...: 0.99.4
98
@@ -18,12 +17,12 @@
1817 1.24: pkg listlocal [filter]
1918 1.27: pkg unzip datei.zip
2019 1.25:PKG is published under the MIT license.
21-1.26:It is configured through %DOSDIR%\\CFG\\PKG.CFG
20+1.26:It is configured through %DOSDIR%\CFG\PKG.CFG
2221
2322 ### General stuff ####
2423
2524 2.2:%DOSDIR% nicht gesetzt! Sie sollte auf das SvarDOS-Hauptverzeichnis verweisen.
26-2.3:Beispiel: SET DOSDIR=C:\\SVARDOS
25+2.3:Beispiel: SET DOSDIR=C:\SVARDOS
2726 2.14:Kein Speicher mehr! (%s)
2827
2928 #### Installing package ####
--- pkg/nls_utf8/pkg_dk.txt (revision 612)
+++ pkg/nls_utf8/pkg_dk.txt (revision 613)
@@ -2,7 +2,6 @@
22 # FDNPKG language file
33 #
44 # Language..: Danish
5-# Codepage..: 850 (858)
65 # Translator: Henrik Schick-Hansen
76 #
87
@@ -16,12 +15,12 @@
1615 1.24: pkg listlocal [filter]
1716 1.27: pkg unzip file.zip
1817 1.25:PKG is published under the MIT license.
19-1.26:It is configured through %DOSDIR%\\CFG\\PKG.CFG
18+1.26:It is configured through %DOSDIR%\CFG\PKG.CFG
2019
2120 ### General stuff ####
2221
2322 2.2:%DOSDIR% ikke sat! DOSDIR skal pege på SvarDOS hoved biblioteket.
24-2.3:Eksempel: SET DOSDIR=C:\\SVARDOS
23+2.3:Eksempel: SET DOSDIR=C:\SVARDOS
2524 2.14:Hukommelse opbrugt! (%s)
2625
2726 #### Installing package ####
--- pkg/nls_utf8/pkg_en.txt (revision 612)
+++ pkg/nls_utf8/pkg_en.txt (revision 613)
@@ -2,7 +2,6 @@
22 # PKG language file
33 #
44 # Language..: English
5-# Codepage..: 437
65 # Translator: Mateusz Viste
76 #
87
@@ -16,12 +15,12 @@
1615 1.24: pkg listlocal [filter]
1716 1.27: pkg unzip file.zip
1817 1.25:PKG is published under the MIT license.
19-1.26:It is configured through %DOSDIR%\\CFG\\PKG.CFG
18+1.26:It is configured through %DOSDIR%\CFG\PKG.CFG
2019
2120 ### General stuff ####
2221
2322 2.2:%DOSDIR% not set! You should make it point to the SvarDOS main directory.
24-2.3:Example: SET DOSDIR=C:\\SVARDOS
23+2.3:Example: SET DOSDIR=C:\SVARDOS
2524 2.14:Out of memory! (%s)
2625
2726 #### Installing package ####
--- pkg/nls_utf8/pkg_fr.txt (revision 612)
+++ pkg/nls_utf8/pkg_fr.txt (revision 613)
@@ -2,7 +2,6 @@
22 # FDNPKG language file
33 #
44 # Language..: French
5-# Codepage..: 850
65 # Translator: anonymous
76 #
87
@@ -16,12 +15,12 @@
1615 1.24: pkg listlocal [filter]
1716 1.27: pkg unzip fichier.zip
1817 1.25:PKG est publié sous license MIT.
19-1.26:Cet outil est configurable via %DOSDIR%\\CFG\\PKG.CFG
18+1.26:Cet outil est configurable via %DOSDIR%\CFG\PKG.CFG
2019
2120 ### General stuff ####
2221
2322 2.2:%DOSDIR% non défini! Faites-le pointer vers le répertoire principal de SvarDOS.
24-2.3:Exemple : SET DOSDIR=C:\\SVARDOS
23+2.3:Exemple : SET DOSDIR=C:\SVARDOS
2524 2.14:Mémoire insuffisante! (%s)
2625
2726 #### Installing package ####
--- pkg/nls_utf8/pkg_pl.txt (revision 612)
+++ pkg/nls_utf8/pkg_pl.txt (revision 613)
@@ -2,7 +2,6 @@
22 # PKG language file
33 #
44 # Language..: Polish
5-# Codepage..: MAZOVIA
65 # Translator: Mateusz Viste
76 #
87
@@ -16,12 +15,12 @@
1615 1.24: pkg listlocal [filtr]
1716 1.27: pkg unzip plik.zip
1817 1.25:PKG jest opublikowany na licencji MIT.
19-1.26:Konfiguracja znajduje się w pliku %DOSDIR%\\CFG\\PKG.CFG
18+1.26:Konfiguracja znajduje się w pliku %DOSDIR%\CFG\PKG.CFG
2019
2120 ### General stuff ####
2221
2322 2.2:%DOSDIR% nie ustawione! Ustaw by wskazywało na katalog instalacji SvarDOS.
24-2.3:Przykład: SET DOSDIR=C:\\SVARDOS
23+2.3:Przykład: SET DOSDIR=C:\SVARDOS
2524 2.14:Brak pamięci! (%s)
2625
2726 #### Installing package ####
--- pkg/nls_utf8/pkg_si.txt (revision 612)
+++ pkg/nls_utf8/pkg_si.txt (revision 613)
@@ -4,7 +4,6 @@
44 # Language..: Slovene
55 # Translator: Matej Horvat (http://matejhorvat.si/)
66 # Updated...: 2016-12-12
7-# Codepage..: 852
87
98 #### Help ####
109
@@ -16,12 +15,12 @@
1615 1.24: pkg listlocal [filter]
1716 1.27: pkg unzip file.zip
1817 1.25:PKG is published under the MIT license.
19-1.26:It is configured through %DOSDIR%\\CFG\\PKG.CFG
18+1.26:It is configured through %DOSDIR%\CFG\PKG.CFG
2019
2120 ### General stuff ####
2221
2322 2.0:Spremenljivka TEMP ni nastavljena! Kaže naj na imenik, kamor se da pisati.
24-2.3:Primer: SET DOSDIR=C:\\SVARDOS
23+2.3:Primer: SET DOSDIR=C:\SVARDOS
2524 2.14:Ni dovolj spomina! (%s)
2625
2726 #### Installing package ####
--- pkg/nls_utf8/pkg_tr.txt (revision 612)
+++ pkg/nls_utf8/pkg_tr.txt (revision 613)
@@ -2,7 +2,6 @@
22 # FDNPKG language file
33 #
44 # Language..: Turkish
5-# Codepage..: 857
65 # Translator: anonymous
76 #
87
@@ -16,12 +15,12 @@
1615 1.24: pkg listlocal [filter]
1716 1.27: pkg unzip file.zip
1817 1.25:PKG is published under the MIT license.
19-1.26:It is configured through %DOSDIR%\\CFG\\PKG.CFG
18+1.26:It is configured through %DOSDIR%\CFG\PKG.CFG
2019
2120 ### General stuff ####
2221
2322 2.2:%DOSDIR% ayarlanmamış! Onun SvarDOS ana dizinine işaret etmesi gerekir.
24-2.3:Örnek: SET DOSDIR=C:\\SVARDOS
23+2.3:Örnek: SET DOSDIR=C:\SVARDOS
2524 2.14:Bellek yetersiz! (%s)
2625
2726 #### Installing package ####
--- pkg/Makefile (revision 612)
+++ pkg/Makefile (revision 613)
@@ -5,7 +5,7 @@
55
66 CFLAGS = -0 -mc -os -wx -we -d0 -i=zlib
77 LDFLAGS = -lr -fe=pkg.exe
8-LIBS = zlib\zlib_c.lib
8+LIBS = zlib\zlib_c.lib svarlang.lib\svarlngc.lib
99
1010 all: pkg.exe
1111
@@ -13,25 +13,32 @@
1313 mkdir appinfo
1414 mkdir bin
1515 mkdir nls
16- copy nls_utf8\pkg_en.txt nls\pkg.en
17- utf8tocp 850 nls_utf8\pkg_de.txt > nls\pkg.de
18- utf8tocp 850 nls_utf8\pkg_fr.txt > nls\pkg.fr
19- utf8tocp 850 nls_utf8\pkg_dk.txt > nls\pkg.dk
20- utf8tocp 852 nls_utf8\pkg_si.txt > nls\pkg.si
21- utf8tocp 857 nls_utf8\pkg_tr.txt > nls\pkg.tr
22- utf8tocp maz nls_utf8\pkg_pl.txt > nls\pkg.pl
16+ copy pkg.lng nls
2317 upx --8086 -9 pkg.exe -o bin\pkg.exe
2418 copy pkg.lsm appinfo
25- zip -9moDkr pkg.zip appinfo bin nls
19+ zip -9moDkrX pkg.zip appinfo bin nls
2620 rmdir appinfo
2721 rmdir bin
2822 rmdir nls
2923
30-pkg.exe: kitten.obj main.obj crc32.obj fileexst.obj helpers.obj inf.obj kprintf.obj libunzip.obj loadconf.obj lsm.obj pkginst.obj pkgrem.obj trim.obj showinst.obj unzip.obj
24+pkg.exe: main.obj crc32.obj fileexst.obj helpers.obj inf.obj kprintf.obj libunzip.obj loadconf.obj lsm.obj pkginst.obj pkgrem.obj trim.obj showinst.obj unzip.obj deflang.obj
3125 wcl $(LDFLAGS) $(LIBS) *.obj
3226
33-kitten.obj: kitten\kitten.c
34- wcc $(CFLAGS) kitten\kitten.c
27+deflang.obj: nls_utf8\pkg_en.txt
28+ cd nls_utf8
29+ copy pkg_en.txt en.txt
30+ utf8tocp 850 pkg_de.txt > de.txt
31+ utf8tocp 850 pkg_fr.txt > fr.txt
32+ utf8tocp 850 pkg_dk.txt > dk.txt
33+ utf8tocp 852 pkg_si.txt > si.txt
34+ utf8tocp 857 pkg_tr.txt > tr.txt
35+ utf8tocp maz pkg_pl.txt > pl.txt
36+ ..\svarlang.lib\tlumacz en de fr dk si tr pl
37+ move out.lng ..\pkg.lng
38+ move deflang.c ..
39+ del ??.txt
40+ cd ..
41+ wcc $(CFLAGS) deflang.c
3542
3643 main.obj: main.c
3744 wcc $(CFLAGS) main.c
--- pkg/kprintf.c (revision 612)
+++ pkg/kprintf.c (revision 613)
@@ -2,23 +2,19 @@
22 * This file provides dummy functions that simulate kitten-enabled routines
33 * without actually having kitten.
44 *
5- * Copyright (C) 2015-2021 Mateusz Viste
5+ * Copyright (C) 2015-2022 Mateusz Viste
66 */
77
88 #include <stdio.h> /* vprintf() */
99 #include <stdarg.h> /* va_list, va_start()... */
1010
11-#include "kitten/kitten.h"
11+#include "svarlang.lib\svarlang.h"
1212
1313 #include "kprintf.h"
1414
15-void kitten_printf(short x, short y, char *fmt, ...) {
15+void kitten_printf(short x, short y, ...) {
1616 va_list args;
17- va_start(args, fmt);
18- vprintf(kittengets(x, y, fmt), args);
17+ va_start(args, y);
18+ vprintf(svarlang_str(x, y), args);
1919 va_end(args);
2020 }
21-
22-void kitten_puts(short x, short y, char *fmt) {
23- puts(kittengets(x, y, fmt));
24-}
--- pkg/kprintf.h (revision 612)
+++ pkg/kprintf.h (revision 613)
@@ -6,7 +6,6 @@
66 #ifndef kprintf_sentinel
77 #define kprintf_sentinel
88
9-void kitten_printf(short x, short y, char *fmt, ...);
10-void kitten_puts(short x, short y, char *fmt);
9+void kitten_printf(short x, short y, ...);
1110
1211 #endif
--- pkg/libunzip.c (revision 612)
+++ pkg/libunzip.c (revision 613)
@@ -88,7 +88,7 @@
8888 /* create new entry and link it into the list */
8989 newentry = calloc(sizeof(struct ziplist) + filenamelen, 1);
9090 if (newentry == NULL) {
91- kitten_printf(2, 14, "Out of memory! (%s)", "libunzip");
91+ kitten_printf(2, 14, "libunzip"); /* "Out of memory! (%s)" */
9292 puts("");
9393 zip_freelist(&reslist);
9494 break;
@@ -149,7 +149,7 @@
149149 /* no need to read the header we just have to skip it */
150150 fseek(fd, 12, SEEK_CUR); /* the header is 3x4 bytes (CRC + compressed len + uncompressed len) */
151151 } else { /* unknown sig */
152- kitten_printf(8, 1, "unknown zip sig: 0x%08lx", entrysig);
152+ kitten_printf(8, 1, entrysig); /* "unknown zip sig: 0x%08lx" */
153153 puts("");
154154 zip_freelist(&reslist);
155155 break;
--- pkg/loadconf.c (revision 612)
+++ pkg/loadconf.c (revision 613)
@@ -29,7 +29,7 @@
2929 for (; dirlist != NULL; dirlist = dirlist->next) {
3030 for (curpos = dirlist->next; curpos != NULL; curpos = curpos->next) {
3131 if (strcasecmp(curpos->name, dirlist->name) == 0) {
32- kitten_printf(7, 0, "ERROR: custom dir '%s' is listed twice!", curpos->name);
32+ kitten_printf(7, 0, curpos->name); /* "ERROR: custom dir '%s' is listed twice!" */
3333 puts("");
3434 return(-1);
3535 }
@@ -44,7 +44,7 @@
4444 for (; dirlist != NULL; dirlist = dirlist->next) {
4545 /* the location must be at least 3 characters long to be a valid absolute path (like 'c:\')*/
4646 if (strlen(dirlist->location) < 3) {
47- kitten_printf(7, 15, "ERROR: custom dir '%s' is not a valid absolute path!", dirlist->name);
47+ kitten_printf(7, 15, dirlist->name); /* "ERROR: custom dir '%s' is not a valid absolute path!" */
4848 puts("");
4949 return(-1);
5050 }
@@ -52,7 +52,7 @@
5252 if ((dirlist->location[1] != ':') ||
5353 ((dirlist->location[2] != '/') && (dirlist->location[2] != '\\')) ||
5454 (((dirlist->location[0] < 'a') || (dirlist->location[0] > 'z')) && ((dirlist->location[0] < 'A') || (dirlist->location[0] > 'Z')))) {
55- kitten_printf(7, 15, "ERROR: custom dir '%s' is not a valid absolute path!", dirlist->name);
55+ kitten_printf(7, 15, dirlist->name); /* "ERROR: custom dir '%s' is not a valid absolute path!" */
5656 puts("");
5757 return(-1);
5858 }
@@ -63,7 +63,7 @@
6363 (strcasecmp(dirlist->name, "help") == 0) ||
6464 (strcasecmp(dirlist->name, "nls") == 0) ||
6565 (strcasecmp(dirlist->name, "packages") == 0)) {
66- kitten_printf(7, 16, "ERROR: custom dir '%s' is a reserved name!", dirlist->name);
66+ kitten_printf(7, 16, dirlist->name); /* "ERROR: custom dir '%s' is a reserved name!" */
6767 puts("");
6868 return(-1);
6969 }
@@ -96,7 +96,7 @@
9696 snprintf(token, sizeof(token), "%s\\cfg\\pkg.cfg", dosdir);
9797 fd = fopen(token, "r");
9898 if (fd == NULL) {
99- kitten_printf(7, 1, "ERROR: Could not open config file (%s)!", token);
99+ kitten_printf(7, 1, token); /* "ERROR: Could not open config file (%s)!" */
100100 puts("");
101101 return(-1);
102102 }
@@ -111,7 +111,7 @@
111111 if ((token[0] == '#') || (token[0] == 0)) continue;
112112
113113 if ((value == NULL) || (value[0] == 0)) {
114- kitten_printf(7, 4, "Warning: token with empty value on line #%d", nline);
114+ kitten_printf(7, 4, nline); /* "Warning: token with empty value on line #%d" */
115115 puts("");
116116 continue;
117117 }
@@ -123,7 +123,7 @@
123123 /* find nearer space */
124124 for (i = 0; (value[i] != ' ') && (value[i] != 0); i++);
125125 if (value[i] == 0) {
126- kitten_printf(7, 11, "Warning: Invalid 'DIR' directive found at line #%d", nline);
126+ kitten_printf(7, 11, nline); /* "Warning: Invalid 'DIR' directive found at line #%d" */
127127 puts("");
128128 continue;
129129 }
@@ -135,7 +135,7 @@
135135 removeDoubleBackslashes(location);
136136 if (location[strlen(location) - 1] != '\\') strcat(location, "\\"); /* make sure to end dirs with a backslash */
137137 if (addnewdir(dirlist, value, location) != 0) {
138- kitten_printf(2, 14, "Out of memory! (%s)", "addnewdir");
138+ kitten_printf(2, 14, "addnewdir"); /* "Out of memory! (%s)" */
139139 puts("");
140140 freeconf(dirlist);
141141 fclose(fd);
@@ -142,7 +142,7 @@
142142 return(-1);
143143 }
144144 } else { /* unknown token */
145- kitten_printf(7, 8, "Warning: Unknown token '%s' at line #%d", token, nline);
145+ kitten_printf(7, 8, token, nline); /* "Warning: Unknown token '%s' at line #%d" */
146146 puts("");
147147 }
148148 }
--- pkg/main.c (revision 612)
+++ pkg/main.c (revision 613)
@@ -3,7 +3,7 @@
33 *
44 * PUBLISHED UNDER THE TERMS OF THE MIT LICENSE
55 *
6- * COPYRIGHT (C) 2016-2021 MATEUSZ VISTE, ALL RIGHTS RESERVED.
6+ * COPYRIGHT (C) 2016-2022 MATEUSZ VISTE, ALL RIGHTS RESERVED.
77 *
88 * Permission is hereby granted, free of charge, to any person obtaining a
99 * copy of this software and associated documentation files (the "Software"),
@@ -29,7 +29,7 @@
2929 #include <stdlib.h> /* malloc() and friends */
3030 #include <string.h> /* strcasecmp() */
3131
32-#include "kitten/kitten.h"
32+#include "svarlang.lib/svarlang.h"
3333 #include "kprintf.h"
3434 #include "libunzip.h"
3535 #include "pkginst.h"
@@ -53,17 +53,17 @@
5353 static int showhelp(void) {
5454 puts("PKG ver " PVER " Copyright (C) " PDATE " Mateusz Viste");
5555 puts("");
56- kitten_puts(1, 0, "PKG is the package installer for SvarDOS.");
56+ puts(svarlang_str(1, 0)); /* "PKG is the package installer for SvarDOS." */
5757 puts("");
58- kitten_puts(1, 20, "Usage: pkg install package.zip");
59- kitten_puts(1, 21, " pkg update package.zip");
60- kitten_puts(1, 22, " pkg remove package");
61- kitten_puts(1, 23, " pkg listfiles package");
62- kitten_puts(1, 24, " pkg listlocal [filter]");
63- kitten_puts(1, 27, " pkg unzip file.zip");
58+ puts(svarlang_str(1, 20)); /* "Usage: pkg install package.zip */
59+ puts(svarlang_str(1, 21)); /* " pkg update package.zip" */
60+ puts(svarlang_str(1, 22)); /* " pkg remove package" */
61+ puts(svarlang_str(1, 23)); /* " pkg listfiles package" */
62+ puts(svarlang_str(1, 24)); /* " pkg listlocal [filter]" */
63+ puts(svarlang_str(1, 27)); /* " pkg unzip file.zip" */
6464 puts("");
65- kitten_puts(1, 25, "PKG is published under the MIT license.");
66- kitten_puts(1, 26, "It is configured through %DOSDIR%\\CFG\\PKG.CFG");
65+ puts(svarlang_str(1, 25)); /* "PKG is published under the MIT license." */
66+ puts(svarlang_str(1, 26)); /* "It is configured through %DOSDIR%\CFG\PKG.CFG" */
6767 return(1);
6868 }
6969
@@ -108,7 +108,7 @@
108108 if (lastdot <= lastpathdelim) lastdot = t; /* a dot before last path delimiters is not an extension prefix */
109109 t = lastdot - (lastpathdelim + 1);
110110 if (t + 1 > sizeof(pkgname)) {
111- kitten_puts(3, 24, "ERROR: package name too long");
111+ puts(svarlang_str(3, 24)); /* "ERROR: package name too long" */
112112 return(1);
113113 }
114114 memcpy(pkgname, file + lastpathdelim + 1, t);
@@ -131,7 +131,7 @@
131131 const char *dosdir;
132132 struct customdirs *dirlist;
133133
134- kittenopen("pkg"); /* NLS init */
134+ svarlang_autoload("pkg"); /* NLS init */
135135
136136 action = parsearg(argc, argv);
137137 if (action == ACTION_HELP) {
@@ -142,8 +142,8 @@
142142 /* read the DOSDIR environment variable */
143143 dosdir = getenv("DOSDIR");
144144 if (dosdir == NULL) {
145- kitten_puts(2, 2, "%DOSDIR% not set! You should make it point to the FreeDOS main directory.");
146- kitten_puts(2, 3, "Example: SET DOSDIR=C:\\FDOS");
145+ puts(svarlang_str(2, 2)); /* "%DOSDIR% not set! You should make it point to the FreeDOS main directory." */
146+ puts(svarlang_str(2, 3)); /* "Example: SET DOSDIR=C:\FDOS" */
147147 goto GAMEOVER;
148148 }
149149
@@ -173,7 +173,6 @@
173173 }
174174
175175 GAMEOVER:
176- kittenclose(); /* NLS de-init */
177176 if (res != 0) return(1);
178177 return(0);
179178 }
--- pkg/pkginst.c (revision 612)
+++ pkg/pkginst.c (revision 613)
@@ -1,6 +1,6 @@
11 /*
22 * This file is part of pkg (SvarDOS)
3- * Copyright (C) 2012-2021 Mateusz Viste
3+ * Copyright (C) 2012-2022 Mateusz Viste
44 */
55
66 #include <ctype.h> /* toupper() */
@@ -15,6 +15,7 @@
1515 #include "kprintf.h"
1616 #include "libunzip.h" /* zip_listfiles()... */
1717 #include "showinst.h" /* pkg_loadflist() */
18+#include "svarlang.lib\svarlang.h"
1819
1920 #include "pkginst.h" /* include self for control */
2021
@@ -75,7 +76,7 @@
7576 /* checks that pkgname is NOT installed. return 0 on success, non-zero otherwise. */
7677 static int validate_package_not_installed(const char *pkgname, const char *dosdir) {
7778 if (is_package_installed(pkgname, dosdir) != 0) {
78- kitten_printf(3, 18, "Package %s is already installed! You might want to use the 'update' action.", pkgname);
79+ kitten_printf(3, 18, pkgname); /* "Package %s is already installed! You might want to use the 'update' action." */
7980 puts("");
8081 return(-1);
8182 }
@@ -115,12 +116,12 @@
115116
116117 *zipfd = fopen(zipfile, "rb");
117118 if (*zipfd == NULL) {
118- kitten_puts(3, 8, "ERROR: Invalid zip archive! Package not installed.");
119+ puts(svarlang_str(3, 8)); /* "ERROR: Invalid zip archive! Package not installed." */
119120 goto RAII;
120121 }
121122 ziplinkedlist = zip_listfiles(*zipfd);
122123 if (ziplinkedlist == NULL) {
123- kitten_puts(3, 8, "ERROR: Invalid zip archive! Package not installed.");
124+ puts(svarlang_str(3, 8)); /* "ERROR: Invalid zip archive! Package not installed." */
124125 goto RAII;
125126 }
126127 /* if updating, load the list of files belonging to the current package */
@@ -157,7 +158,7 @@
157158 }
158159 /* validate that the file has a valid filename (8+3, no shady chars...) */
159160 if (validfilename(curzipnode->filename) != 0) {
160- kitten_puts(3, 23, "ERROR: Package contains an invalid filename:");
161+ puts(svarlang_str(3, 23)); /* "ERROR: Package contains an invalid filename:" */
161162 printf(" %s\n", curzipnode->filename);
162163 goto RAII_ERR;
163164 }
@@ -166,20 +167,19 @@
166167 shortfile = computelocalpath(curzipnode->filename, fname, dosdir, dirlist);
167168 strcat(fname, shortfile);
168169 if ((findfileinlist(flist, fname) == NULL) && (fileexists(fname) != 0)) {
169- kitten_puts(3, 9, "ERROR: Package contains a file that already exists locally:");
170+ puts(svarlang_str(3, 9)); /* "ERROR: Package contains a file that already exists locally:" */
170171 printf(" %s\n", fname);
171172 goto RAII_ERR;
172173 }
173174 /* abort if any entry is encrypted */
174175 if ((curzipnode->flags & ZIP_FLAG_ENCRYPTED) != 0) {
175- kitten_printf(3, 20, "ERROR: Package contains an encrypted file:");
176- puts("");
176+ puts(svarlang_str(3, 20)); /* "ERROR: Package contains an encrypted file:" */
177177 printf(" %s\n", curzipnode->filename);
178178 goto RAII_ERR;
179179 }
180180 /* abort if any file is compressed with an unsupported method */
181181 if ((curzipnode->compmethod != ZIP_METH_STORE) && (curzipnode->compmethod != ZIP_METH_DEFLATE)) { /* unsupported compression method */
182- kitten_printf(8, 2, "ERROR: Package contains a file compressed with an unsupported method (%d):", curzipnode->compmethod);
182+ kitten_printf(8, 2, curzipnode->compmethod); /* "ERROR: Package contains a file compressed with an unsupported method (%d):" */
183183 puts("");
184184 printf(" %s\n", curzipnode->filename);
185185 goto RAII_ERR;
@@ -190,7 +190,7 @@
190190 }
191191 /* if appinfo file not found, this is not a real FreeDOS package */
192192 if (appinfopresence != 1) {
193- kitten_printf(3, 12, "ERROR: Package do not contain the %s file! Not a valid FreeDOS package.", appinfofile);
193+ kitten_printf(3, 12, appinfofile); /* "ERROR: Package do not contain the %s file! Not a valid SvarDOS package." */
194194 puts("");
195195 goto RAII_ERR;
196196 }
@@ -232,7 +232,7 @@
232232 sprintf(buff, "%s\\%s", dosdir, packageslst);
233233 lstfd = fopen(buff, "wb"); /* opening it in binary mode, because I like to have control over line terminators (CR/LF) */
234234 if (lstfd == NULL) {
235- kitten_printf(3, 10, "ERROR: Could not create %s!", buff);
235+ kitten_printf(3, 10, buff); /* "ERROR: Could not create %s!" */
236236 puts("");
237237 return(-2);
238238 }
@@ -250,7 +250,7 @@
250250 /* Now unzip the file */
251251 unzip_result = zip_unzip(zipfd, curzipnode, fulldestfilename);
252252 if (unzip_result != 0) {
253- kitten_printf(8, 3, "ERROR: failed extracting '%s' to '%s'!", curzipnode->filename, fulldestfilename);
253+ kitten_printf(8, 3, curzipnode->filename, fulldestfilename); /* "ERROR: failed extracting '%s' to '%s'!" */
254254 printf(" [%d]\n", unzip_result);
255255 filesextractedfailure += 1;
256256 } else {
@@ -260,7 +260,7 @@
260260 }
261261 fclose(lstfd);
262262
263- kitten_printf(3, 19, "Package %s installed: %ld files extracted, %ld errors.", pkgname, filesextractedsuccess, filesextractedfailure);
263+ kitten_printf(3, 19, pkgname, filesextractedsuccess, filesextractedfailure); /* "Package %s installed: %ld files extracted, %ld errors." */
264264 puts("");
265265 return(filesextractedfailure);
266266 }
--- pkg/pkgrem.c (revision 612)
+++ pkg/pkgrem.c (revision 613)
@@ -1,6 +1,6 @@
11 /*
22 * This file is part of the pkg (SvarDOS) project.
3- * Copyright (C) Mateusz Viste 2012-2021
3+ * Copyright (C) Mateusz Viste 2012-2022
44 */
55
66 #include <ctype.h> /* toupper() */
@@ -32,7 +32,7 @@
3232 /* not in the list yet - add it */
3333 res = malloc(sizeof(struct dirliststruct) + strlen(path));
3434 if (res == NULL) { /* out of memory */
35- kitten_printf(4, 3, "Out of memory! Could not store directory %s!", path);
35+ kitten_printf(4, 3, path); /* "Out of memory! Could not store directory %s!" */
3636 puts("");
3737 return(NULL);
3838 }
@@ -74,7 +74,7 @@
7474 sprintf(fpath, "%s\\packages\\%s.lst", dosdir, pkgname);
7575 flist = fopen(fpath, "rb");
7676 if (flist == NULL) {
77- kitten_printf(4, 0, "Package %s is not installed, so not removed.", pkgname);
77+ kitten_printf(4, 0, pkgname); /* "Package %s is not installed, so not removed." */
7878 puts("");
7979 return(-1);
8080 }
@@ -103,7 +103,7 @@
103103 if (strcasecmp(buff, fpath) == 0) continue;
104104
105105 /* remove it */
106- kitten_printf(4, 4, "removing %s", buff);
106+ kitten_printf(4, 4, buff); /* "removing %s" */
107107 puts("");
108108 unlink(buff);
109109 }
@@ -136,7 +136,7 @@
136136
137137 /* remove the lst file */
138138 unlink(fpath);
139- kitten_printf(4, 5, "Package %s has been removed.", pkgname);
139+ kitten_printf(4, 5, pkgname); /* "Package %s has been removed." */
140140 puts("");
141141 return(0);
142142 }
--- pkg/showinst.c (revision 612)
+++ pkg/showinst.c (revision 613)
@@ -1,6 +1,6 @@
11 /*
22 * This file is part of PKG (SvarDOS)
3- * Copyright (C) 2013-2021 Mateusz Viste
3+ * Copyright (C) 2013-2022 Mateusz Viste
44 */
55
66 #include <stdio.h>
@@ -14,6 +14,7 @@
1414 #include "kprintf.h"
1515 #include "libunzip.h" /* zip_freelist()... */
1616 #include "lsm.h"
17+#include "svarlang.lib\svarlang.h"
1718
1819 #include "showinst.h" /* include self for control */
1920
@@ -28,7 +29,7 @@
2829 sprintf(buff, "%s\\packages", dosdir);
2930 dp = opendir(buff);
3031 if (dp == NULL) {
31- kitten_printf(9, 0, "ERROR: Could not access directory %s", buff);
32+ kitten_printf(9, 0, buff); /* "ERROR: Could not access directory %s" */
3233 puts("");
3334 return(-1);
3435 }
@@ -52,7 +53,7 @@
5253 puts("");
5354 matchfound = 1;
5455 }
55- if (matchfound == 0) kitten_puts(5, 0, "No package matched the search.");
56+ if (matchfound == 0) puts(svarlang_str(5, 0)); /* "No package matched the search." */
5657
5758 closedir(dp);
5859 return(0);
@@ -78,7 +79,7 @@
7879 sprintf(buff, "%s\\packages\\%s.lst", dosdir, pkgname);
7980 fd = fopen(buff, "rb");
8081 if (fd == NULL) {
81- kitten_printf(9, 1, "ERROR: Local package '%s' not found.", pkgname);
82+ kitten_printf(9, 1, pkgname); /* "ERROR: Local package '%s' not found." */
8283 puts("");
8384 return(NULL);
8485 }
@@ -90,7 +91,7 @@
9091 /* add the new node to the result */
9192 newnode = malloc(sizeof(struct flist_t) + strlen(buff));
9293 if (newnode == NULL) {
93- kitten_printf(2, 14, "Out of memory! (%s)", "malloc failure");
94+ kitten_printf(2, 14, "malloc failure"); /* "Out of memory! (%s)" */
9495 continue;
9596 }
9697 newnode->next = res;
--- pkg/unzip.c (revision 612)
+++ pkg/unzip.c (revision 613)
@@ -3,7 +3,7 @@
33 * returns 0 on success
44 *
55 * this file is part of pkg (SvarDOS)
6- * copyright (C) 2021 Mateusz Viste
6+ * copyright (C) 2021-2022 Mateusz Viste
77 */
88
99 #include <stdio.h>
@@ -12,6 +12,7 @@
1212 #include "helpers.h"
1313 #include "kprintf.h"
1414 #include "libunzip.h"
15+#include "svarlang.lib\svarlang.h"
1516
1617 #include "unzip.h"
1718
@@ -23,13 +24,13 @@
2324
2425 fd = fopen(zipfile, "rb");
2526 if (fd == NULL) {
26- kitten_puts(10, 1, "ERROR: Failed to open the archive file");
27+ puts(svarlang_str(10, 1)); /* "ERROR: Failed to open the archive file" */
2728 return(1);
2829 }
2930
3031 zlist = zip_listfiles(fd);
3132 if (zlist == NULL) {
32- kitten_puts(10, 2, "ERROR: Invalid ZIP archive");
33+ puts(svarlang_str(10, 2)); /* "ERROR: Invalid ZIP archive" */
3334 fclose(fd);
3435 return(-1);
3536 }
@@ -47,7 +48,7 @@
4748 if (znode->flags == ZIP_FLAG_ISADIR) goto OK;
4849 /* file already exists? */
4950 if (fileexists(znode->filename) != 0) {
50- kitten_puts(10, 3, "ERROR: File already exists");
51+ puts(svarlang_str(10, 3)); /* "ERROR: File already exists" */
5152 r = 1;
5253 continue;
5354 }
@@ -59,7 +60,7 @@
5960 continue;
6061 }
6162 OK:
62- kitten_puts(10, 0, "OK");
63+ puts(svarlang_str(10, 0)); /* "OK" */
6364 }
6465
6566 zip_freelist(&zlist);
--- pkg/version.h (revision 612)
+++ pkg/version.h (revision 613)
@@ -4,7 +4,7 @@
44 #ifndef COMMON_H_SENTINEL
55 #define COMMON_H_SENTINEL
66
7-#define PVER "20210212"
8-#define PDATE "2012-2021"
7+#define PVER "20220203"
8+#define PDATE "2012-2022"
99
1010 #endif
Show on old repository browser