![]() |
cacao
Release 0.1.03-dev
Compute And Control For Adaptive Optics
|
main C file More...
#include <stdint.h>
#include <string.h>
#include "CommandLineInterface/CLIcore.h"
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <dlfcn.h>
#include <unistd.h>
#include <dirent.h>
#include <stddef.h>
#include <sys/resource.h>
#include <termios.h>
#include <sys/time.h>
#include <math.h>
#include <errno.h>
#include <sys/types.h>
#include <getopt.h>
#include <ncurses.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdbool.h>
#include <sys/prctl.h>
#include <sched.h>
#include <signal.h>
#include <readline/readline.h>
#include <readline/history.h>
#include <gsl/gsl_rng.h>
#include <fitsio.h>
#include "ImageStreamIO/ImageStreamIO.h"
#include "00CORE/00CORE.h"
#include "COREMOD_memory/COREMOD_memory.h"
#include "COREMOD_iofits/COREMOD_iofits.h"
#include "COREMOD_arith/COREMOD_arith.h"
#include "CommandLineInterface/calc.h"
#include "CommandLineInterface/calc_bison.h"
Macros | |
#define | _GNU_SOURCE |
#define | KNRM "\x1B[0m" |
#define | KRED "\x1B[31m" |
#define | KGRN "\x1B[32m" |
#define | KYEL "\x1B[33m" |
#define | KBLU "\x1B[34m" |
#define | KMAG "\x1B[35m" |
#define | KCYN "\x1B[36m" |
#define | KWHT "\x1B[37m" |
#define | KRES "\033[0m" |
Functions | |
void | yy_scan_string (const char *) |
int | yylex_destroy (void) |
static char ** | CLI_completion (const char *, int, int) |
CLIcore functions | |
int | user_function () |
void | fnExit1 (void) |
static void | runCLI_data_init () |
static void | runCLI_free () |
char * | CLI_generator (const char *, int) |
char * | dupstr (char *) |
void * | xmalloc (int) |
static errno_t | memory_re_alloc () |
static int | command_line_process_options (int argc, char **argv) |
static int | exitCLI () |
CLI commands. More... | |
static int | help () |
static errno_t | list_commands () |
static errno_t | list_commands_module (const char *restrict modulename) |
static errno_t | load_sharedobj (const char *restrict libname) |
static errno_t | load_module_shared (const char *restrict modulename) |
static errno_t | load_module_shared_ALL () |
static errno_t | help_command (const char *restrict cmdkey) |
command help More... | |
static void | set_terminal_echo_on () |
errno_t | set_signal_catch () |
signal catching More... | |
static void | fprintf_stdout (FILE *f, char const *fmt,...) |
errno_t | write_process_log () |
Write entry into debug log. More... | |
errno_t | write_process_exit_report (const char *restrict errortypestring) |
Write to disk a process report. More... | |
void | sig_handler (int signo) |
static errno_t | printInfo () |
static errno_t | helpreadline () |
static errno_t | help_cmd () |
static errno_t | help_module () |
static errno_t | load_so () |
static errno_t | load_module () |
static errno_t | CLIcore__load_module_as__cli () |
errno_t | set_processinfoON () |
errno_t | set_processinfoOFF () |
errno_t | set_default_precision_single () |
errno_t | set_default_precision_double () |
errno_t | cfits_usleep_cli () |
errno_t | functionparameter_CTRLscreen_cli () |
errno_t | processinfo_CTRLscreen_cli () |
errno_t | streamCTRL_CTRLscreen_cli () |
static errno_t | CLI_execute_line () |
void | rl_cb_linehandler (char *linein) |
Readline callback. More... | |
errno_t | RegisterModule (const char *restrict FileName, const char *restrict PackageName, const char *restrict InfoString) |
uint_fast16_t | RegisterCLIcommand (const char *restrict CLIkey, const char *restrict CLImodulesrc, errno_t(*CLIfptr)(), const char *restrict CLIinfo, const char *restrict CLIsyntax, const char *restrict CLIexample, const char *restrict CLICcall) |
void | fnExit_fifoclose () |
static errno_t | runCLI_initialize () |
static errno_t | setSHMdir () |
static errno_t | runCLI_prompt (char *promptstring, char *prompt) |
errno_t | runCLI (int argc, char *argv[], char *promptstring) |
Command Line Interface (CLI) main . More... | |
static char ** | CLI_completion (const char *text, int start, int __attribute__((unused)) end) |
int | CLI_checkarg0 (int argnum, int argtype, int errmsg) |
int | CLI_checkarg (int argnum, int argtype) |
int | CLI_checkarg_noerrmsg (int argnum, int argtype) |
Variables | |
int | DLib_index |
void * | DLib_handle [1000] |
pid_t | CLIPID |
important directories and info More... | |
uint8_t | TYPESIZE [32] |
int | C_ERRNO |
int | Verbose = 0 |
int | Listimfile = 0 |
char | line [500] |
int | rlquit = false |
int | CLIexecuteCMDready = 0 |
char | calctmpimname [200] |
char | CLIstartupfilename [200] = "CLIstartup.txt" |
static int | fifofd |
static fd_set | cli_fdin_set |
int | CLImatchMode = 0 |
main C file
#define _GNU_SOURCE |
#define KBLU "\x1B[34m" |
#define KCYN "\x1B[36m" |
#define KGRN "\x1B[32m" |
#define KMAG "\x1B[35m" |
#define KNRM "\x1B[0m" |
#define KRED "\x1B[31m" |
#define KRES "\033[0m" |
#define KWHT "\x1B[37m" |
#define KYEL "\x1B[33m" |
errno_t cfits_usleep_cli | ( | ) |
int CLI_checkarg | ( | int | argnum, |
int | argtype | ||
) |
int CLI_checkarg0 | ( | int | argnum, |
int | argtype, | ||
int | errmsg | ||
) |
int CLI_checkarg_noerrmsg | ( | int | argnum, |
int | argtype | ||
) |
|
static |
|
static |
|
static |
char * CLI_generator | ( | const char * | text, |
int | state | ||
) |
|
static |
|
static |
char * dupstr | ( | char * | s | ) |
|
static |
CLI commands.
CLI functions.
void fnExit1 | ( | void | ) |
void fnExit_fifoclose | ( | ) |
|
static |
errno_t functionparameter_CTRLscreen_cli | ( | ) |
|
static |
|
static |
|
static |
command help
[in] | cmdkey | Commmand name |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
errno_t processinfo_CTRLscreen_cli | ( | ) |
uint_fast16_t RegisterCLIcommand | ( | const char *restrict | CLIkey, |
const char *restrict | CLImodulesrc, | ||
errno_t(*)() | CLIfptr, | ||
const char *restrict | CLIinfo, | ||
const char *restrict | CLIsyntax, | ||
const char *restrict | CLIexample, | ||
const char *restrict | CLICcall | ||
) |
errno_t RegisterModule | ( | const char *restrict | FileName, |
const char *restrict | PackageName, | ||
const char *restrict | InfoString | ||
) |
void rl_cb_linehandler | ( | char * | linein | ) |
Readline callback.
errno_t runCLI | ( | int | argc, |
char * | argv[], | ||
char * | promptstring | ||
) |
Command Line Interface (CLI) main
.
uses readline to read user input
parsing done with bison and flex
becomes 1 after startup
|
static |
defaults to floating point type
|
static |
|
static |
|
static |
errno_t set_default_precision_double | ( | ) |
errno_t set_default_precision_single | ( | ) |
errno_t set_processinfoOFF | ( | ) |
errno_t set_processinfoON | ( | ) |
errno_t set_signal_catch | ( | ) |
signal catching
|
static |
|
static |
void sig_handler | ( | int | signo | ) |
Signal handler
errno_t streamCTRL_CTRLscreen_cli | ( | ) |
int user_function | ( | ) |
errno_t write_process_exit_report | ( | const char *restrict | errortypestring | ) |
Write to disk a process report.
This function is typically called upon crash to help debugging
errortypestring describes the type of error or reason to issue report
errno_t write_process_log | ( | ) |
Write entry into debug log.
void * xmalloc | ( | int | size | ) |
void yy_scan_string | ( | const char * | ) |
int yylex_destroy | ( | void | ) |
int C_ERRNO |
char calctmpimname[200] |
|
static |
int CLIexecuteCMDready = 0 |
int CLImatchMode = 0 |
pid_t CLIPID |
important directories and info
char CLIstartupfilename[200] = "CLIstartup.txt" |
void* DLib_handle[1000] |
int DLib_index |
|
static |
char line[500] |
int Listimfile = 0 |
int rlquit = false |
uint8_t TYPESIZE[32] |
int Verbose = 0 |