ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
main.c File Reference

Standalone Alphabet Soup word search solver host CLI. More...

#include <stdint.h>
#include <unistd.h>
#include "alphabet_soup.h"
#include "alphabet_soup_cli_internal.h"
#include "ra8_err.h"
#include "ra8_io_stream.h"
#include "ra8_io_stream_posix.h"
Include dependency graph for main.c:

Go to the source code of this file.

Data Structures

struct  soup_app_storage_t
 Static application workspace allocated in .bss. More...

Enumerations

enum  file_print_exit_code_t : int {
  k_exit_code_success = 0 ,
  k_exit_code_error = 1
}
 Process exit codes. More...

Functions

int main (int argc, char **argv)
 Application entry point.

Detailed Description

Standalone Alphabet Soup word search solver host CLI.

Tag
[Ring 4 / App] {World: Host}

Loads an ASCII word-search puzzle through the bounded POSIX adapter, solves it without heap allocation, and streams results to stdout.

Since
0.1.0

Definition in file main.c.

Enumeration Type Documentation

◆ file_print_exit_code_t

Process exit codes.

Enumerator
k_exit_code_success 

Puzzle solved and output printed.

k_exit_code_error 

Error during argument or file I/O.

Definition at line 23 of file main.c.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Application entry point.

Parameters
[in]argcArgument count.
[in]argvArgument vector.
Returns
Process exit status.
Return values
0Puzzle solved successfully.
1Argument, file, or solver failure.
Precondition
Standard output descriptor is open and writable.
Postcondition
POSIX filesystem resources are closed before return.
Since
0.1.0

Definition at line 45 of file main.c.

References soup_app_storage_t::file_buffer, k_exit_code_error, k_exit_code_success, k_ra8_ok, priv_alphabet_soup_load_file_contents(), ra8_io_stream_flush(), ra8_io_stream_posix_init(), ra8_io_stream_puts(), soup_app_storage_t::solver_ctx, and soup_solve().