names.c

来自「使用于OS/2下的小工具的C源程序,使用于OS/2下的小工具的C源程序」· C语言 代码 · 共 48 行

C
48
字号
/*
* NAMES.C - Generate new names based an mask given on the command line.
*
*
* PROGRAMMER:	    Martti Ylikoski
* CREATED:	    24.11.1991
*/
static char *VERSION = "Version 1.0, Copyright(c) Martti Ylikoski, 1991" ;
/*
*/

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <param.h>
#include <paramstd.h>
static char *progname ;
extern unsigned long pflags ;

ParamEntry pentry[12] = {
     "P", &ParamSetPause, 0,
     "F", &ParamSetFold, 0,
     "V", &ParamSetVerbose, 1,
     "R", &ParamSetReport, 0,
     "S", &ParamSetSubDirs, 0,
     "?", &ParamSetHelp, 1,
     "H", &ParamSetHelp, 1,
     "NOD", &ParamSetNoDefault, 0,
     "TEST", &ParamSetTest, 1,
     "Y", &ParamSetYes, 1,
     "N", &ParamSetTest, 1,
     "\0", NULL, 0
} ;

ParamBlock params = {
    "/-",   IGNORECASE | NOPRIORITY | NOTRIGGERSALLOWED ,
    pentry
} ;

/* Macro to get a random integer within a specified range */
#define getrandom( min, max ) ((rand() % (int)(((max)+1) - (min))) + (min))

/* prototypes */
int main(int argc, char *argv[]) ;
static void GenName( char *mask ) ;

static char *consonants = "bcdfghjklmnpqrstvxz" ;
static char *vowels = "aeiouy" ; /* 唲

⌨️ 快捷键说明

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