10#include <ascii-chat/embedded_resources.h>
11#include <ascii-chat/common.h>
12#include <ascii-chat/log/logging.h>
13#include <ascii-chat/platform/util.h>
52 SET_ERRNO(ERROR_INVALID_PARAM,
"out_file cannot be NULL in development mode");
57#ifdef ASCIICHAT_RESOURCE_DIR
58 static char path_buffer[PATH_MAX];
59 safe_snprintf(path_buffer,
sizeof(path_buffer),
"%s/share/man/man1/ascii-chat.1.in", ASCIICHAT_RESOURCE_DIR);
60 const char *path = path_buffer;
63 const char *path =
"share/man/man1/ascii-chat.1.in";
70 SET_ERRNO_SYS(ERROR_CONFIG,
"Failed to open man page template: %s", path);
82 log_debug(
"Using filesystem man page template: %s", path);
99 log_debug(
"Man page content is now consolidated into template (empty)");
int get_manpage_template(FILE **out_file, const char **out_content, size_t *out_len)
const size_t embedded_manpage_template_len
int get_manpage_content(FILE **out_file, const char **out_content, size_t *out_len)
void release_manpage_resources(FILE *file)
const char embedded_manpage_template[]
int safe_snprintf(char *buffer, size_t buffer_size, const char *format,...)
Safe formatted string printing to buffer.
FILE * platform_fopen(const char *filename, const char *mode)