Changeset 193 for trunk/include


Ignore:
Timestamp:
04/30/10 20:07:22 (15 years ago)
Author:
tim
Message:

added Michael's patch for enums and an error message fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/regfi.h

    r186 r193  
    11/*
    22 * Copyright (C) 2005-2010 Timothy D. Morgan
     3 * Copyright (C) 2010 Michael Cohen
    34 * Copyright (C) 2005 Gerald (Jerry) Carter
    45 *
     
    7172#include <pthread.h>
    7273
    73 #include "byteorder.h"
    74 #include "talloc.h"
    75 #include "winsec.h"
    76 #include "void_stack.h"
    77 #include "range_list.h"
    78 #include "lru_cache.h"
     74/* regfi headers */
     75#include <byteorder.h>
     76#include <talloc.h>
     77#include <winsec.h>
     78#include <void_stack.h>
     79#include <range_list.h>
     80#include <lru_cache.h>
    7981
    8082
     
    9193#define REGFI_DEFAULT_LOG_MASK REGFI_LOG_ERROR|REGFI_LOG_WARN
    9294
    93 typedef uint8_t REGFI_ENCODING;
    9495/* regfi library supported character encodings */
    95 #define REGFI_ENCODING_ASCII   0
    96 #define REGFI_ENCODING_UTF8    1
    97 #define REGFI_ENCODING_DEFAULT REGFI_ENCODING_ASCII
    9896/* UTF16LE is not supported for output */
    99 #define REGFI_ENCODING_UTF16LE 2
    100 
    101 #define REGFI_NUM_ENCODINGS    3
     97typedef enum {
     98  REGFI_ENCODING_DEFAULT  = 0,
     99  REGFI_ENCODING_ASCII =   0,
     100  REGFI_ENCODING_UTF8  =  1,
     101  REGFI_ENCODING_UTF16LE = 2,
     102  REGFI_NUM_ENCODINGS  =  3
     103} REGFI_ENCODING;
    102104
    103105/* Registry data types */
    104 #define REG_NONE                       0
    105 #define REG_SZ                         1
    106 #define REG_EXPAND_SZ                  2
    107 #define REG_BINARY                     3
    108 #define REG_DWORD                      4
    109 #define REG_DWORD_LE                   4  /* DWORD, little endian */
    110 #define REG_DWORD_BE                   5  /* DWORD, big endian */
    111 #define REG_LINK                       6
    112 #define REG_MULTI_SZ                   7
    113 #define REG_RESOURCE_LIST              8
    114 #define REG_FULL_RESOURCE_DESCRIPTOR   9
    115 #define REG_RESOURCE_REQUIREMENTS_LIST 10
    116 #define REG_QWORD                      11 /* 64-bit little endian */
     106typedef enum {
     107  REG_NONE                   =    0,
     108  REG_SZ                     =    1,
     109  REG_EXPAND_SZ              =    2,
     110  REG_BINARY                 =    3,
     111  REG_DWORD                  =    4,
     112  REG_DWORD_LE               =    4 , /* DWORD, little endian */
     113  REG_DWORD_BE               =    5 , /* DWORD, big endian */
     114  REG_LINK                   =    6,
     115  REG_MULTI_SZ               =    7,
     116  REG_RESOURCE_LIST          =    8,
     117  REG_FULL_RESOURCE_DESCRIPTOR=   9,
     118  REG_RESOURCE_REQUIREMENTS_LIST= 10,
     119  REG_QWORD                     = 11, /* 64-bit little endian */
    117120/* XXX: Has MS defined a REG_QWORD_BE? */
    118121/* Not a real type in the registry */
    119 #define REG_KEY                    0x7FFFFFFF
    120 
     122  REG_KEY                 =   0x7FFFFFFF
     123} REGFI_DATA_TYPE;
    121124#define REGFI_OFFSET_NONE          0xffffffff
    122125
     
    248251
    249252
     253#ifndef CHAR_BIT
    250254#define CHAR_BIT 8
     255#endif
     256
    251257#define TIME_T_MIN ((time_t)0 < (time_t) -1 ? (time_t) 0 \
    252258                    : ~ (time_t) 0 << (sizeof (time_t) * CHAR_BIT - 1))
     
    385391{
    386392  /** Data type of this data, as indicated by the referencing VK record. */
    387   uint32_t type;
     393  REGFI_DATA_TYPE type;
    388394
    389395  /** Length of the raw data. */
     
    526532
    527533  /** Value's data type */
    528   uint32_t type;
     534  REGFI_DATA_TYPE type;
    529535
    530536  /** VK record's magic number (should be "vk") */
Note: See TracChangeset for help on using the changeset viewer.