- Creating portable names for hardware quantities:
typedef ___signed char int8_t;
typedef unsigned char u_int8_t;
typedef short int16_t;
typedef unsigned short u_int16_t;
typedef int int32_t;
typedef unsigned int u_int32_t;
typedef long int64_t;
typedef unsigned long u_int64_t;
- Creating abstract names for known hardware representatrions:
typedef u_int32_t in_addr_t;
typedef u_int16_t in_port_t;
- Emulating C++/Java class definitions:
typedef struct path path;
struct path {
/* [...] */
}