Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 791 Bytes

function_pointer_types.md

File metadata and controls

21 lines (17 loc) · 791 Bytes

Function Pointer Type Corrections

Based on the senior's feedback, here are the proper function pointer type definitions per the Windows API docs while maintaining POSIX compatibility:

// Network byte order conversions
uint32_t (*)(uint32_t) for htonl/ntohl
uint16_t (*)(uint16_t) for htons/ntohs

// IP address conversions
unsigned long (*)(const char*) for inet_addr
char* (*)(struct in_addr) for inet_ntoa
const char* (*)(int, const void*, char*, size_t) for inet_ntop (InetNtopA)
int (*)(int, const char*, void*) for inet_pton (InetPtonA)

The key points:

  1. We maintain POSIX types in our public interface
  2. Function pointer types match Windows API signatures
  3. No Windows-specific types or headers are used
  4. For inet_ntop/pton we use InetNtopA/InetPtonA from ws2tcpip.h