📄 misc.c
字号:
/*
* Copyright (c) 2004 Security Architects Corporation. All rights reserved.
*
* Module Name:
*
* misc.c
*
* Abstract:
*
* This module implements various miscellaneous routines.
*
* Author:
*
* Eugene Tsyrklevich 24-Feb-2004
*
* Revision History:
*
* None.
*/
#include "misc.h"
#include "process.h"
#include "userland.h"
#include "policy.h"
#include "token.h"
BOOLEAN BootingUp = FALSE;
/*
* atoi()
*
* Description:
* Convert a given string to an integer.
*
* Parameters:
* buf - Pointer to a source character string.
*
* Returns:
* String's integer value (0 in case of an error).
*/
INT32
atoi(IN PCHAR buf)
{
int ret = 0;
while (*buf >= '0' && *buf <= '9')
{
ret *= 10;
ret += *buf - '0';
buf++;
}
return ret;
}
/*
* itoa()
*
* Description:
* Convert an integer to a string.
*
* Parameters:
* value - Number to be converted.
* string - String result.
* radix - Base of value; must be in the range 2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -