Changeset 81 for trunk/lib


Ignore:
Timestamp:
01/17/07 11:47:39 (18 years ago)
Author:
tim
Message:

Finished incorporating changes to reglookup to work with new regfi interface.

Compiles now, but is minimally tested.

Location:
trunk/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Makefile

    r73 r81  
    33################################################################################
    44
    5 FILES=regfio.o smb_deps.o void_stack.o
     5FILES=regfi.o smb_deps.o void_stack.o
    66
    77all: $(FILES)
    88
    9 regfio.o: regfio.c
    10         $(CC) $(CFLAGS) $(OPTS) $(INC) -c -o $@ regfio.c
     9regfi.o: regfi.c
     10        $(CC) $(CFLAGS) $(OPTS) $(INC) -c -o $@ regfi.c
    1111
    1212smb_deps.o: smb_deps.c
  • trunk/lib/regfi.c

    r80 r81  
    66 * Windows NT registry I/O library
    77 *
    8  * Copyright (C) 2005-2006 Timothy D. Morgan
     8 * Copyright (C) 2005-2007 Timothy D. Morgan
    99 * Copyright (C) 2005 Gerald (Jerry) Carter
    1010 *
     
    2525 */
    2626
    27 #include "../include/regfio.h"
     27#include "../include/regfi.h"
    2828
    2929
     
    629629    nk->hbin->dirty = true;
    630630 
    631   nk->subkey_index = 0;
    632631  return true;
    633632}
     
    15161515  {
    15171516    for(i=0; i < nk->num_values; i++)
    1518       regfi_value_free(nk->values[i]);
     1517    {
     1518      if(nk->values[i].valuename != NULL)
     1519        free(nk->values[i].valuename);
     1520      if(nk->values[i].data != NULL)
     1521        free(nk->values[i].data);
     1522    }
    15191523    free(nk->values);
    15201524  }
     
    15331537/******************************************************************************
    15341538 *****************************************************************************/
    1535 void regfi_value_free(REGF_VK_REC* vk)
    1536 {
    1537   if(vk->valuename != NULL)
    1538     free(vk->valuename);
    1539   if(vk->data != NULL)
    1540     free(vk->data); 
    1541  
    1542   /* XXX: not freeing hbin because these are cached.  This needs to be reviewed. */
    1543   free(vk);
    1544 }
    1545 
    1546 
    1547 /******************************************************************************
    1548  *****************************************************************************/
    15491539REGFI_ITERATOR* regfi_iterator_new(REGF_FILE* fh)
    15501540{
     
    15541544    return NULL;
    15551545
    1556   root = regfi_rootkey(f);
     1546  root = regfi_rootkey(fh);
    15571547  if(root == NULL)
    15581548  {
     
    17251715/******************************************************************************
    17261716 *****************************************************************************/
    1727 REGF_NK_REC* regfi_iterator_cur_key(REGFI_ITERATOR* i);
     1717REGF_NK_REC* regfi_iterator_cur_key(REGFI_ITERATOR* i)
    17281718{
    17291719  return i->cur_key;
     
    17351725REGF_NK_REC* regfi_iterator_first_subkey(REGFI_ITERATOR* i)
    17361726{
    1737   REGF_NK_REC* subkey;
    1738   REGF_HBIN* hbin;
    1739  
    17401727  i->cur_subkey = 0;
    17411728  return regfi_iterator_cur_subkey(i);
     
    18211808       && (strcasecmp(cur->valuename, value_name) == 0))
    18221809      found = true;
    1823     cur = retfi_iterator_next_value(i);
     1810    cur = regfi_iterator_next_value(i);
    18241811  }
    18251812
     
    18461833  REGF_VK_REC* ret_val = NULL;
    18471834  if(i->cur_value < i->cur_key->num_values)
    1848     ret_val = i->cur_key->values[i];
     1835    ret_val = &(i->cur_key->values[i->cur_value]);
    18491836
    18501837  return ret_val;
  • trunk/lib/void_stack.c

    r80 r81  
    44 * leaks.
    55 *
    6  * Copyright (C) 2005 Timothy D. Morgan
     6 * Copyright (C) 2005,2007 Timothy D. Morgan
    77 *
    88 * This program is free software; you can redistribute it and/or modify
Note: See TracChangeset for help on using the changeset viewer.