Forum Discussion
Altera_Forum
Honored Contributor
14 years agoThere is a typedef at the very beginning of the code making SSSConn visible as a type (alias 'struct SSS_SOCKET').
If you reformat the source a bit it becomes beter visible
typedef struct SSS_SOCKET {
enum { READY, COMPLETE, CLOSE } state;
int fd;
int close;
INT8U rx_buffer;
INT8U *rx_rd_pos; /* position we've read up to */
INT8U *rx_wr_pos; /* position we've written up to */
} SSSConn; Most often we first see the declaration of the structure, followed by the typedef statement.
struct SSS_SOCKET {
enum { READY, COMPLETE, CLOSE } state;
int fd;
int close;
INT8U rx_buffer;
INT8U *rx_rd_pos; /* position we've read up to */
INT8U *rx_wr_pos; /* position we've written up to */
} ;
typedef struct SSS_SOCKET SSSConn ;
The first code snippet does the two in one go.