8
在头文件或源文件中记录函数是否更好?
在区分“源”文件和“头文件”(主要是C和C ++)的语言中,最好在头文件中记录函数: (从CCAN窃取) /** * time_now - return the current time * * Example: * printf("Now is %lu seconds since epoch\n", (long)time_now().tv_sec); */ struct timeval time_now(void); 或在源文件中? (从PostgreSQL窃取) /* * Convert a UTF-8 character to a Unicode code point. * This is a one-character version of pg_utf2wchar_with_len. * * No …