NetcanOS
Netcan OS is an operation system for x86 PCs, for learning how os works.
宏定义 | 枚举 | 函数
stdio.c 文件参考
#include <video_terminal.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>

宏定义

#define is_digit(x)   ((x) >= '0' && (x) <= '9')
 

枚举

enum  FLAG {
  ZEROPAD = 0x01, SIGN = 0x01 << 1, LEFT = 0x01 << 2, BASESIGN = 0x01 << 3,
  LOWER = 0x01 << 4, SPACE = 0x01 << 5, PLUS = 0x01 << 6
}
 

函数

int vsprintf (char *str, const char *fmt, va_list args)
 格式化输出字符串。 更多...
 
int printf (const char *fmt,...)
 格式化输出。 更多...
 

宏定义说明

◆ is_digit

#define is_digit (   x)    ((x) >= '0' && (x) <= '9')

枚举类型说明

◆ FLAG

enum FLAG
枚举值
ZEROPAD 

用0填充

SIGN 

是否有符号

LEFT 

左对齐

BASESIGN 

显示0x

LOWER 

16进制是否小写

SPACE 

在正数前面加一个空格

PLUS 

显示加号

函数说明

◆ printf()

int printf ( const char *  fmt,
  ... 
)

格式化输出。

参数
fmt格式
...参数列表
返回
成功就返回输出字符的字符个数,否则返回负数

◆ vsprintf()

int vsprintf ( char *  str,
const char *  fmt,
va_list  args 
)

格式化输出字符串。

参数
str输出字符串缓冲区
fmt格式
args参数列表
返回
成功就返回输出字符的字符个数,否则返回负数