/* Retrieves the pyewf/libewf version * Returns a Python object if successful or NULL on error */ PyObject *pyewf_get_version( PyObject *self ) { const char *errors = NULL; const char *version_string = NULL; size_t version_string_length = 0; Py_BEGIN_ALLOW_THREADS version_string = libewf_get_version(); Py_END_ALLOW_THREADS version_string_length = libcstring_narrow_string_length( version_string ); /* Pass the string length to PyUnicode_DecodeUTF8 * otherwise it makes the end of string character is part * of the string */ return( PyUnicode_DecodeUTF8( version_string, (Py_ssize_t) version_string_length, errors ) ); }
void print_version() { printf("SleuthKit Version: %s\n",tsk_version_get_str()); #ifdef HAVE_LIBAFFLIB printf("AFFLIB Version: %s\n",af_version()); #else printf("*** NO AFFLIB SUPPORT ***\n"); #endif #ifdef HAVE_LIBEWF printf("LIBEWF Version: %s\n",libewf_get_version()); #else printf("*** NO LIBEWF SUPPORT ***\n"); #endif }
/* Retrieves the pyewf/libewf version * Returns a Python object if successful or NULL on error */ PyObject *pyewf_get_version( PyObject *self ) { const char *errors = NULL; const char *version_string = NULL; size_t version_string_size = 0; version_string = libewf_get_version(); version_string_size = 1 + libcstring_narrow_string_length( version_string ); return( PyUnicode_DecodeUTF8( version_string, (Py_ssize_t) version_string_size, errors ) ); }