SYS/BIOS  7.00
System.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
40 #ifndef ti_sysbios_runtime_System__include
41 #define ti_sysbios_runtime_System__include
42 
43 #include <stdarg.h>
44 #include <stdbool.h>
45 #include <stddef.h>
46 #include <stdint.h>
47 
49 /* BIOS 6.x compatibility, use -Dxdc_std__include to disable */
50 #include <xdc/std.h>
51 
52 #define ti_sysbios_runtime_System_long_names
53 #include "System_defs.h"
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
67 #define System_A_cannotFitIntoArg "sizeof(float) > sizeof(intptr_t)"
68 
70 typedef struct System_ParseData System_ParseData;
71 typedef struct System_Module_State System_Module_State;
72 typedef int (*System_ExtendFxn)(char** arg1, const char ** arg2, va_list* arg3, System_ParseData* arg4);
81 typedef void (*System_AtexitHandler)(int arg1);
82 
84 struct System_ParseData {
85  int width;
86  bool lFlag;
87  bool lJust;
88  int precis;
89  unsigned int len;
90  int zpad;
91  char *end;
92  bool aFlag;
93  char *ptr;
94 };
95 
96 struct System_Module_State {
97  System_AtexitHandler *atexitHandlers;
98  int numAtexitHandlers;
99  bool initDone;
100 };
109 typedef void (*System_AbortFxn)(void);
110 
117 typedef void (*System_ExitFxn)(int arg1);
118 
125 extern const int System_maxAtexitHandlers;
126 
135 extern const System_AbortFxn System_abortFxn;
136 
145 extern const System_ExitFxn System_exitFxn;
146 
148 extern const System_ExtendFxn System_extendFxn;
149 
150 extern void System_init(void);
162 extern void System_abort(const char * str);
163 
171 extern void System_abortStd(void);
172 
180 extern void System_abortSpin(void);
181 
200 extern bool System_atexit(System_AtexitHandler handler);
201 
211 extern void System_exit(int stat);
212 
222 extern void System_exitStd(int stat);
223 
233 extern void System_exitSpin(int stat);
234 
243 extern void System_putch(char ch);
244 
254 extern void System_flush (void);
255 
321 extern int System_printf(const char * fmt, ...);
322 
338 extern int System_sprintf(char buf[], const char * fmt, ...);
339 
355 extern int System_vprintf(const char * fmt, va_list va);
356 
373 extern int System_vsprintf(char buf[], const char * fmt, va_list va);
374 
396 extern int System_snprintf(char buf[], size_t n, const char * fmt, ...);
397 
418 extern int System_vsnprintf(char buf[], size_t n, const char * fmt, va_list va);
419 
421 extern void System_processAtExit(int stat);
422 extern int System_printf_va(const char * fmt, va_list _va);
423 extern int System_aprintf_va(const char * fmt, va_list _va);
424 extern int System_sprintf_va(char buf[], const char * fmt, va_list _va);
425 extern int System_asprintf_va(char buf[], const char * fmt, va_list _va);
426 extern int System_snprintf_va(char buf[], size_t n, const char * fmt, va_list _va);
427 extern int System_aprintf(const char * fmt, ...);
428 extern int System_asprintf(char buf[], const char * fmt, ...);
429 extern int System_avprintf(const char * fmt, va_list va);
430 extern int System_avsprintf(char buf[], const char * fmt, va_list va);
431 extern int System_printfExtend(char **bufp, const char * *fmt, va_list *va, System_ParseData *parse);
432 extern int System_doPrint(char buf[], size_t n, const char * fmt, va_list *pva, bool aFlag);
433 extern void System_lastFxn(void);
434 extern void System_putchar(char **bufp, char ch, size_t *n);
435 extern void System_rtsExit(void);
436 extern bool System_atexitDone( void);
437 extern System_Module_State System_Module_state;
438 
439 #define System_module ((System_Module_State *) &(System_Module_state))
440 
442 #ifdef __cplusplus
443 }
444 #endif
445 #endif /* ti_sysbios_runtime_System__include */
446 
448 #undef ti_sysbios_runtime_System_long_names
449 #include "System_defs.h"
const System_AbortFxn System_abortFxn
Abort handler function.
void System_flush(void)
Flush standard System I/O.
int System_vsprintf(char buf[], const char *fmt, va_list va)
A va_list sprintf.
int System_vsnprintf(char buf[], size_t n, const char *fmt, va_list va)
A va_list snprintf.
void(* System_ExitFxn)(int arg1)
System exit function prototype.
Definition: System.h:117
void System_exit(int stat)
Exit currently running executable.
void System_abort(const char *str)
Print a message and abort currently running executable.
int System_vprintf(const char *fmt, va_list va)
A va_list printf.
const System_ExitFxn System_exitFxn
Exit handler function.
void(* System_AbortFxn)(void)
System abort function prototype.
Definition: System.h:109
void(* System_AtexitHandler)(int arg1)
System&#39;s atexit function prototype.
Definition: System.h:81
const int System_maxAtexitHandlers
Maximum number of dynamic atexit handlers allowed in the system.
void System_abortStd(void)
ANSI C Standard implementation of abortFxn function.
void System_exitSpin(int stat)
Implements an exitFxn function.
int System_printf(const char *fmt,...)
A smaller faster printf.
int System_sprintf(char buf[], const char *fmt,...)
Write formated output to a character buffer.
void System_putch(char ch)
Output a single character.
void System_exitStd(int stat)
Implements an exitFxn function.
void System_abortSpin(void)
Lightweight implementation of abortFxn function.
int System_snprintf(char buf[], size_t n, const char *fmt,...)
Write formated output to a character buffer.
bool System_atexit(System_AtexitHandler handler)
Add an exit handler.
© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale