BFC-Compiler
A C23 Brainfuck compiler
Loading...
Searching...
No Matches
bfc_target.c File Reference

Target-triple parsing and host detection. More...

#include "bfc_target.h"
#include <string.h>
#include "bfc_common.h"

Data Structures

struct  bfc_target_entry_t
 One accepted target-triple mapping. More...

Functions

bfc_error_t bfc_target_parse (bfc_target_t *target, const char *triple)
 Looks up a supported textual target triple.
bfc_target_t bfc_target_host (void)
 Derives the native target from compiler predefined macros.

Variables

static const bfc_target_entry_t BFC_TARGETS []
 Target triples recognized by the command-line interface.

Detailed Description

Target-triple parsing and host detection.

Maps accepted target strings to internal targets and derives the native target from compiler predefined macros.

Function Documentation

◆ bfc_target_host()

bfc_target_t bfc_target_host ( void )

Derives the native target from compiler predefined macros.

Returns the target corresponding to the compiler host.

Derives the native target from compiler predefined macros.

Returns
The host architecture and operating-system pair.

◆ bfc_target_parse()

bfc_error_t bfc_target_parse ( bfc_target_t * target,
const char * triple )

Looks up a supported textual target triple.

Parses a supported target triple.

Looks up a supported textual target triple.

Parameters
[out]targetReceives the parsed target on success.
[in]tripleNull-terminated target triple.
Returns
BFC_ERR_OK on success; otherwise an argument error.

Variable Documentation

◆ BFC_TARGETS

const bfc_target_entry_t BFC_TARGETS[]
static

Target triples recognized by the command-line interface.