# HG changeset patch # User Mychaela Falconia # Date 1510962387 0 # Node ID feb2ee302d2513213e7d1dad2040b53504112a9e # Parent 36922911e6bbbb1463ad64fb531b7f569c91c22f librftab compiles diff -r 36922911e6bb -r feb2ee302d25 librftab/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/librftab/Makefile Fri Nov 17 23:46:27 2017 +0000 @@ -0,0 +1,13 @@ +CC= gcc +CFLAGS= -O2 +OBJS= rftablerd.o rftablewr.o +LIB= librftab.a + +all: ${LIB} + +${LIB}: ${OBJS} + ar rcu $@ ${OBJS} + ranlib $@ + +clean: + rm -f *.[oa] errs diff -r 36922911e6bb -r feb2ee302d25 librftab/rftablerd.c --- a/librftab/rftablerd.c Fri Nov 17 23:43:38 2017 +0000 +++ b/librftab/rftablerd.c Fri Nov 17 23:46:27 2017 +0000 @@ -1,5 +1,7 @@ /* - * Reading RF tables from formatted ASCII files for the rftw command + * Reading RF tables from formatted ASCII files: used for the rftw command + * in fc-tmsh, for the upload-rf-table command in fc-fsio, and in the + * standalone fc-cal2bin utility. */ #include @@ -8,9 +10,7 @@ #include #include #include -#include "localtypes.h" -#include "l1tm.h" -#include "exitcodes.h" +#include "../rvinterf/include/exitcodes.h" #define MAX_FIELDS_PER_LINE 64 @@ -21,7 +21,7 @@ static unsigned line_nfields, line_field_ptr; static char *format; static u_char *writeptr; -static unsigned written_size; +static unsigned written_size, maxsize; static int read_line() @@ -283,7 +283,7 @@ if (!rc) break; number = strtoul(field, 0, 16); - if (written_size >= MAX_RF_TABLE_SIZE) { + if (written_size >= maxsize) { printf("error: raw table %s exceeds maximum size\n", filename); return(ERROR_USAGE); @@ -316,7 +316,7 @@ {0, 0} }; -read_rf_table(filename_arg, rdbuf, format_ret, size_ret) +read_rf_table_ext(filename_arg, rdbuf, allow_large, format_ret, size_ret) char *filename_arg; u_char *rdbuf; char **format_ret; @@ -359,6 +359,10 @@ *format_ret = format; writeptr = rdbuf; written_size = 0; + if (allow_large) + maxsize = 512; + else + maxsize = 128; rc = tp->handler(); fclose(rdfile); if (size_ret)