File: gfnstrings.c

package info (click to toggle)
gretl 2021a-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 57,556 kB
  • sloc: ansic: 394,030; sh: 4,494; makefile: 2,856; cpp: 2,776; xml: 590; perl: 364
file content (35 lines) | stat: -rw-r--r-- 597 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int process_strings (const char *pkg)
{
    char fname[128], line[1024];
    FILE *fp;

    sprintf(fname, "./%s/%s-i18n.c", pkg, pkg);
    fp = fopen(fname, "r");

    if (fp != NULL) {
	while (fgets(line, sizeof line, fp)) {
	    fputs(line, stdout);
	}
	fputc('\n', stdout);
	fclose(fp);
    }

    return 0;
}

int main (int argc, char **argv)
{
    int i, err = 0;

    fputs("/* translatable strings for gretl addons */\n\n", stdout);

    for (i=1; i<argc && !err; i++) {
	err = process_strings(argv[i]);
    }

    return err;
}