From 20624adcae505d8bdb321cb63531d21830cdb76d Mon Sep 17 00:00:00 2001 From: Edward Emelianov Date: Fri, 31 Oct 2025 09:08:33 +0300 Subject: [PATCH] fixed for new usefull_macros --- bta_print_header/btaprinthdr.creator.user | 51 +++++++++++++++++++---- bta_print_header/cmdlnopts.c | 6 +-- bta_print_header/main.c | 8 ++-- 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/bta_print_header/btaprinthdr.creator.user b/bta_print_header/btaprinthdr.creator.user index ddfdfe4..4d57af9 100644 --- a/bta_print_header/btaprinthdr.creator.user +++ b/bta_print_header/btaprinthdr.creator.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -13,8 +13,8 @@ ProjectExplorer.Project.EditorSettings + true true - false true Cpp @@ -94,6 +94,7 @@ ProjectExplorer.Project.Target.0 Desktop + true Desktop Desktop {91347f2c-5221-46a7-80b1-0a054ca02f79} @@ -111,8 +112,8 @@ GenericProjectManager.GenericMakeStep 1 - Сборка - Сборка + Build + Build ProjectExplorer.BuildSteps.Build @@ -124,8 +125,8 @@ GenericProjectManager.GenericMakeStep 1 - Очистка - Очистка + Clean + Clean ProjectExplorer.BuildSteps.Clean 2 @@ -135,13 +136,47 @@ По умолчанию GenericProjectManager.GenericBuildConfiguration + 0 + 0 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + true + true + + + 2 + + false + -e cpu-cycles --call-graph dwarf,4096 -F 250 + + ProjectExplorer.CustomExecutableRunConfiguration + + false + true + true + + 1 1 0 - Развёртывание - Развёртывание + Deploy + Deploy ProjectExplorer.BuildSteps.Deploy 1 diff --git a/bta_print_header/cmdlnopts.c b/bta_print_header/cmdlnopts.c index 984e0cf..0921685 100644 --- a/bta_print_header/cmdlnopts.c +++ b/bta_print_header/cmdlnopts.c @@ -41,7 +41,7 @@ glob_pars const Gdefault = { * Define command line options by filling structure: * name has_arg flag val type argptr help */ -myoption cmdlnopts[] = { +sl_option_t cmdlnopts[] = { {"help", NO_ARGS, NULL, 'h', arg_none, APTR(&help), N_("show this help")}, {"out", NEED_ARG, NULL, 'o', arg_string, APTR(&G.outfile), N_("output file name")}, {"refresh", NEED_ARG, NULL, 'r', arg_double, APTR(&G.refresh), N_("refresh rate (0.1-30s; default: 0.5)")}, @@ -61,8 +61,8 @@ glob_pars *parse_args(int argc, char **argv){ void *ptr; ptr = memcpy(&G, &Gdefault, sizeof(G)); assert(ptr); // parse arguments - parseargs(&argc, &argv, cmdlnopts); - if(help) showhelp(-1, cmdlnopts); + sl_parseargs(&argc, &argv, cmdlnopts); + if(help) sl_showhelp(-1, cmdlnopts); if(argc > 0){ G.outfile = strdup(argv[0]); if(argc > 1){ diff --git a/bta_print_header/main.c b/bta_print_header/main.c index 6d40016..79c3ec1 100644 --- a/bta_print_header/main.c +++ b/bta_print_header/main.c @@ -50,7 +50,7 @@ void signals(int signo){ int main(int argc, char **argv){ char *self = strdup(argv[0]); - initial_setup(); + sl_init(); G = parse_args(argc, argv); if(!G->outfile){ ERRX("Point output file name"); @@ -61,7 +61,7 @@ int main(int argc, char **argv){ FILE *f = fopen(G->outfile, "w"); if(!f) ERRX("Can't create file %s", G->outfile); fclose(f); unlink(G->outfile); - check4running(self, G->pidfile); + sl_check4running(self, G->pidfile); signal(SIGINT, signals); signal(SIGQUIT, signals); signal(SIGABRT, signals); @@ -74,9 +74,9 @@ int main(int argc, char **argv){ while(1){ childpid = fork(); if(childpid){ // master - double t0 = dtime(); + double t0 = sl_dtime(); wait(NULL); - if(dtime() - t0 < 1.) pause += 5; + if(sl_dtime() - t0 < 1.) pause += 5; else pause = 1; if(pause > 900) pause = 900; sleep(pause); // wait a little before respawn