⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 allman3.ps

📁 Unix操作系统minix 2.0源码
💻 PS
📖 第 1 页 / 共 5 页
字号:
2372(\256le)S10 I2535(f)S10 R2597(line)S10 I2782(n)S10 R2840(.')S10 I2958(F)S10 R3054(is)S3155(the)S3312(source)S3609(\256le)S3772(and)S10 I3951(n)S10 R4035(the)S4193(source)S4491(line)S4677(number)S5019(of)S5138(the)S2544 V10 B1080(assert)S10 R1357(statement.)S7903 V720(Page)S941(1)S2669(\()S2711(May)S2920(15,)S(1985)200 3070 A3278(\))S4455(September)S4911(17,)S(1996)200 5061 A8143 VEP%%Page: 1 4BP/slant 0 def/height 0 def480 V10 R720(ATOF)S992(\()S1034(3)S1092(\))S2696(Eighth)S(Edition)296 2989 A4855(ATOF)S5127(\()S5169(3)S5227(\))S960 V9 R720(N)S722(NA)S790(AM)S858(ME)S940(E)S1080 V10 R1080(atof,)S1287(atoi,)S1488(atol)S10 R-11664(-)S10 R(convert)302 1746 A2073(ASCII)S2362(to)S2465(numbers)S1248 V9 R720(S)S722(SY)S774(YN)S842(NO)S910(OP)S978(PS)S1030(SI)S1082(IS)S1115(S)S1368 V10 B1080(#include)S1482(<stdlib.h>)S1608 V1080(double)S1409(atof\(const)S1873(char)S2107(*)S10 I2157(nptr)S10 B2324(\))S1728 V1080(int)S1236(atoi\(const)S1694(char)S1928(*)S10 I1978(nptr)S10 B2145(\))S1848 V1080(long)S1302(atol\(const)S1760(char)S1994(*)S10 I2044(nptr)S10 B2211(\))S2016 V9 R720(D)S722(DE)S790(ES)S848(SC)S900(CR)S962(RI)S1024(IP)S1057(PT)S1109(TI)S1167(IO)S1200(ON)S1268(N)S2136 V10 R1080(These)S1351(functions)S(convert)302 1755 A2087(a)S2162(string)S2421(pointed)S2752(to)S2860(by)S10 I2990(nptr)S10 R3187(to)S3295(\257oating,)S3658(integer,)S3994(and)S(long)178 4170 A4379(integer)S4690(representation)S2256 V1080(respectively.)S1642(The)S1824(\256rst)S(unrecognized)542 2006 A2573(character)S2969(ends)S3178(the)S3326(string.)S2424 V10 B1080(Atof)S10 R(recognizes)431 1307 A1774(an)S1905(optional)S2270(string)S2535(of)S(spaces,)288 2655 A2979(then)S3188(an)S3320(optional)S3686(sign,)S3915(then)S4125(a)S4207(string)S4473(of)S4594(digits)S4854(optionally)S2544 V1080(containing)S1529(a)S1599(decimal)S1943(point,)S2199(then)S2397(an)S2517(optional)S2871(`e')S3009(or)S3118(`E')S3273(followed)S3656(by)S3781(an)S3901(optionally)S4333(signed)S4620(integer.)S2712 V10 B1080(Atoi)S10 R1290(and)S10 B1460(atol)S10 R(recognize)392 1647 A2064(an)S2184(optional)S2538(string)S2792(of)S(spaces,)288 2901 A3214(then)S3412(an)S3532(optional)S3886(sign,)S4103(then)S4301(a)S4371(string)S4625(of)S4734(digits.)S2880 V9 R720(S)S722(SE)S774(EE)S832(E)S928(A)S930(AL)S998(LS)S1056(SO)S1108(O)S3000 V10 B1080(strtol)S10 R1310(\(3\),)S10 B1478(strtod)S10 R1736(\(3\),)S10 B1904(scanf)S10 R2128(\(3\).)S3168 V9 R720(B)S722(BU)S784(UG)S852(GS)S920(S)S3288 V10 R1080(There)S1341(are)S1490(no)S1615(provisions)S2058(for)S2201(over\257ow.)S7903 V720(Page)S941(1)S2669(\()S2711(May)S2920(15,)S(1985)200 3070 A3278(\))S4455(September)S4911(17,)S(1996)200 5061 A8143 VEP%%Page: 1 5BP/slant 0 def/height 0 def480 V10 R720(BSTRING)S1160(\()S1202(3)S1260(\))S2696(Eighth)S(Edition)296 2989 A4687(BSTRING)S5127(\()S5169(3)S5227(\))S960 V9 R720(N)S722(NA)S790(AM)S858(ME)S940(E)S1080 V10 R1080(bstring,)S(bcopy,)270 1409 A1704(bcmp,)S1977(bzero,)S2251(ffs)S10 R-12383(-)S10 R2465(bit)S2596(and)S2766(byte)S2964(string)S3218(operations)S1248 V9 R720(S)S722(SY)S774(YN)S842(NO)S910(OP)S978(PS)S1030(SI)S1082(IS)S1115(S)S1368 V10 B1080(#include)S1482(<sys/types.h>)S1488 V1080(#include)S1482(<string.h>)S1608 V1080(#include)S1482(<unistd.h>)S1848 V1080(void)S1302(bcopy\(const)S1855(void)S2077(*)S10 I2127(src)S10 B2250(,)S2313(void)S2535(*)S10 I2585(dst)S10 B2702(,)S2765(size_t)S10 I3044(length)S10 B3295(\))S1968 V1080(int)S1236(bcmp\(const)S1773(void)S1995(*)S10 I2045(b1)S10 B2145(,)S2208(const)S2470(void)S2692(*)S10 I2742(b2)S10 B2842(,)S2905(size_t)S10 I3184(length)S10 B3435(\))S2088 V1080(void)S(bzero\(void)459 1302 A1799(*)S10 I1849(dst)S10 B1966(,)S2029(size_t)S10 I2308(length)S10 B2559(\))S2208 V1080(int)S1236(ffs\(int)S10 I1533(i)S10 B1561(\))S2376 V9 R720(D)S722(DE)S790(ES)S848(SC)S900(CR)S962(RI)S1024(IP)S1057(PT)S1109(TI)S1167(IO)S1200(ON)S1268(N)S2496 V10 R1080(The)S1265(functions)S10 B1667(bcopy)S10 R1924(,)S10 B1977(bcmp)S10 R2218(,)S2271(and)S10 B(bzero)241 2444 A10 R2714(operate)S3040(on)S3169(variable)S3523(length)S3803(strings)S4100(of)S4213(bytes.)S4504(They)S4740(do)S4869(not)S5026(check)S2616 V1080(for)S1223(null)S1404(bytes)S1641(as)S1750(the)S1898(routines)S2247(in)S10 B2350(string)S10 R2602(\(3\))S2745(do.)S2784 V10 B1080(Bcopy)S10 R1373(copies)S10 I1655(length)S10 R1931(bytes)S2168(from)S2389(string)S10 I2643(src)S10 R2791(to)S2894(the)S3042(string)S10 I3296(dst)S10 R3421(.)S2952 V10 B1080(Bcmp)S10 R1358(compares)S1770(byte)S1969(string)S10 I2224(b1)S10 R2350(against)S2662(byte)S2862(string)S10 I3118(b2)S10 R3226(,)S3278(returning)S3674(zero)S3875(if)S3964(they)S4164(are)S4315(identical,)S(non-zero)358 4714 A5099(oth-)S3072 V1080(erwise.)S1419(Both)S1639(strings)S1932(are)S2081(assumed)S2452(to)S2555(be)S10 I2675(length)S10 R2951(bytes)S(long.)203 3188 A3240 V10 B(Bzero)252 1080 A10 R(places)252 1357 A10 I1634(length)S10 R1910(0)S1985(bytes)S2222(in)S2325(the)S2473(string)S10 I2727(b1)S10 R2835(.)S3408 V10 B1080(Ffs)S10 R1246(\256nd)S1433(the)S1587(\256rst)S1776(bit)S1914(set)S2058(in)S2168(the)S2323(argument)S2735(passed)S3035(it)S3123(and)S3300(returns)S3612(the)S3767(index)S4022(of)S4138(that)S4321(bit.)S4509(Bits)S4703(are)S4859(numbered)S3528 V1080(starting)S1407(at)S1505(1.)S1630(A)S1728(return)S1994(value)S2237(of)S2346(0)S2421(indicates)S2804(the)S2952(value)S3195(passed)S3488(is)S3580(zero.)S3696 V9 R720(B)S722(BU)S784(UG)S852(GS)S920(S)S3816 V10 R1080(The)S10 B1268(bcopy)S10 R1525(,)S10 B1581(bcmp)S10 R1822(,)S1878(and)S10 B(bzero)241 2054 A10 R2326(functions)S2731(are)S2886(obsolete;)S3280(new)S3479(code)S(should)267 3700 A3998(use)S10 B4163(memmove)S10 R4605(,)S10 B4661(memcmp)S10 R5059(,)S5116(and)S3936 V10 B1080(memset)S10 R1436(respectively.)S4104 V1080(The)S10 B1262(bcopy)S10 R1544(routine)S1854(takes)S2086(parameters)S2554(backwards)S3010(from)S10 B3231(memcpy)S10 R3595(,)S10 B3645(memmove)S10 R4087(,)S4137(and)S10 B4307(strcpy)S10 R4576(.)S7903 V720(Page)S941(1)S4455(September)S4911(17,)S(1996)200 5061 A8143 VEP%%Page: 1 6BP/slant 0 def/height 0 def480 V10 R720(CRYPT)S1053(\()S1095(3)S1153(\))S2696(Eighth)S(Edition)296 2989 A4794(CRYPT)S5127(\()S5169(3)S5227(\))S960 V9 R720(N)S722(NA)S790(AM)S858(ME)S940(E)S1080 V10 R1080(crypt)S10 R-11312(-)S10 R1394(one-way)S1766(password)S2171(encryption)S2626(function)S1248 V9 R720(S)S722(SY)S774(YN)S842(NO)S910(OP)S978(PS)S1030(SI)S1082(IS)S1115(S)S1368 V10 B1080(#de\256ne)S(_MINIX_SOURCE)839 1426 A2303(1)S1488 V1080(#include)S1482(<unistd.h>)S1728 V1080(char)S1314(*crypt\(const)S1890(char)S2124(*)S10 I(key)135 2174 A10 B2309(,)S2372(const)S2634(char)S2868(*)S10 I2918(salt)S10 B3063(\))S1896 V9 R720(D)S722(DE)S790(ES)S848(SC)S900(CR)S962(RI)S1024(IP)S1057(PT)S1109(TI)S1167(IO)S1200(ON)S1268(N)S2016 V10 R1080(The)S1266(\256rst)S1452(use)S1615(of)S10 B(crypt\(\))298 1728 A10 R2055(is)S2151(to)S2258(encrypt)S2589(a)S2663(password.)S3122(Its)S(second)279 3252 A3560(use)S3723(is)S3819(to)S3927(authenticate)S4444(a)S4519(shadow)S4856(password.)S2136 V1080(In)S1189(both)S1392(cases)S10 B(crypt\(\))298 1630 A10 R1953(calls)S10 B2163(pwdauth)S10 R2544(\(8\))S2687(to)S2790(do)S2915(the)S3063(real)S3240(work.)S2304 V10 B(Crypt\(\))326 1080 A10 R1432(encrypts)S1799(a)S1870(password)S2276(if)S2364(called)S2631(with)S2836(a)S2907(user)S3101(typed)S3350(key,)S3546(and)S3717(a)S3788(salt)S3954(whose)S4237(\256rst)S4420(two)S4597(characters)S5033(are)S5183(in)S2424 V1080(the)S1238(set)S1385([./0-9A-Za-z].)S2018(The)S2210(result)S2469(is)S2571(a)S2651(character)S3057(string)S3321(in)S3434(the)S3592([./0-9A-Za-z])S4174(alphabet)S4549(of)S4667(which)S4947(the)S5104(\256rst)S2544 V1080(two)S1256(characters)S1691(are)S1840(equal)S2083(to)S2186(the)S2334(salt,)S2524(and)S2694(the)S2842(rest)S3013(is)S3105(the)S3253(result)S3502(of)S3611(encrypting)S4066(the)S4214(key)S4384(and)S4554(the)S4702(salt.)S2712 V1080(If)S10 B(crypt\(\))298 1178 A10 R1506(is)S1604(called)S1876(with)S2086(a)S2162(salt)S2333(that)S2515(has)S2680(the)S2834(form)S10 B3061(##)S10 I3161(user)S10 R3365(then)S3569(the)S3723(key)S3899(is)S3997(encrypted)S4425(and)S4601(compared)S5029(to)S5138(the)S2832 V1080(encrypted)S1516(password)S1935(of)S10 I2058(user)S10 R2270(in)S2387(the)S2549(shadow)S2895(password)S3314(\256le.)S3532(If)S3639(they)S3851(are)S4014(equal)S4271(then)S10 B(crypt\(\))298 4483 A10 R4820(returns)S5138(the)S2952 V10 B1080(##)S10 I1180(user)S10 R1387(argument,)S1826(if)S1922(not)S2084(then)S2291(some)S2537(other)S2778(string)S3041(is)S3142(returned.)S3562(This)S3775(trick)S3994(assures)S4319(that)S4504(the)S4661(normal)S4980(way)S5183(to)S3072 V1080(authenticate)S1592(a)S1662(password)S(still)151 2067 A2243(works:)S3240 V1440(if)S1527(\(strcmp\(pw->pw_passwd,)S2602(crypt\(key,)S(pw->pw_passwd\)\)\))785 3038 A(...)75 3848 A3408 V1080(If)S10 I(key)135 1175 A10 R1337(is)S1431(a)S1503(null)S1687(string,)S1969(and)S2142(the)S2293(shadow)S2628(password)S3036(is)S3131(a)S3204(null)S3388(string)S3645(or)S3757(the)S3908(salt)S4076(is)S4171(a)S4244(null)S4428(string)S4685(then)S4886(the)S5037(result)S3528 V1080(equals)S10 I1369(salt)S10 R1522(.)S1604(\(This)S1849(is)S(because)319 1948 A2299(the)S2454(caller)S2711(can't)S2945(tell)S3106(if)S3200(a)S3277(password)S3689(\256eld)S3900(is)S3998(empty)S4280(in)S4389(the)S4543(shadow)S4881(password)S3648 V1080(\256le.\))S3816 V1080(The)S1262(key)S1432(and)S1602(salt)S1767(are)S1916(limited)S2226(to)S(1024)200 2329 A2554(bytes)S2791(total)S2995(including)S3399(the)S3547(null)S3728(bytes.)S3984 V9 R720(F)S722(FI)S774(IL)S807(LE)S865(ES)S923(S)S4104 V10 R(/usr/lib/pwdauth)659 1080 A2330(The)S2512(password)S2917(authentication)S3512(program)S4272 V9 R720(S)S722(SE)S774(EE)S832(E)S913(A)S915(AL)S983(LS)S1041(SO)S1093(O)S4392 V10 B1080(getpass)S10 R1393(\(3\),)S10 B1561(getpwent)S10 R1954(\(3\),)S

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -