Subversion Repositories SvarDOS

Rev

Rev 597 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 597 Rev 599
Line 24... Line 24...
24
 
24
 
25
#include <stdio.h>   /* FILE */
25
#include <stdio.h>   /* FILE */
26
#include <stdlib.h>  /* NULL */
26
#include <stdlib.h>  /* NULL */
27
#include <string.h>  /* memcmp(), strcpy() */
27
#include <string.h>  /* memcmp(), strcpy() */
28
 
28
 
29
#include "deflang.c"
-
 
30
 
-
 
31
#include "svarlang.h"
29
#include "svarlang.h"
32
 
30
 
33
 
31
 
-
 
32
/* supplied through DEFLANG.C */
-
 
33
extern char svarlang_mem[];
-
 
34
extern const unsigned short svarlang_memsz;
-
 
35
 
-
 
36
 
34
const char *svarlang_strid(unsigned short id) {
37
const char *svarlang_strid(unsigned short id) {
35
  const char *ptr = svarlang_mem;
38
  const char *ptr = svarlang_mem;
36
  /* find the string id in langblock memory */
39
  /* find the string id in langblock memory */
37
  for (;;) {
40
  for (;;) {
38
    if (((unsigned short *)ptr)[0] == id) {
41
    if (((unsigned short *)ptr)[0] == id) {
Line 84... Line 87...
84
      fseek(fd, buff16[1], SEEK_CUR);
87
      fseek(fd, buff16[1], SEEK_CUR);
85
      continue;
88
      continue;
86
    }
89
    }
87
 
90
 
88
    /* found - but do I have enough memory space? */
91
    /* found - but do I have enough memory space? */
89
    if (buff16[1] >= sizeof(svarlang_mem)) {
92
    if (buff16[1] >= svarlang_memsz) {
90
      fclose(fd);
93
      fclose(fd);
91
      return(-4);
94
      return(-4);
92
    }
95
    }
93
 
96
 
94
    /* load strings */
97
    /* load strings */