Re: hedit_save_internally

From: Izham Syah Mahrome (doomvoid@HOTMAIL.COM)
Date: 11/17/02


i wake up this morning and thought about this zedit problem. then it
occured to me to look at the zedit for examples. and true to george it is
the free_help that made it wont work. :)

void hedit_save_internally(struct descriptor_data *d)
{
  int i, rnum;
  struct help_index_element *new_help_table;

  rnum = OLC_ZNUM(d);

  /*
   * Help entry exists exists: free and replace it.
   */
  if (rnum > 0) {
    free(help_table[OLC_ZNUM(d)].entry);
    help_table[OLC_ZNUM(d)].entry = strdup(OLC_HELP(d)->entry);
    help_table[rnum] = *OLC_HELP(d);
  } else {   /* Entry doesn't exist, hafta add it. */
    CREATE(new_help_table, struct help_index_element, top_of_helpt + 2);

    /*
     * Insert new entry at the top - why not?
     */

    new_help_table[0] = *(OLC_HELP(d));

    /*
     * Count through help table.
     */
    for (i = 0; i <= top_of_helpt; i++)
      new_help_table[i + 1] = help_table[i];

    /*
     * Copy help table over to new one.
     */
    free(help_table);
    help_table = new_help_table;
    top_of_helpt++;
  }

anyway.. i found in db.h which im not certain of its use. what is duplicate
used for?

struct help_index_element {
   char *keyword;
   char *entry;
   int duplicate;   <----what is this???
   int min_level;
};

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT