misc.c

来自「臭氧层主动防御系统驱动源代码!臭氧层主动防御系统驱动源代码!」· C语言 代码 · 共 73 行

C
73
字号
/*
 * 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 + =
减小字号Ctrl + -
显示快捷键?