(linenum→info "unix/slp.c:2238")

glibc/2.7/crypt/ufc.c

    1: /*
    2:  * UFC-crypt: ultra fast crypt(3) implementation
    3:  *
    4:  * Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
    5:  *
    6:  * This library is free software; you can redistribute it and/or
    7:  * modify it under the terms of the GNU Lesser General Public
    8:  * License as published by the Free Software Foundation; either
    9:  * version 2.1 of the License, or (at your option) any later version.
   10:  *
   11:  * This library is distributed in the hope that it will be useful,
   12:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   13:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   14:  * Lesser General Public License for more details.
   15:  *
   16:  * You should have received a copy of the GNU Lesser General Public
   17:  * License along with the GNU C Library; see the file COPYING.LIB.  If not,
   18:  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   19:  * Boston, MA 02111-1307, USA.
   20:  *
   21:  * @(#)ufc.c    2.7 9/10/96
   22:  *
   23:  * Stub main program for debugging
   24:  * and benchmarking.
   25:  *
   26:  */
   27: 
   28: #include <stdio.h>
   29: 
   30: char *crypt();
   31: 
   32: main(argc, argv)
   33:   int argc;
   34:   char **argv;
   35:   { char *s;
   36:     unsigned long i,iterations;
   37: 
   38:     if(argc != 2) {
   39:       fprintf(stderr, "usage: ufc iterations\n");
   40:       exit(1);
   41:     }
   42:     argv++;
   43:     iterations = atoi(*argv);
   44:     printf("ufc: running %d iterations\n", iterations);
   45: 
   46:     for(i=0; i<iterations; i++)
   47:       s=crypt("foob","ar");
   48:     if(strcmp(s, "arlEKn0OzVJn.") == 0)
   49:       printf("OK\n");
   50:     else {
   51:       printf("wrong result: %s!!\n", s);
   52:       exit(1);
   53:     }
   54:     exit(0);
   55:   }
   56: 
Syntax (Markdown)