Mercurial > hg > early-roguelike
annotate rogue4/findpw.c @ 197:61d1c9ac9be7
Advanced Rogue 5: rearrange some of mdport.c.
process.h is now included in the proper place for compiling with MSVC.
md_sleep() has been removed.  If it were used anywhere, it could have
been fixed by replacing _sleep() with Sleep().
| author | John "Elwin" Edwards | 
|---|---|
| date | Tue, 11 Aug 2015 15:29:31 -0400 | 
| parents | 9535a08ddc39 | 
| children | 
| rev | line source | 
|---|---|
| 
12
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
1 /* | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
2 * print out an encrypted password on the standard output | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
3 * | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
4 * @(#)findpw.c 1.1 (Berkeley) 12/20/81 | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
5 * | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
6 * Rogue: Exploring the Dungeons of Doom | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
7 * Copyright (C) 1980, 1981, 1982 Michael Toy, Ken Arnold and Glenn Wichman | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
8 * All rights reserved. | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
9 * | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
10 * See the file LICENSE.TXT for full copyright and licensing information. | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
11 */ | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
12 | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
13 #include <stdio.h> | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
14 | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
15 main() | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
16 { | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
17 char buf[80]; | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
18 | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
19 fprintf(stderr, "Password: "); | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
20 fgets(buf, 80, stdin); | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
21 buf[strlen(buf) - 1] = '\0'; | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
22 printf("%s\n", xcrypt(buf, "mT")); | 
| 
 
9535a08ddc39
Import Rogue 5.2 from the Roguelike Restoration Project (r1490)
 
edwarj4 
parents:  
diff
changeset
 | 
23 } | 
