コード例 #1
0
ファイル: mingw32.cpp プロジェクト: kfprimm/blitz3d-ng
bool bbruntime_destroy(){
	runtime_glfw3_destroy();
	graphics_destroy();
	blitz2d_destroy();
	pixmap_destroy();
	userlibs_destroy();
	audio_fmod_destroy();
	audio_destroy();
	input_directinput8_destroy();
	input_destroy();
	timer_windows_destroy();
	filesystem_windows_destroy();
	filesystem_destroy();
	system_windows_destroy();
	bank_destroy();
	system_destroy();
	runtime_destroy();
	enet_destroy();
	sockets_destroy();
	stream_destroy();
	stdio_destroy();
	string_destroy();
	math_destroy();
	event_destroy();
	hook_destroy();
	blitz_destroy();
	return true;
}
コード例 #2
0
ファイル: hooks.c プロジェクト: AmesianX/libhtp
/**
 * Creates a copy of the provided hook. The hook is allowed to be NULL,
 * in which case this function simply returns a NULL.
 *
 * @param hook
 * @return A copy of the hook, or NULL (if the provided hook was NULL
 *         or, if it wasn't, if there was a memory allocation problem while
 *         constructing a copy).
 */
htp_hook_t * hook_copy(htp_hook_t *hook) {
    if (hook == NULL) return NULL;

    htp_hook_t *copy = hook_create();
    if (copy == NULL) return NULL;

    htp_callback_t *callback = NULL;
    list_iterator_reset(hook->callbacks);
    while ((callback = list_iterator_next(hook->callbacks)) != NULL) {
        if (hook_register(&copy, callback->fn) < 0) {
            hook_destroy(copy);
            return NULL;
        }
    }

    return copy;
}
コード例 #3
0
ファイル: mingw32.cpp プロジェクト: kfprimm/blitz3d-ng
bool bbruntime_create(){
	if( blitz_create() ){
				if( hook_create() ){
						if( event_create() ){
								if( math_create() ){
										if( string_create() ){
												if( stdio_create() ){
														if( stream_create() ){
																if( sockets_create() ){
																		if( enet_create() ){
																				if( runtime_create() ){
																						if( system_create() ){
																								if( bank_create() ){
																										if( system_windows_create() ){
																												if( filesystem_create() ){
																														if( filesystem_windows_create() ){
																																if( timer_windows_create() ){
																																		if( input_create() ){
																																				if( input_directinput8_create() ){
																																						if( audio_create() ){
																																								if( audio_fmod_create() ){
																																										if( userlibs_create() ){
																																												if( pixmap_create() ){
																																														if( blitz2d_create() ){
																																																if( graphics_create() ){
																																																		if( runtime_glfw3_create() ){
																																																				return true;
																									}else sue( "runtime_glfw3_create failed" );
																									graphics_destroy();
																								}else sue( "graphics_create failed" );
																								blitz2d_destroy();
																							}else sue( "blitz2d_create failed" );
																							pixmap_destroy();
																						}else sue( "pixmap_create failed" );
																						userlibs_destroy();
																					}else sue( "userlibs_create failed" );
																					audio_fmod_destroy();
																				}else sue( "audio_fmod_create failed" );
																				audio_destroy();
																			}else sue( "audio_create failed" );
																			input_directinput8_destroy();
																		}else sue( "input_directinput8_create failed" );
																		input_destroy();
																	}else sue( "input_create failed" );
																	timer_windows_destroy();
																}else sue( "timer_windows_create failed" );
																filesystem_windows_destroy();
															}else sue( "filesystem_windows_create failed" );
															filesystem_destroy();
														}else sue( "filesystem_create failed" );
														system_windows_destroy();
													}else sue( "system_windows_create failed" );
													bank_destroy();
												}else sue( "bank_create failed" );
												system_destroy();
											}else sue( "system_create failed" );
											runtime_destroy();
										}else sue( "runtime_create failed" );
										enet_destroy();
									}else sue( "enet_create failed" );
									sockets_destroy();
								}else sue( "sockets_create failed" );
								stream_destroy();
							}else sue( "stream_create failed" );
							stdio_destroy();
						}else sue( "stdio_create failed" );
						string_destroy();
					}else sue( "string_create failed" );
					math_destroy();
				}else sue( "math_create failed" );
				event_destroy();
			}else sue( "event_create failed" );
			hook_destroy();
		}else sue( "hook_create failed" );
		blitz_destroy();
	}else sue( "blitz_create failed" );
	return false;
}
コード例 #4
0
ファイル: htp_config.c プロジェクト: 2help/suricata
/**
 * Destroy a configuration structure.
 * 
 * @param cfg
 */
void htp_config_destroy(htp_cfg_t *cfg) {
    // Destroy the hooks
    hook_destroy(cfg->hook_transaction_start);
    hook_destroy(cfg->hook_request_line);
    hook_destroy(cfg->hook_request_uri_normalize);
    hook_destroy(cfg->hook_request_headers);
    hook_destroy(cfg->hook_request_body_data);
    hook_destroy(cfg->hook_request_trailer);
    hook_destroy(cfg->hook_request);
    hook_destroy(cfg->hook_response_line);
    hook_destroy(cfg->hook_response_headers);
    hook_destroy(cfg->hook_response_body_data);
    hook_destroy(cfg->hook_response_trailer);
    hook_destroy(cfg->hook_response);
    hook_destroy(cfg->hook_log);

    // Free the structure itself
    free(cfg);
}