ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
manpage.h
Go to the documentation of this file.
1
17#pragma once
18
19#include "builder.h"
20#include "../common.h"
21#include <stdio.h>
22#include <stdbool.h>
23#include <stddef.h>
24
34
47
105 const char *mode_name, const char *output_path,
106 const char *brief_description);
107
124 const char *mode_name, const char *output_path,
125 const char *brief_description);
126
175 const char *mode_name, const char *output_path,
176 const char *brief_description);
177
188parsed_section_t *parse_manpage_sections(const char *filepath, size_t *num_sections);
189
198void free_parsed_sections(parsed_section_t *sections, size_t num_sections);
199
210const parsed_section_t *find_section(const parsed_section_t *sections, size_t num_sections, const char *section_name);
211
227#ifndef NDEBUG
228asciichat_error_t options_config_generate_final_manpage(const char *template_path, const char *output_path,
229 const char *version_string, const char *content_file_path);
230#endif
231
244const char *escape_groff_special(const char *str);
245
258const char *format_mode_names(option_mode_bitmask_t bitmask);
259
Options builder API for flexible command-line option configuration.
asciichat_error_t
Error and exit codes - unified status values (0-255)
Definition error_codes.h:49
const parsed_section_t * find_section(const parsed_section_t *sections, size_t num_sections, const char *section_name)
Find section by name.
const char * escape_groff_special(const char *str)
Escape special groff/troff characters in text.
asciichat_error_t options_config_generate_final_manpage(const char *template_path, const char *output_path, const char *version_string, const char *content_file_path)
Generate final man page (.1) from template (.1.in) with version substitution and optional content fil...
asciichat_error_t options_builder_generate_manpage_template(options_builder_t *builder, const char *program_name, const char *mode_name, const char *output_path, const char *brief_description)
Generate man page template from builder (before build())
asciichat_error_t options_config_generate_manpage_template(const options_config_t *config, const char *program_name, const char *mode_name, const char *output_path, const char *brief_description)
Generate a man page template from options builder configuration.
void free_parsed_sections(parsed_section_t *sections, size_t num_sections)
Free parsed sections array.
parsed_section_t * parse_manpage_sections(const char *filepath, size_t *num_sections)
Parse existing man page template to extract sections.
const char * format_mode_names(option_mode_bitmask_t bitmask)
Format option mode names as human-readable string.
option_mode_bitmask_t
Option mode bitmask.
asciichat_error_t options_config_generate_manpage_merged(const options_config_t *config, const char *program_name, const char *mode_name, const char *output_path, const char *brief_description)
Generate merged man page template preserving manual content.
section_type_t
Section type marker.
Definition manpage.h:28
@ SECTION_TYPE_MERGE
Intelligently merged: auto + manual content.
Definition manpage.h:31
@ SECTION_TYPE_UNMARKED
No marker found, defaults to MANUAL.
Definition manpage.h:32
@ SECTION_TYPE_AUTO
Fully auto-generated, manual edits lost on regeneration.
Definition manpage.h:29
@ SECTION_TYPE_MANUAL
Manually maintained, never touched by generator.
Definition manpage.h:30
ClangTool/LibTooling compatibility shim for stdbool.h.
Options builder.
Definition builder.h:441
Options configuration.
Definition builder.h:401
Parsed section information.
Definition manpage.h:38
bool has_markers
True if marked with AUTO/MANUAL/MERGE markers.
Definition manpage.h:45
char * content
Full section content (including .SH header)
Definition manpage.h:41
size_t content_len
Length of content.
Definition manpage.h:42
size_t end_line
Line number where section ends (1-based)
Definition manpage.h:44
size_t start_line
Line number where section starts (1-based)
Definition manpage.h:43
section_type_t type
Section type (AUTO/MANUAL/MERGE/UNMARKED)
Definition manpage.h:40
char * section_name
Section name (e.g., "ENVIRONMENT", "OPTIONS")
Definition manpage.h:39