MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
Loading...
Searching...
No Matches
mx_std.h File Reference

Standard library module C API — function declarations exported to MXVM programs. More...

#include <stdint.h>
Include dependency graph for mx_std.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void set_program_args (int argc, const char **argv)
 Store command-line arguments for later access via argc()/argv().
int argc (void)
 Return the number of stored command-line arguments.
const char * argv (int idx)
 Return the command-line argument at the given index.
void free_program_args (void)
 Free the stored command-line argument memory.

Detailed Description

Standard library module C API — function declarations exported to MXVM programs.

Author
Jared Bruni

Definition in file mx_std.h.

Function Documentation

◆ argc()

int argc ( void )

Return the number of stored command-line arguments.

Definition at line 72 of file std.c.

References g_argc.

Referenced by mx::Argz< String >::Argz(), mx::Argz< String >::initArgs(), main(), mxvm_std_argc(), mxvm_std_set_program_args(), mx::proc_args(), proc_args(), and set_program_args().

◆ argv()

const char * argv ( int idx)

Return the command-line argument at the given index.

Parameters
idxZero-based argument index
Returns
Pointer to the argument string

Definition at line 76 of file std.c.

References g_argc, and g_argv.

Referenced by mx::Argz< String >::Argz(), action_interpret(), mx::Argz< String >::initArgs(), main(), mxvm_std_argv(), mxvm_std_set_program_args(), mx::proc_args(), proc_args(), set_program_args(), and mxvm::Program::setArgs().

◆ free_program_args()

void free_program_args ( void )

Free the stored command-line argument memory.

Definition at line 23 of file std.c.

References g_argc, and g_argv.

Referenced by mxvm_std_free_program_args(), and set_program_args().

◆ set_program_args()

void set_program_args ( int argc,
const char ** argv )

Store command-line arguments for later access via argc()/argv().

Parameters
argcNumber of arguments
argvArgument string array

Definition at line 35 of file std.c.

References argc(), argv(), free_program_args(), g_argc, g_args_registered, g_argv, and mx_strdup_c().

Referenced by mxvm_std_set_program_args().