2 * Built-in config files
4 * (C) 2006 Joseph H. Allen
6 * This file is part of JOE (Joe's Own Editor)
11 __RCSID("$MirOS: contrib/code/jupp/builtin.c,v 1.6 2017/12/02 02:07:23 tg Exp $");
20 #define zcmp(a,b) strcmp((char *)(a), (char *)(b))
22 JFILE *jfopen(unsigned char *name, const char *mode)
28 xname = strdup((char *)name + 1);
30 while ((x = *name++)) {
31 if (x >= 'A' && x <= 'Z')
32 name[-1] = x - 'A' + 'a';
35 for (x = 0; builtins[x]; x += 2) {
36 if (!zcmp(builtins[x], xname)) {
37 JFILE *j = (JFILE *)joe_malloc(sizeof(JFILE));
39 j->p = builtins[x + 1];
47 FILE *f = fopen((char *)name, (char *)mode);
49 JFILE *j = (JFILE *)joe_malloc(sizeof(JFILE));
68 unsigned char *jfgets(unsigned char *buf,int len,JFILE *f)
71 return (unsigned char *)fgets((char *)buf, len, f->f);
75 for (x = 0; f->p[x] && f->p[x] != '\n'; ++x)
77 if (f->p[x] == '\n') {