00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00038 #ifndef __NUSMV_CORE_UTILS_UTILS_H__
00039 #define __NUSMV_CORE_UTILS_UTILS_H__
00040
00041 #if HAVE_CONFIG_H
00042 #include "nusmv-config.h"
00043 #else
00044
00050 #define NUSMV_FUNCATTR_NORETURN
00051 #endif
00052
00053 #include "nusmv/core/utils/defs.h"
00054 #include "nusmv/core/cinit/NuSMVEnv.h"
00055 #include "nusmv/core/utils/list.h"
00056
00057
00058
00059
00060
00068 void Utils_pkg_init(const NuSMVEnv_ptr env);
00069
00077 void Utils_pkg_quit(const NuSMVEnv_ptr env);
00078
00079
00080
00086 char* Utils_int_to_str(const int an_int);
00087
00094 size_t Utils_int_size_as_string(const int an_int);
00095
00096
00097
00105 const char* Utils_StripPath(const char* pathfname);
00106
00116 void
00117 Utils_StripPathNoExtension(const char* fpathname, char* filename);
00118
00130 void Utils_StripPathNoFilenameNoExtension(const char* fpathname,
00131 char* dirname);
00132
00138 char* Utils_get_temp_filename_in_dir(const char* dir,
00139 const char* templ);
00140
00155 int Utils_file_exists_in_paths(const char* filename,
00156 const char* paths,
00157 const char* delimiters);
00158
00171 int Utils_file_exists_in_directory(const char* filename,
00172 char* directory);
00173
00180 boolean Utils_file_exists(const char* filename);
00181
00185 boolean Utils_files_are_the_same(const char* fname1, const char* fname3);
00186
00193 boolean Utils_file_can_be_written(const char* filename);
00194
00202 boolean Utils_exe_file_exists(const char* filename);
00203
00204
00205
00206
00213 int Utils_strcasecmp(const char* s1, const char* s2);
00214
00223 int Utils_log2_round(unsigned long long int a);
00224
00234 int Utils_ptr_compar(const void* a, const void* b);
00235
00242 void Utils_str_escape_xml_file(const char* str, FILE* file);
00243
00255 void Utils_FreeListOfLists(lsList list_of_lists);
00256
00257
00258
00259
00266 void Utils_start_timer(const NuSMVEnv_ptr env, const char* name);
00267
00273 void Utils_stop_timer(const NuSMVEnv_ptr env, const char* name);
00274
00280 void Utils_reset_timer(const NuSMVEnv_ptr env, const char* name);
00281
00287 void Utils_print_timer(const NuSMVEnv_ptr env,
00288 const char* name, const char* msg);
00289
00290
00291
00292
00299 char* Utils_util_tilde_expand(char* fname);
00300
00301
00302 #endif