c - Errors in header file with function taking structs -
what's wrong header? gcc throws out:
libmmbox.h:7:29: error: expected ‘)’ before ‘*’ token libmmbox.h:8:27: error: expected ‘)’ before ‘*’ token
here's code:
#ifndef __libmmbox_h__ #define __libmmbox_h__ int mmbox_connect(char *username); int mmbox_login(int token, char *password); int mmbox_quit(); int mmbox_stat(mmbox_stat_t *result); int mmbox_list(mmbox_mail **l, int *num_msg); int mmbox_send(char *dest, char *obj, void *buf, size_t size); int mmbox_rcv(int id, void *buf, size_t size); int mmbox_delete(int id); int mmbox_resume(int id); typedef struct { char *user; int used_space; int free_space; int num_msg; } mmbox_stat_t; typedef struct { char *sender, *recipient; / char *obj, *date; char flags; size_t size; } mmbox_mail; #endif
mmbox_stat_t struct declared after used function signature. compiler doesn't still know type when declare:
int mmbox_stat(mmbox_stat_t *result);
put function prototypes after data structures definition.
Comments
Post a Comment