本文整理汇总了C++中close_log函数的典型用法代码示例。如果您正苦于以下问题:C++ close_log函数的具体用法?C++ close_log怎么用?C++ close_log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了close_log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(void){
int fd;
init_users();
numberOfUsers=51;
printf("%d\n",create_user(5,"HELLBOY"));
fd=open_log(21,WRITE);
write_log(fd,"Hello guys");
close_log(fd);
fd=open_log(21,READ);
read_log(fd);
close_log(fd);
return 0;
}
示例2: RegisterRobboTotalBases
int RegisterRobboTotalBases()
{
char DIR[1024];
Send("info string Registering TotalBases, please wait...\n");
#ifdef Log
if (WriteLog)
{
log_file = fopen(log_filename, "a");
fprintf(log_file, "info string Registering TotalBases, please wait...\n");
close_log();
}
#endif
DeRegisterRobboTotalBases();
strcpy(TotalBaseDir, TotalDir);
sprintf(DIR, "%s", TotalBaseDir);
GetTotalBase(DIR);
sprintf(DIR, "%s/3", TotalBaseDir);
GetTotalBase(DIR);
sprintf(DIR, "%s/4", TotalBaseDir);
GetTotalBase(DIR);
sprintf(DIR, "%s/5", TotalBaseDir);
GetTotalBase(DIR);
sprintf(DIR, "%s/6", TotalBaseDir);
GetTotalBase(DIR);
sprintf(DIR, "%s/51", TotalBaseDir);
GetTotalBase(DIR);
sprintf(DIR, "%s/42", TotalBaseDir);
GetTotalBase(DIR);
sprintf(DIR, "%s/33", TotalBaseDir);
GetTotalBase(DIR);
sprintf(DIR, "%s/Z", TotalBaseDir);
GetTotalBase(DIR);
sprintf(DIR, "%s/345Z", TotalBaseDir);
GetTotalBase(DIR);
sprintf(DIR, "%s/6Z", TotalBaseDir);
GetTotalBase(DIR);
Send("info string " "%d TotalBases registered\n", NumTotalBases);
#ifdef Log
if (WriteLog)
{
log_file = fopen(log_filename, "a");
fprintf(log_file, "info string " "%d TotalBases registered\n", NumTotalBases);
close_log();
}
#endif
TotalBasesLoaded = true;
return true;
}
示例3: main
int main(int argc, const char *argv[])
{
int i;
if (!al_init()) {
abort_example("Could not init Allegro.\n");
}
open_log_monospace();
if (argc < 2) {
for (i = 1; i < NUM_TESTS; i++) {
log_printf("# t%d\n\n", i);
all_tests[i]();
log_printf("\n");
}
}
else {
i = atoi(argv[1]);
if (i > 0 && i < NUM_TESTS) {
all_tests[i]();
}
}
close_log(true);
if (error) {
exit(EXIT_FAILURE);
}
return 0;
}
示例4: main
int main(int argc, char **argv)
{
int i;
if (!al_init()) {
abort_example("Could not init Allegro.\n");
}
open_log_monospace();
log_printf("%-36s %-6s %8s %8s %8s %8s\n",
"name", "flags", "ctime", "mtime", "atime", "size");
log_printf(
"------------------------------------ "
"------ "
"-------- "
"-------- "
"-------- "
"--------\n");
if (argc == 1) {
ALLEGRO_FS_ENTRY *entry = al_create_fs_entry("data");
print_entry(entry);
al_destroy_fs_entry(entry);
}
for (i = 1; i < argc; i++) {
ALLEGRO_FS_ENTRY *entry = al_create_fs_entry(argv[i]);
print_entry(entry);
al_destroy_fs_entry(entry);
}
close_log(true);
return 0;
}
示例5: fatal
/*
* Print error message and exit program.
*/
void
fatal(unsigned int errnum, const char *fmt,...)
{
va_list args;
list *l;
session *s;
va_start(args, fmt);
fprintf(stderr, "imapfilter: ");
vfprintf(stderr, fmt, args);
va_end(args);
if (logfp) {
va_start(args, fmt);
fprintf(logfp, "%s: ", log_time());
vfprintf(logfp, fmt, args);
fflush(logfp);
va_end(args);
}
for (l = sessions; l; l = l->next) {
s = l->data;
close_connection(s);
}
close_log();
close_debug();
exit(errnum);
}
示例6: acid_reload
void acid_reload(const char *reason)
{
close_log();
init_log() ;
info_log("Reload: %s\n",reason) ;
read_user_data();
}
示例7: log_rotate
void log_rotate()
{
static char from[256];
static char to[256];
memset(from,0,256);
memset(to,0,256);
int i = LOG_ROTATE_NUMBER;
while(i){
snprintf(from, 256, "%s.%d", DEBUG_LOG_FILE, i - 1);
snprintf(to, 256, "%s.%d", DEBUG_LOG_FILE, i);
rename(from, to);
i--;
}
#ifdef __THREAD_SAFE__
//pthread_mutex_lock(&l_mutex);
#endif
close_log();
rename(DEBUG_LOG_FILE, from);
open_log();
#ifdef __THREAD_SAFE__
//pthread_mutex_unlock(&l_mutex);
#endif
}
示例8: main
int main(int argc, char **argv)
{
int ret = EXIT_FAILURE;
banner();
//verbose++;
if (!parse_options(argc, argv))
return ret;
check_root();
if (dump) {
efivar_bootloader_dump();
printf("\n");
return EXIT_SUCCESS;
}
init_log();
/* insure current_version is set */
if (current_version == -1)
current_version = read_version_from_subvol_file("");
ret = do_update_bootloader_pref();
close_log(ret, current_version, 0, log_bootloader_pref);
return ret;
}
示例9: MyMultiPV
int MyMultiPV(typePos *Position, int depth)
{
int Cnt, cnt, best_value, move_is_check, new_depth, v;
typeRootMoveList *p, *q;
typeDynamic *Pos0 = Position->Dyn;
uint32 move;
int cpu, rp;
int extend, LMR, value;
int to;
int i, j, x, moveno;
int Alpha = -ValueMate, Target, Delta, Alpha2, Lower;
int GoodMoves = 0;
uint64 Nodes, NodesStore, nodes, y;
if (depth < 14)
for (i = 0; i < 0x100; i++)
MPV[i].move = MPV[i].Value = 0;
if (DoOutput && DepthInfo)
{
Send("info depth %d\n", depth >> 1);
#ifdef Log
if (WriteLog)
{
log_file = fopen(log_filename, "a");
fprintf(log_file, "info depth %d\n", depth >> 1);
close_log();
}
#endif
}
示例10: exit_pluto
/* leave pluto, with status.
* Once child is launched, parent must not exit this way because
* the lock would be released.
*
* 0 OK
* 1 general discomfort
* 10 lock file exists
*/
void exit_pluto(int status)
{
reset_globals(); /* needed because we may be called in odd state */
free_preshared_secrets();
free_remembered_public_keys();
close_ha_iface();
delete_every_connection();
whack_attribute_finalize(); /* free in-memory pools */
fetch_finalize(); /* stop fetching thread */
free_crl_fetch(); /* free chain of crl fetch requests */
free_ocsp_fetch(); /* free chain of ocsp fetch requests */
free_authcerts(); /* free chain of X.509 authority certificates */
free_crls(); /* free chain of X.509 CRLs */
free_ca_infos(); /* free chain of X.509 CA information records */
free_ocsp(); /* free ocsp cache */
free_ifaces();
ac_finalize(); /* free X.509 attribute certificates */
scx_finalize(); /* finalize and unload PKCS #11 module */
stop_adns();
free_md_pool();
free_crypto();
free_myid(); /* free myids */
free_events(); /* free remaining events */
free_vendorid(); /* free all vendor id records */
free_builder();
delete_lock();
options->destroy(options);
pluto_deinit();
lib->plugins->unload(lib->plugins);
libhydra_deinit();
library_deinit();
close_log();
exit(status);
}
示例11: f_atexit
/*! @brief Executed automaticaly at exit
*
* This function is executed whenever the program finished, so
* its good to do some finalization code here.
*/
void f_atexit(void)
{
close_network();
fflush(stdout);
write_log_fmt("Closing app\n");
close_log();
}
示例12: main
int main(int argc, TCHAR* argv[], TCHAR* envp[])
{
HANDLE hProcess;
//取当前进程的句柄
hProcess=GetCurrentProcess();
//设置当前进程的优先级
//REALTIME_PRIORITY_CLASS--指示该进程拥有可用的最高优先级。
if(!SetPriorityClass(hProcess,REALTIME_PRIORITY_CLASS)){
return 1;
}
// create the service-object
CNetService serv;
// RegisterService() checks the parameterlist for predefined switches
// (such as -d or -i etc.; see NTService.h for possible switches) and
// starts the services functionality.
// You can use the return value from "RegisterService()"
// as your exit-code.
//2012-7-17 日志记录
logIsEnabled = __false;//__true为启动日志记录功能
open_log();
serv.RegisterService(argc, argv);
close_log();//2012-7-17 关闭日志
return 1;
}
示例13: main
int main(void)
{
if (!al_init()) {
abort_example("Could not init Allegro.\n");
}
open_log_monospace();
display = al_create_display(WIDTH, HEIGHT);
if (!display) {
abort_example("al_create_display failed\n");
}
al_clear_to_color(al_map_rgb_f(0, 0, 0));
al_flip_display();
if (!al_install_keyboard()) {
abort_example("al_install_keyboard failed\n");
}
event_queue = al_create_event_queue();
if (!event_queue) {
abort_example("al_create_event_queue failed\n");
}
al_register_event_source(event_queue, al_get_keyboard_event_source());
al_register_event_source(event_queue, al_get_display_event_source(display));
main_loop();
close_log(false);
return 0;
}
示例14: main_int_handler
/**
* SIGINT handler for main process
*/
void main_int_handler(int arg) {
// Send SIGINT to threads, so they can close file descriptors
pthread_kill(t_id[0], SIGINT);
pthread_kill(t_id[1], SIGINT);
close_log();
exit(0);
}
示例15: probe_modules_main
int probe_modules_main(int argc, char *argv[])
{
enum media_bus bus = BUS_ANY;
char *module = NULL;
char options[500] = "";
if (argc > 1) {
if (streq(argv[1], "--usb")) {
bus = BUS_USB;
} else if (!ptr_begins_static_str(argv[1], "--")) {
int i;
module = argv[1];
for (i = 2; i < argc; i++) {
strcat(options, argv[i]);
strcat(options, " ");
}
}
}
open_log();
init_modules_insmoding();
if (module) {
my_modprobe(module, ANY_DRIVER_TYPE, options);
} else {
find_media(bus);
}
close_log();
return 0;
}