[newbie?] clan code..

From: Corey Hoitsma (choitsma@netcom.com)
Date: 10/03/96


Hello again:)

I'm having some trouble with my clan code here, can anyone help me out?

this is the code:

void init_clan_list(void)
{
  char send[256];
  /* char report[256]; */
  struct clan_data *cur,*new,*prev;
  short cl_room;
  int count=0,number;
  FILE *clan_fl;
  char string[1024];

  if (!(clan_fl=fopen(CLAN_FILE,"r"))){
     perror("Error opening clan file");
     exit(1);
  }
  rewind (clan_fl);

  while (fgets(string,1024,clan_fl) != NULL){

    if (string[0] == ' ' || string[0] == '\n'){
      fclose(clan_fl);
      return;
    }
    sprintf (send,"lengh = %d",strlen(string));
    CREATE(new,struct clan_data,1);
    string[strlen(string)-1]='\0';
    number=atoi(string);
    new->cl_number=number;
    fgets(string,1024,clan_fl);
    string[strlen(string)-1]='\0';
    cl_room=atoi(string);
    new->cl_room = cl_room;
    fgets(string,1024,clan_fl);
    string[strlen(string)-1]='\0';
    CREATE (new->cl_name,char,strlen(string)+1);
    strcpy (new->cl_name,string);

    while (fgets(string,1024,clan_fl) != NULL){
      if (string[0] == '\n') break;
      string[strlen(string)-1]='\0';
      CREATE (new->cl_players[count],char,strlen(string)+1);
      strcpy (new->cl_players[count++],string);
    }
    new->cl_players[count]=NULL;
    count=0;
    prev=NULL;
    cur = clan_list;
    while (1){
      if (cur ==NULL)break;
      prev=cur;
      cur = cur->next;
    }
    if (prev == NULL){
      clan_list = new;
      new->next = cur;
    } else {
      prev->next = new;
      new->next = cur;
    }
  }

}


but I get there errors..

clan.c: In function `init_clan_list':
clan.c:95: sizeof applied to an incomplete type

clan.c:98: dereferencing pointer to incomplete type
clan.c:102: dereferencing pointer to incomplete type
clan.c:105: dereferencing pointer to incomplete type
clan.c:106: dereferencing pointer to incomplete type
clan.c:111: dereferencing pointer to incomplete type
clan.c:112: dereferencing pointer to incomplete type
clan.c:114: dereferencing pointer to incomplete type
clan.c:117: `clan_list' undeclared (first use this function)  \
clan.c:117: (Each undeclared identifier is reported only once | -- i can fix this 
clan.c:117: for each function it appears in.)		      /
clan.c:121: dereferencing pointer to incomplete type
clan.c:125: dereferencing pointer to incomplete type
clan.c:127: dereferencing pointer to incomplete type
clan.c:128: dereferencing pointer to incomplete type

I have no idea what these mean. I'm guess it's talking about
the 'string' char, but I have no idea why.

Thanks for any help!


Corey Hoitsma                   AKA -= Myrddin =-
____         choitsma@netcom.com
 L|azmania			blackhwk.interpath.net 7000

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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