Changeset 233 for trunk


Ignore:
Timestamp:
04/28/11 23:28:16 (13 years ago)
Author:
tim
Message:

improved version information interface by adding a special purpose function

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/regfi.h

    r232 r233  
    7979#include <range_list.h>
    8080#include <lru_cache.h>
    81 
    82 /* Library version can be overridden at build time */
    83 #ifndef REGFI_VERSION
    84 #define REGFI_VERSION "trunk"
    85 #endif
    8681
    8782/* GCC-specific macro for library exports */
     
    884879/******************************************************************************/
    885880
     881
     882/** Returns the current regfi library version
     883 *
     884 * @return A string indicating the version.
     885 *
     886 * @ingroup regfiBase
     887 */
     888_EXPORT
     889const char* regfi_version();
     890
     891
    886892/** Parses file headers of an already open registry hive file and
    887893 *  allocates related structures for further parsing.
  • trunk/lib/regfi.c

    r228 r233  
    3434#include "regfi.h"
    3535
     36/* Library version can be overridden at build time */
     37#ifndef REGFI_VERSION
     38#define REGFI_VERSION "trunk"
     39#endif
     40
    3641
    3742/* Registry types mapping */
     
    4853static pthread_once_t regfi_init_once = PTHREAD_ONCE_INIT;
    4954
     55
     56/******************************************************************************
     57 ******************************************************************************/
     58const char* regfi_version()
     59{
     60  return REGFI_VERSION;
     61}
    5062
    5163
  • trunk/python/pyregfi/__init__.py

    r232 r233  
    182182
    183183
     184## Returns the (py)regfi library version
     185#
     186# @return A string indicating the version
     187def getVersion():
     188    return regfi.regfi_version()
     189
     190
    184191## Retrieves messages produced by regfi during parsing and interpretation
    185192#
  • trunk/python/pyregfi/structures.py

    r228 r233  
    228228
    229229# Define function prototypes
     230regfi.regfi_version.argtypes = []
     231regfi.regfi_version.restype = c_char_p
     232
    230233regfi.regfi_alloc.argtypes = [c_int, REGFI_ENCODING]
    231234regfi.regfi_alloc.restype = POINTER(REGFI_FILE)
  • trunk/src/reglookup-recover.c

    r232 r233  
    336336{
    337337  fprintf(stderr, "Usage: reglookup-recover [options] <REGISTRY_FILE>\n");
    338   fprintf(stderr, "Version: %s\n", REGFI_VERSION);
     338  fprintf(stderr, "Version: %s\n", regfi_version());
    339339  fprintf(stderr, "Options:\n");
    340340  fprintf(stderr, "\t-v\t sets verbose mode.\n");
  • trunk/src/reglookup.c

    r232 r233  
    551551          " [-p <PATH_FILTER>] [-t <TYPE_FILTER>]"
    552552          " <REGISTRY_FILE>\n");
    553   fprintf(stderr, "Version: %s\n", REGFI_VERSION);
     553  fprintf(stderr, "Version: %s\n", regfi_version());
    554554  fprintf(stderr, "Options:\n");
    555555  fprintf(stderr, "\t-v\t sets verbose mode.\n");
Note: See TracChangeset for help on using the changeset viewer.