![]() |
crun-cli v1.4.0
C-based project scaffolding CLI
|
crun source file More...
#include "../inc/crun.h"#include "../common/patterns.h"#include "../inc/crun_audit.h"#include "../inc/crun_file_manager.h"#include "../inc/crun_json_manager.h"#include "../inc/crun_libcurl.h"#include "../inc/crun_zip_manager.h"#include <cjson/cJSON.h>#include <ctype.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/stat.h>#include <time.h>
Functions | |
| void | crun_version () |
| Print app version. | |
| void | crun_help () |
| Print command-line usage/help. | |
| int | crun_update () |
| Refresh local stacks metadata from remote source. | |
| void | crun () |
| Main CLI flow entrypoint. | |
| const char * | download_crun_package (const struct CrunPackage *crun_package_map) |
| Resolve package archive from cache or download it. | |
| void | get_user_choice (int *user_choice, const char *menu, const int limiter) |
| Prompt for menu choice with validation. | |
| void | crun_stacks_json_checker (const char *crun_stacks_json_file_path) |
| Ensure stacks metadata file exists locally. | |
| char * | get_language_buffer (cJSON *root) |
| Build selectable language menu buffer from JSON root. | |
| char * | get_packages_buffer (cJSON *root, const char *language_name) |
| Build selectable package menu buffer for one language. | |
| void | free_all (void **ptrs, size_t len) |
| Release language/package maps and additional owned pointers. | |
Variables | |
| struct CrunLanguage * | languages_map = NULL |
| size_t | languages_map_length = 1 |
| struct CrunPackage * | packages_map = NULL |
| size_t | packages_map_length = 1 |
| void crun | ( | ) |
Main CLI flow entrypoint.


| void crun_help | ( | ) |
Print command-line usage/help.

| void crun_stacks_json_checker | ( | const char * | crun_stacks_json_file_path | ) |
Ensure stacks metadata file exists locally.
| crun_stacks_json_file_path | Absolute path to local metadata file. |


| int crun_update | ( | ) |
Refresh local stacks metadata from remote source.


| void crun_version | ( | ) |
Print app version.

| const char * download_crun_package | ( | const struct CrunPackage * | crun_package_map | ) |
Resolve package archive from cache or download it.
| crun_package_map | Selected package metadata. |


| void free_all | ( | void ** | ptrs, |
| const size_t | len ) |
Release language/package maps and additional owned pointers.
| ptrs | Extra pointers to free. |
| len | Number of pointers in ptrs. |
| char * get_language_buffer | ( | cJSON * | root | ) |
Build selectable language menu buffer from JSON root.
| root | Parsed JSON root. |


| char * get_packages_buffer | ( | cJSON * | root, |
| const char * | language_name ) |
Build selectable package menu buffer for one language.
| root | Parsed JSON root. |
| language_name | Selected language key. |


| void get_user_choice | ( | int * | user_choice, |
| const char * | menu, | ||
| const int | limiter ) |
Prompt for menu choice with validation.
| user_choice | Output selected value. |
| menu | Rendered menu text. |
| limiter | Upper bound (exclusive), usually map length. |


| struct CrunLanguage* languages_map = NULL |
| size_t languages_map_length = 1 |
| struct CrunPackage* packages_map = NULL |
| size_t packages_map_length = 1 |