/// Loop period in ms. If loop period = BLC_LOOP_NON_STOP the system is as fast as possible, if it is BLC_LOOP_BLOCK , it is command with return on stdin. If itis BLC_LLOP_THREAD it starts a parrallel thread to interpret command. In this latter case do not use stdin yourself.
voidblc_command_loop_init(longloop_period);
intblc_command_loop_start();
voidblc_command_loop_end();
/**Wait until the blc_loop_stop.
Return the loop_thred pointer (always NULL for now)*/
void*blc_loop_wait_stop();
/** Stop a textual program
* - Send a quitting message with the name of the app on stderr.
* - Send 'q' and flush on stdout if it is a piped output
/** Check wether threre is no more argument to parse. Otherwise publish information and quit.
This should be used after 'blc_program_init', 'blc_program_option_interpret', or 'blc_program_option_interpret_and_print_title' if you do not plan to parse them yourself.*/
color_eprintf(BLC_YELLOW,"'%s' seems blocked on iteration '%d'. The loop has been stopped for more than %ds\n",blc_program_name,iteration,checking_time);
was_stucked=1;
}
elseif(was_stucked){
color_eprintf(BLC_GREEN,"'%s' program restart iteration '%d'.\n",blc_program_name,iteration);
was_stucked=0;
}
}
returnNULL;
}
/// if the parameter is not null we should display the help at each command.
tmp_arg[parameter_read-1]=0;//Remove the last return;
APPEND_ITEM(argv,argc,&tmp_arg);
}
parameter_read=0;
APPEND_ITEM(argv,argc,¶meter_read);
argc--;//The last NULL parameter does not count
}
}
elseEXIT_ON_ERROR("Missing '%s' arguments : %s you must have %d arguments",blc_program_parameters[i].name,blc_program_parameters[i].help,missing_parameters_nb);
tmp_arg[parameter_read-1]=0;//Remove the last return;
APPEND_ITEM(argv,argc,&tmp_arg);
}
parameter_read=0;
APPEND_ITEM(argv,argc,¶meter_read);
argc--;//The last NULL parameter does not count
}
}
elseEXIT_ON_ERROR("Missing '%s' arguments : %s you must have %d arguments",blc_program_parameters[i].name,blc_program_parameters[i].help,missing_parameters_nb);