📄 api.h
字号:
_X_ static inline objectKey textGetConsoleOutput(void){ // Proto: kernelTextOutputStream *kernelTextGetConsoleOutput(void); // Desc : Returns a reference to the console output stream. This is where kernel logging output goes by default. return ((objectKey) sysCall_0(_fnum_textGetConsoleOutput));}_X_ static inline int textSetConsoleOutput(objectKey newStream){ // Proto: int kernelTextSetConsoleOutput(kernelTextOutputStream *); // Desc : Changes the console output stream. GUI programs can use this function to redirect output to a text area or text field, for example. return (sysCall_1(_fnum_textSetConsoleOutput, newStream));}_X_ static inline objectKey textGetCurrentInput(void){ // Proto: kernelTextInputStream *kernelTextGetCurrentInput(void); // Desc : Returns a reference to the input stream of the current process. This is where standard input (for example, from a getc() call) is received. return ((objectKey) sysCall_0(_fnum_textGetCurrentInput));}_X_ static inline int textSetCurrentInput(objectKey newStream){ // Proto: int kernelTextSetCurrentInput(kernelTextInputStream *); // Desc : Changes the current input stream. GUI programs can use this function to redirect input to a text area or text field, for example. return (sysCall_1(_fnum_textSetCurrentInput, newStream));}_X_ static inline objectKey textGetCurrentOutput(void){ // Proto: kernelTextOutputStream *kernelTextGetCurrentOutput(void); // Desc : Returns a reference to the console output stream. return ((objectKey) sysCall_0(_fnum_textGetCurrentOutput));}_X_ static inline int textSetCurrentOutput(objectKey newStream){ // Proto: int kernelTextSetCurrentOutput(kernelTextOutputStream *); // Desc : Changes the current output stream. This is where standard output (for example, from a putc() call) goes. return (sysCall_1(_fnum_textSetCurrentOutput, newStream));}_X_ static inline int textGetForeground(void){ // Proto: int kernelTextGetForeground(void); // Desc : Get the current foreground color as an int value. Currently this is only applicable in text mode, and the color value should be treated as a PC built-in color value. Here is a listing: 0=Black, 4=Red, 8=Dark gray, 12=Light red, 1=Blue, 5=Magenta, 9=Light blue, 13=Light magenta, 2=Green, 6=Brown, 10=Light green, 14=Yellow, 3=Cyan, 7=Light gray, 11=Light cyan, 15=White return (sysCall_0(_fnum_textGetForeground));}_X_ static inline int textSetForeground(int foreground){ // Proto: int kernelTextSetForeground(int); // Desc : Set the current foreground color from an int value. Currently this is only applicable in text mode, and the color value should be treated as a PC builtin color value. See chart above. return (sysCall_1(_fnum_textSetForeground, (void *) foreground));}_X_ static inline int textGetBackground(void){ // Proto: int kernelTextGetBackground(void); // Desc : Get the current background color as an int value. Currently this is only applicable in text mode, and the color value should be treated as a PC builtin color value. See chart above. return (sysCall_0(_fnum_textGetBackground));}_X_ static inline int textSetBackground(int background){ // Proto: int kernelTextSetBackground(int); // Desc : Set the current foreground color from an int value. Currently this is only applicable in text mode, and the color value should be treated as a PC builtin color value. See chart above. return (sysCall_1(_fnum_textSetBackground, (void *) background));}_X_ static inline int textPutc(int ascii){ // Proto: int kernelTextPutc(int); // Desc : Print a single character return (sysCall_1(_fnum_textPutc, (void*)ascii));}_X_ static inline int textPrint(const char *str){ // Proto: int kernelTextPrint(const char *); // Desc : Print a string return (sysCall_1(_fnum_textPrint, (void *) str));}_X_ static inline int textPrintLine(const char *str){ // Proto: int kernelTextPrintLine(const char *); // Desc : Print a string with a newline at the end return (sysCall_1(_fnum_textPrintLine, (void *) str));}_X_ static inline void textNewline(void){ // Proto: void kernelTextNewline(void); // Desc : Print a newline sysCall_0(_fnum_textNewline);}_X_ static inline int textBackSpace(void){ // Proto: void kernelTextBackSpace(void); // Desc : Backspace the cursor, deleting any character there return (sysCall_0(_fnum_textBackSpace));}_X_ static inline int textTab(void){ // Proto: void kernelTextTab(void); // Desc : Print a tab return (sysCall_0(_fnum_textTab));}_X_ static inline int textCursorUp(void){ // Proto: void kernelTextCursorUp(void); // Desc : Move the cursor up one row. Doesn't affect any characters there. return (sysCall_0(_fnum_textCursorUp));}_X_ static inline int textCursorDown(void){ // Proto: void kernelTextCursorDown(void); // Desc : Move the cursor down one row. Doesn't affect any characters there. return (sysCall_0(_fnum_textCursorDown));}_X_ static inline int textCursorLeft(void){ // Proto: void kernelTextCursorLeft(void); // Desc : Move the cursor left one column. Doesn't affect any characters there. return (sysCall_0(_fnum_ternelTextCursorLeft));}_X_ static inline int textCursorRight(void){ // Proto: void kernelTextCursorRight(void); // Desc : Move the cursor right one column. Doesn't affect any characters there. return (sysCall_0(_fnum_textCursorRight));}_X_ static inline void textScroll(int upDown){ // Proto: void kernelTextScroll(int upDown) // Desc : Scroll the current text area up (-1) or down (+1) sysCall_1(_fnum_textScroll, (void *) upDown);}_X_ static inline int textGetNumColumns(void){ // Proto: int kernelTextGetNumColumns(void); // Desc : Get the total number of columns in the text area. return (sysCall_0(_fnum_textGetNumColumns));}_X_ static inline int textGetNumRows(void){ // Proto: int kernelTextGetNumRows(void); // Desc : Get the total number of rows in the text area. return (sysCall_0(_fnum_textGetNumRows));}_X_ static inline int textGetColumn(void){ // Proto: int kernelTextGetColumn(void); // Desc : Get the number of the current column. Zero-based. return (sysCall_0(_fnum_textGetColumn));}_X_ static inline void textSetColumn(int c){ // Proto: void kernelTextSetColumn(int); // Desc : Set the number of the current column. Zero-based. Doesn't affect any characters there. sysCall_1(_fnum_textSetColumn, (void *) c);}_X_ static inline int textGetRow(void){ // Proto: int kernelTextGetRow(void); // Desc : Get the number of the current row. Zero-based. return (sysCall_0(_fnum_textGetRow));}_X_ static inline void textSetRow(int r){ // Proto: void kernelTextSetRow(int); // Desc : Set the number of the current row. Zero-based. Doesn't affect any characters there. sysCall_1(_fnum_textSetRow, (void *) r);}_X_ static inline void textSetCursor(int on){ // Proto: void kernelTextSetCursor(int); // Desc : Turn the cursor on (1) or off (0) sysCall_1(_fnum_textSetCursor, (void *) on);}_X_ static inline int textScreenClear(void){ // Proto: void kernelTextScreenClear(void); // Desc : Erase all characters in the text area and set the row and column to (0, 0) return (sysCall_0(_fnum_textScreenClear));}_X_ static inline int textScreenSave(void){ // Proto: int kernelTextScreenSave(void); // Desc : Save the current screen in an internal buffer. Use with the textScreenRestore function. return (sysCall_0(_fnum_textScreenSave));}_X_ static inline int textScreenRestore(void){ // Proto: int kernelTextScreenRestore(void); // Desc : Restore the screen previously saved with the textScreenSave function return (sysCall_0(_fnum_textScreenRestore));}_X_ static inline int textInputStreamCount(objectKey strm){ // Proto: int kernelTextInputStreamCount(kernelTextInputStream *); // Desc : Get the number of characters currently waiting in the specified input stream return (sysCall_1(_fnum_textInputStreamCount, strm));}_X_ static inline int textInputCount(void){ // Proto: int kernelTextInputCount(void); // Desc : Get the number of characters currently waiting in the current input stream return (sysCall_0(_fnum_textInputCount));}_X_ static inline int textInputStreamGetc(objectKey strm, char *cp){ // Proto: int kernelTextInputStreamGetc(kernelTextInputStream *, char *); // Desc : Get one character from the specified input stream (as an integer value). return (sysCall_2(_fnum_textInputStreamGetc, strm, cp));}_X_ static inline int textInputGetc(char *cp){ // Proto: char kernelTextInputGetc(void); // Desc : Get one character from the default input stream (as an integer value). return (sysCall_1(_fnum_textInputGetc, cp));}_X_ static inline int textInputStreamReadN(objectKey strm, int num, char *buff){ // Proto: int kernelTextInputStreamReadN(kernelTextInputStream *, int, char *); // Desc : Read up to 'num' characters from the specified input stream into 'buff' return (sysCall_3(_fnum_textInputStreamReadN, strm, (void *) num, buff));}_X_ static inline int textInputReadN(int num, char *buff){ // Proto: int kernelTextInputReadN(int, char *); // Desc : Read up to 'num' characters from the default input stream into 'buff' return (sysCall_2(_fnum_textInputReadN, (void *)num, buff));}_X_ static inline int textInputStreamReadAll(objectKey strm, char *buff){ // Proto: int kernelTextInputStreamReadAll(kernelTextInputStream *, char *); // Desc : Read all of the characters from the specified input stream into 'buff' return (sysCall_2(_fnum_textInputStreamReadAll, strm, buff));}_X_ static inline int textInputReadAll(char *buff){ // Proto: int kernelTextInputReadAll(char *); // Desc : Read all of the characters from the default input stream into 'buff' return (sysCall_1(_fnum_textInputReadAll, buff));}_X_ static inline int textInputStreamAppend(objectKey strm, int ascii){ // Proto: int kernelTextInputStreamAppend(kernelTextInputStream *, int); // Desc : Append a character (as an integer value) to the end of the specified input stream. return (sysCall_2(_fnum_textInputStreamAppend, strm, (void *) ascii));}_X_ static inline int textInputAppend(int ascii){ // Proto: int kernelTextInputAppend(int); // Desc : Append a character (as an integer value) to the end of the default input stream. return (sysCall_1(_fnum_textInputAppend, (void *) ascii));}_X_ static inline int textInputStreamAppendN(objectKey strm, int num, char *str){ // Proto: int kernelTextInputStreamAppendN(kernelTextInputStream *, int, char *); // Desc : Append 'num' characters to the end of the specified input stream from 'str' return (sysCall_3(_fnum_textInputStreamAppendN, strm, (void *) num, str));}_X_ static inline int textInputAppendN(int num, char *str){ // Proto: int kernelTextInputAppendN(int, char *); // Desc : Append 'num' characters to the end of the default input stream from 'str' return (sysCall_2(_fnum_textInputAppendN, (void *) num, str));}_X_ static inline int textInputStreamRemove(objectKey strm){
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -