diff --git a/cpp/tex_parser/tex_table_class.geany b/cpp/tex_parser/tex_table_class.geany index 622db3d..ab141e9 100644 --- a/cpp/tex_parser/tex_table_class.geany +++ b/cpp/tex_parser/tex_table_class.geany @@ -17,14 +17,14 @@ long_line_column=72 [files] current_page=6 -FILE_NAME_0=176;C++;0;61;1;1;1;/home/kolan/dev/cpp/tex_parser/tex_table_class_test.cpp;0 -FILE_NAME_1=1332;Make;0;61;1;1;1;/home/kolan/dev/cpp/tex_parser/Makefile;0 +FILE_NAME_0=289;C++;0;61;1;1;1;/home/kolan/dev/cpp/tex_parser/tex_table_class_test.cpp;0 +FILE_NAME_1=0;Make;0;61;1;1;1;/home/kolan/dev/cpp/tex_parser/Makefile;0 FILE_NAME_2=0;C++;0;61;1;1;1;/home/kolan/dev/cpp/tex_parser/tex_table_class.cpp;0 FILE_NAME_3=0;C++;0;61;1;1;1;/home/kolan/dev/cpp/tex_parser/tex_table_class.hpp;0 FILE_NAME_4=0;C++;0;61;1;1;1;/home/kolan/dev/cpp/tex_parser/tex_table_class_tags.hpp;0 -FILE_NAME_5=0;C;0;16;1;1;1;/home/kolan/projects/include/xmalloc.c;0 -FILE_NAME_6=679;C;0;16;1;1;1;/home/kolan/projects/include/xmalloc.h;0 -FILE_NAME_7=146;C;0;16;1;1;1;/home/kolan/projects/include/xerror.h;0 +FILE_NAME_5=150;C;0;16;1;1;1;/home/kolan/projects/include/xerror.h;0 +FILE_NAME_6=299;C;0;16;1;1;1;/home/kolan/projects/include/xerror.c;0 +FILE_NAME_7=412;C;0;16;1;1;1;/home/kolan/projects/include/xmalloc.c;0 [build-menu] NF_00_LB=_Сделать diff --git a/cpp/tex_parser/tex_table_class_test.cpp b/cpp/tex_parser/tex_table_class_test.cpp index 61441da..5b52aec 100644 --- a/cpp/tex_parser/tex_table_class_test.cpp +++ b/cpp/tex_parser/tex_table_class_test.cpp @@ -14,23 +14,20 @@ using namespace std; int main(int argc, char *argv[]) { - if (argc != 1) { - die("Usage: ./tex_table_class_test /path/to/table.tex", -1); - } + if (argc != 2) + xerrx(-1, "Usage: ./tex_table_class_test /path/to/table.tex", NULL); FILE *tex_file = fopen(argv[1], "rb"); if (!tex_file) - die("main()", errno); + xerr(errno, "Cannot open %s", argv[1]); struct stat stat_buf; - int result = fstat(fileno(tex_file), &stat_buf); - if (result == -1) - die("main()", errno); + if (fstat(fileno(tex_file), &stat_buf) == -1) + xerr(errno, "Cannot stat %s", argv[1]); char *tex_buf = (char *)xmalloc((size_t)stat_buf.st_size + 1); if (fread(tex_buf, 1, (size_t)stat_buf.st_size, tex_file) != (size_t)stat_buf.st_size) - die("main()", errno); - + xerrx(errno, "Error reading %s", argv[1]); tex_buf[stat_buf.st_size] = 0; fclose(tex_file);