Autowiz Quirk

From: Zeavon (zeavon@kilnar.com)
Date: 03/01/99


I recently trashed the code for a solitary binary playerfile and wrote an
ASCII pfile system based off of what I saw in Samedi's system. (Instead of
using his, which reportedly has bugs, I decided to write my own and create my
own bugs.)

Because of the changes that were made to the datafile, I am forced to re-write
a small portion of autowiz and things just don't want to compile:
----------
spear@kilnar:~/coder/src$ make utils
make ../bin/autowiz
make[1]: Entering directory `/spear/spear/coder/src'
gcc -g -O -Wall -fno-strict-prototypes  -o ../bin/autowiz util/autowiz.c
/tmp/cca224981.o: In function `read_file':
/spear/spear/coder/src/util/autowiz.c:91: undefined reference to `get_line'
/spear/spear/coder/src/util/autowiz.c:92: undefined reference to
`two_arguments'
/spear/spear/coder/src/util/autowiz.c:93: undefined reference to `load_char'
make[1]: *** [../bin/autowiz] Error 1
make[1]: Leaving directory `/spear/spear/coder/src'
make: *** [utils] Error 2
spear@kilnar:~/coder/src$ grep include util/autowiz.c
#include "../conf.h"
#include "../sysdep.h"
#include <signal.h>
#include "../structs.h"
#include "../utils.h"
#include "../db.h"
spear@kilnar:~/coder/src$ grep get_line *.h
utils.h:int     get_line(FILE *fl, char *buf);
spear@kilnar:~/coder/src$ grep load_char *.h
db.h:long       load_char(char *name, struct char_file_u *char_element);
spear@kilnar:~/coder/src$ grep two_arguments util/autowiz.c
extern char *two_arguments(char *argument, char *first_arg, char *second_arg);
    two_arguments(line, arg1, arg2);
----------

As you can see from the log, it is proclaiming that get_line, two_arguments,
and load_char are undefined. By the #include statements and the greps, you can
see that get_line and load_char most certainly included! I've also extern'd
two_arguments in autowiz.c as well and it's being proclaimed as being
undefined.

Any ideas what's going on and how to fix?

Last bit of info is my read_file() function in autowiz.c. This is the only
function that I've had to change in autowiz.c:
void read_file(void)
{
  char arg1[40], arg2[80], line[256];
  struct char_file_u player;
  FILE *index_fl;

  if (!(index_fl = fopen(PLR_INDEX_FILE, "rb"))) {
    perror("Error opening playerfile");
    exit(1);
  }

  while (get_line(index_fl, line)) {
    two_arguments(line, arg1, arg2);
    if (load_char(arg2, &player) < 0)
      continue;

    if (player.level >= MIN_LEVEL &&
        !(IS_SET_AR(player.char_specials_saved.act, PLR_FROZEN)) &&
        !(IS_SET_AR(player.char_specials_saved.act, PLR_NOWIZLIST)) &&
        !(IS_SET_AR(player.char_specials_saved.act, PLR_DELETED)))
      add_name(player.level, player.name);
  }
  fclose(index_fl);
}

Thanks in advance for any assistance that you may be able to provide.

--
Zeavon Calatin, MageMaster of the Realms
Implementor of The Spear of Insanity
  MUD: kilnar.com 1066
  Web: http://www.kilnar.com/spear/


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST