I'm doing some network programming in Linux at the moment and for this I made myself some typdefs for portability
typedef char int8;
typedef unsigned char uint8;
typedef short int16;
typedef unsigned short uint16;
typedef int int32;
typedef unsigned int uint32;
Now I'm at a point where I want to write some wrapper functions for often used socket functions. A short example would be:
int32 rawSocketCreate(int* sockfd, int protocol) {
*sockfd = socket(AF_PACKET, SOCK_RAW, htons(protocol));
if (*sockfd == -1) {
printf("Error creating raw socket\n");
return -1;
}
return 0;
}
My question now is: For parameters I pass on to library functions, should I keep using the standard data types or also use my own?
rawSocketCreate(int* sockfd, int protocol)
/* OR */
rawSocketCreate(int32* sockfd, int32 protocol)