資源簡介
delphi 2007安裝程序下source目錄源代碼

代碼片段和文件信息
/*---------------------------------------------------------------------------
?*?filename?-?cgets.c
?*
?*?function(s)
?*????????cgets?-?reads?string?from?console
?*--------------------------------------------------------------------------*/
/*
?*??????C/C++?Run?Time?Library?-?Version?13.0
?*
?*??????Copyright?(c)?1987?2007?by?CodeGear
?*??????All?Rights?Reserved.
?*
?*/
/*?$Revision:?19389?$????????*/
#if?0
#define?INCL_KBD
#include?
#define?KBD_ASC_MODE?(KEYBOARD_ECHO_ON?|?KEYBOARD_ASCII_MODE)
#endif
#include?
#if?defined(_MBCS)
#include?
#include?
#endif
/*--------------------------------------------------------------------------*
Name????????????cgets?-?reads?string?from?console
Usage???????????char?*cgets(char?*string);
Prototype?in????conio.h
Description?????cgets?reads?a?string?of?characters?from?the?console
????????????????storing?the?string?(and?the?string?length)?in?the
????????????????location?pointed?to?by?string.
????????????????cgets?reads?characters?until?it?encounters?a?CR/LF?or
????????????????until?the?maximum?allowable?number?of?characters?have
????????????????been?read.
????????????????Before?cgets?is?called?string[0]?should?be?set?to?the
????????????????maximum?length?of?the?string?to?be?read.
Return?value????string[1]?is?set?to?the?number?of?characters?actually
????????????????read.
????????????????&string[2]?a?pointer?to?the?string?of?characters?that
????????????????were?read.??There?is?no?error?return.
*---------------------------------------------------------------------------*/
char?*?_RTLENTRY?_EXPFUNC?cgets(char?*s)
{
#if?0
????KBDINFO?????kinfo;
????STRINGINBUF?string;
????int?????????changed_mode;
????USHORT??????old_mask;
????/*?Force?the?keyboard?into?ASCII?mode?so?that?a??will?
?????*?terminate?the?string?read.??Set?keyboard?to?ECHO.
?????*/
????kinfo.cb?=?sizeof(kinfo);
????if?(KbdGetStatus(&kinfo0)?==?0?&&?
???????(kinfo.fsMask?&?KBD_ASC_MODE)?!=?KBD_ASC_MODE)
????{
????????changed_mode?=?1;
????????old_mask?=?kinfo.fsMask;
????????kinfo.fsMask?=?KBD_ASC_MODE;
????????KbdSetStatus(&kinfo0);
????}
????else
????????changed_mode?=?0;
????string.cb?=?(USHORT)(s[0]?&?0xff);
????if?(KbdStringIn(&s[2]?&string?0?0)?==?0)
????{
????????s[1]?=?(char)?string.cb;?????/*?Set?return?length????*/
????????s[string.cchIn?+?2]?=?0;?????/*?Null?terminate?string*/
????}
????else????/*?failure?*/
????????s[1]?=?s[2]?=?0;?????????????/*?Zero?length?string???*/
????/*?If?we?changed?the?keyboard?mode?to?binary?mode?earlier
?????*?change?it?back?to?its?original?mode.
?????*/
????if?(changed_mode)
????{
????????kinfo.fsMask?=?old_mask;
????????KbdSetStatus(&kinfo?0);
????}
????return?(s+2);
#else
????int?c?len?maxlen;
????char?*p?=?s?+?2;
#if?defined(_MBCS)
????char?pending_dbcs_flag?=?0;
#endif
????len?=?0;
????maxlen?=?s[?0?]?&?0xff;
????for?(;;)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄??????????0??2009-05-18?15:39??D2007source
?????目錄??????????0??2009-05-18?15:39??D2007source\cpprtl
?????文件???????1869??2007-08-27?02:03??D2007source\cpprtl\build.bat
?????目錄??????????0??2009-05-18?15:39??D2007source\cpprtl\External
?????文件??????19211??2007-08-27?02:03??D2007source\cpprtl\External\names32.pub
?????目錄??????????0??2009-05-18?15:39??D2007source\cpprtl\lib
?????文件???????2376??2007-08-27?02:03??D2007source\cpprtl\lib\makefile
?????文件???????5169??2007-08-27?02:03??D2007source\cpprtl\makefile
?????文件???????3176??2007-08-27?02:03??D2007source\cpprtl\readme
?????目錄??????????0??2009-05-18?15:39??D2007source\cpprtl\rtlinc
?????文件???????1647??2007-08-27?02:03??D2007source\cpprtl\rtlinc\asmrules.h
?????文件???????1540??2007-08-27?02:03??D2007source\cpprtl\rtlinc\delphimm.h
?????文件????????276??2007-08-27?02:03??D2007source\cpprtl\rtlinc\delphixx.h
?????文件???????3729??2007-08-27?02:03??D2007source\cpprtl\rtlinc\dosexcpt.h
?????文件??????13184??2007-08-27?02:03??D2007source\cpprtl\rtlinc\dstring.h
?????文件???????1719??2007-08-27?02:03??D2007source\cpprtl\rtlinc\entry.inc
?????文件???????2489??2007-08-27?02:03??D2007source\cpprtl\rtlinc\fakeieee.h
?????文件???????2417??2007-08-27?02:03??D2007source\cpprtl\rtlinc\filesys.h
?????文件???????1731??2007-08-27?02:03??D2007source\cpprtl\rtlinc\init.inc
?????文件????????694??2007-08-27?02:03??D2007source\cpprtl\rtlinc\initcat.h
?????文件????????750??2007-08-27?02:03??D2007source\cpprtl\rtlinc\ioconfig.h
?????文件???????1332??2007-08-27?02:03??D2007source\cpprtl\rtlinc\matherr.asi
?????文件???????1579??2007-08-27?02:03??D2007source\cpprtl\rtlinc\ntbc.h
?????文件??????12419??2007-08-27?02:03??D2007source\cpprtl\rtlinc\pcre_int.h
?????文件??????18634??2007-08-27?02:03??D2007source\cpprtl\rtlinc\rules.asi
?????文件??????14742??2007-08-27?02:03??D2007source\cpprtl\rtlinc\safearry.h
?????文件??????17044??2007-08-27?02:03??D2007source\cpprtl\rtlinc\sysclass.h
?????文件???????1959??2007-08-27?02:03??D2007source\cpprtl\rtlinc\syscomp.h
?????文件??????22017??2007-08-27?02:03??D2007source\cpprtl\rtlinc\sysconst.hpp
?????文件???????8037??2007-08-27?02:03??D2007source\cpprtl\rtlinc\syscurr.h
............此處省略3893個文件信息
評論
共有 條評論