亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? menu.c

?? 一個(gè)C語言寫的讀入位置跟蹤器數(shù)據(jù)的源程序
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/****************************************************************************
*****************************************************************************
    menu.c  - Menu Routines

    written for:    Ascension Technology Corporation
                    PO Box 527
                    Burlington, Vermont  05402

                    802-655-7879

    written by:     Jeff Finkelstein

    Modification History:

    10/18/90       jf  - released
    4/23/91        jf  - cleanup unused variables noticed when compiling
                         on UNIX platform
    4/24/91        jf  - added initconsole and restoreconsole routines
                         for UNIX platform
    3/23/92        jf  - update sendmenu to go to 2 columns if the
                         menucount is greater than 16
    12/29/92       jf  - moved all #ifdefs and #defines to column 1
                         for compiler compatibility
    9/20/93        jf  - added getfilename and getfloat

           <<<< Copyright 1990 Ascension Technology Corporation >>>>
*****************************************************************************
****************************************************************************/
#include <stdio.h>      /* general I/O */
#include <stdlib.h>     /* atoi */
#include <string.h>     /* string stuff */
#include "compiler.h"   /* Compiler Specific Header */
#include "menu.h"

/*
    For UNIX environments, IOCTL is used to set the console/terminal
    into RAW mode...store the old config to restore when the
    program is exited

                            *** NOTE ***
    For other environments, the User may have to modify the initconsole()
    and restoreconsole() routines for the menuing functions to perform
    properly
*/
#ifdef UNIX_SGTTY
    struct sgttyb oldstdin_sgttyb;  /* storage for the old config */
    struct sgttyb stdin_sgttyb;     /* passed to ioctl for new config */
#endif

#ifdef UNIX_TERMIO
    struct termio oldstdin_termio;  /* storage for the old config */
    struct termio stdin_termio;     /* passed to ioctl for new config */
#endif

/*
    sendmenuhdr         - Send Menu Header

    Prototype in:       menu.h

    Parameters Passed:  hdrstring, the header to be displayed

    Return Value:       void

    Remarks:            Clears the Screen and Displays the Header
*/
void sendmenuhdr(hdrstring)
char * hdrstring;
{
    CLEARSCREEN;
    printf(hdrstring);
}

/*
    clearconsole        - Clear the System Console

    Prototype in:       menu.h

    Parameters Passed:  void

    Return Value:       void

    Remarks:            The Programmer must add the System Specific Call
                        to clear the system console...for now, the code
                        just performs a New Line
*/
void clearconsole()
{
    /*
        Insert System Call to Clear the Console Screen
    */
    printf("\n\r");
}


/*
    clearkey            - Clears the buffer from STDIN

    Prototype in:       menu.h

    Parameters Passed:  void

    Return Value:       void

    Remarks:            clears STDIN

*/
void clearkey()
{
    while (ckkbhit())
        getkey();
}

/*
    ckkbhit            - Check if a Key is Ready

    Prototype in:       menu.h

    Parameters Passed:  void

    Return Value:       TRUE if a key is Ready, else FALSE

    Remarks:            If DOS, then the Keyboard is checked else, if
                        ANSI/UNIX the routine checks STDIN to see if a key is ready
*/
int ckkbhit()
{

#ifdef DOS
     return(kbhit());
#endif

#ifdef UNIX
     int tempint;        /* define a buffer */

     ioctl(fileno(stdin),TIONREAD,&tempint); /* get the number of keys rdy */
     if (tempint > 0)
         return(TRUE);   /* key is ready */

     return(FALSE);      /* key is not ready */
#endif
}

/*
    getkey              - get a key from the system console

    Prototype in:       menu.h

    Parameters Passed:  void

    Return Value:       key code as an integer

    Remarks:
*/
int getkey()
{
#ifdef DOS
    return(getch());
#endif

#ifdef UNIX
    return(getchar());
#endif
}


/*
    sendmenu            - Send Menu

    Prototype in:       menu.h

    Parameters Passed:  menustringptr   - double pointer to selection
                                          list, with header
                        menucount       - number of valid selections

    Return Value:       intanswer       - answer from the menu selection or
                                          ESC_SEL if ESC was hit

    Remarks:            prompts the user with a list of valid selections
                        numbered 0 through menucount-1, with a prompt string
                        prefacing the first selection (first string in list).
*/
int sendmenu(menustringptr,menucount)
char **menustringptr;
short menucount;
{

#define MENULINELENGTH 80

    short tempcount;
    short intanswer;
    short invalid;
    char **tempmenustringptr;
    short i;
    short menusidelength;
    char menulinebuf[MENULINELENGTH+1];


    do
    {
        invalid = FALSE;
        tempmenustringptr = menustringptr;

        /*
            Put up the Menu Selections
        */
        printf("\n\r%s\n\r",*tempmenustringptr++); /* first put up the header */
        if (menucount <= 16)
        {
            for (tempcount = 0; tempcount<menucount;tempcount++)
                printf("\t\t%3d.  %s\n\r",tempcount, *tempmenustringptr++);
        }
        else
        {   
            menusidelength = menucount/2+(menucount & 1);
            for (tempcount = 0; tempcount<menusidelength;tempcount++)
            {
                /* 
                    fill line with spaces 
                */
                for (i=0;i<MENULINELENGTH;i++)
                    menulinebuf[i] = ' ';
                /*
                   Print first half of menu
                */
                sprintf(&menulinebuf[0],"%3d.  %s",
                        tempcount, tempmenustringptr[tempcount]);
                /*
                   Print second half of menu
                */
                if ((tempcount+menusidelength) < menucount)
                {
                    /* remove NULL terminator */
                    menulinebuf[strlen(menulinebuf)] = ' ';
                    sprintf(&menulinebuf[MENULINELENGTH/2 - 4],"%3d.  %s",
                        tempcount+menusidelength, 
                        tempmenustringptr[tempcount+menusidelength]);
                }
                printf("%s\n\r",menulinebuf);   /* send to the console */
            }
        }

        /*
            Get the Menu Answer
        */
        printf("\n\rEnter Selection (0 to %d): ", menucount-1);
        fflush(stdout);

        /*
            Get the answer and do minimal validation
        */
        if ((intanswer = getnumber()) == ESC_SEL)
            return(ESC_SEL);

        if ((intanswer > menucount-1) || (intanswer < 0))
        {
            invalid = TRUE;
            printf("\n\r*** Invalid Input ***\n\r");
            hitkeycontinue();
        }
    }
    while(invalid);

    /*
        Start a fresh line
    */
    printf("\n\r");
    fflush(stdout);
    return(intanswer);
}

/*
    askyesno            -   Ask Yes or No

    Prototype in:       menu.h

    Parameters Passed:  quesstring      - character string used for prompt

    Return Value:       returns TRUE if yes, FALSE if no, and if the
                        ESC key is selected then it returns ESC_SEL

    Remarks:            prompts user with a quesstring and then waits for
                        a Y/y, N/n or ESC.
*/
int askyesno(quesstring)
char * quesstring;
{
    short ch;

    printf("%s (Y/N)?",quesstring);

    while ((ch = getkey()) != ESC)
    {
        if ((ch == 'Y') || (ch == 'y'))
        {
            putchar(ch);
            fflush(stdout);
            return(TRUE);
        }

        if ((ch == 'N') || (ch == 'n'))
        {
            putchar(ch);
            fflush(stdout);
            return(FALSE);
        }
    }
    fflush(stdout);
    return(ESC_SEL);
}


/*
    getnumber           -   Get Number

    Prototype in:       menu.h

    Parameters Passed:  void

    Return Value:       intansw     -   integer corresponding to the number
                                        input by the user or ESC_SEL if the
                                        user hit the ESC key

    Remarks:            the routine allows the user to input numbers 0-9,
                        and terminate with a CR.  If invalid keys are
                        depressed the BEL sound is echoed.
*/
int getnumber()
{
    char answbuf[80];
    char * answbufptr = answbuf;
    char chr;
    short intanswer;

    /*
        Get a decimal number from the console
    */
    while (TRUE)
    {
        fflush(stdout);
        chr = getkey();

        /*
            Escape
        */
        if (chr == ESC)
            return(ESC_SEL);                    /* return with escape selected */

        /*
            Numbers
        */
        if ((chr >= 0x30) && (chr <= 0x39))
        {
            putchar(chr);                       /* echo character */
            *answbufptr++ = chr;                /* store character */
            continue;
        }

        /*
            Backspace
        */
        if (answbufptr > answbuf)               /* characters to runover? */
        {
            if (chr == BS)
            {
                putchar(BS);                    /* backspace */
                putchar(SP);                    /* put up a space */
                putchar(BS);                    /* backspace again */
                *--answbufptr = 0;              /* clear previous character */
                continue;
            }
        }
        else
        {
            putchar(BEL);
            continue;
        }

        /*
            Carrage Return
        */
        if (chr == CR)
        {
            *answbufptr = 0;                    /* terminate string */
            if (strlen(answbuf) == 0)           /* if they CR on nothing */
                return(ESC_SEL);
            putchar(chr);                       /* echo the carriage ret */
            putchar(LF);                        /* send a line feed */
            intanswer = (atoi(answbuf));        /* convert to integer */
            break;
        }

        /*
            Garbage
        */
        putchar(BEL);                           /* beep */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美性欧美巨大黑白大战| 男女性色大片免费观看一区二区| 狠狠色丁香久久婷婷综合_中| 欧美一卡二卡在线观看| 日本不卡123| 久久久99免费| 99国产精品久久久久久久久久久| 亚洲人成影院在线观看| 欧美三级三级三级爽爽爽| 日韩和欧美的一区| 久久亚区不卡日本| 成人国产精品视频| 亚洲午夜精品网| 日韩一区和二区| 成人免费毛片aaaaa**| 亚洲精品国产品国语在线app| 欧美日韩精品一区二区| 国内精品久久久久影院色| 亚洲国产高清不卡| 亚洲欧洲三级电影| 欧美性大战久久久久久久蜜臀| 青青草国产成人av片免费| 久久精品在这里| 欧美在线观看视频一区二区| 久久国产综合精品| 亚洲人亚洲人成电影网站色| 7777精品伊人久久久大香线蕉 | 中文字幕中文字幕一区| 欧洲精品视频在线观看| 国产精品资源在线看| 亚洲精品免费电影| 精品盗摄一区二区三区| 在线免费亚洲电影| 国产一区在线观看麻豆| 亚洲午夜在线电影| 国产视频不卡一区| 91精品国产综合久久香蕉麻豆| 国产成人精品免费视频网站| 亚洲成人免费影院| 国产精品乱码妇女bbbb| 欧美一区二区三区视频在线| jlzzjlzz欧美大全| 国内精品写真在线观看| 亚洲国产日韩一区二区| 亚洲国产精品成人综合色在线婷婷 | 亚洲三级免费观看| 精品国产一区二区精华| 欧美日韩成人综合天天影院| bt欧美亚洲午夜电影天堂| 久久 天天综合| 亚洲午夜久久久| 综合在线观看色| 国产日本欧洲亚洲| 精品黑人一区二区三区久久| 欧美精品三级在线观看| 色综合色综合色综合| 成人午夜视频免费看| 国产乱一区二区| 蜜臀av性久久久久蜜臀aⅴ四虎| 夜夜嗨av一区二区三区网页| 日韩理论电影院| 欧美国产激情二区三区| 久久嫩草精品久久久精品一| 欧美日本国产一区| 欧美性猛片aaaaaaa做受| 91精彩视频在线观看| 99久久er热在这里只有精品66| 国产999精品久久久久久绿帽| 国产自产高清不卡| 久久精品国产成人一区二区三区| 午夜久久久久久| 午夜欧美电影在线观看| 亚洲国产日日夜夜| 婷婷夜色潮精品综合在线| 亚洲国产综合人成综合网站| 亚洲一区免费在线观看| 一区二区三区欧美亚洲| 一区二区三区久久久| 一区二区三区蜜桃| 午夜在线成人av| 日韩成人一级大片| 免费欧美高清视频| 久草热8精品视频在线观看| 久久er99热精品一区二区| 国产一区二区精品久久99| 国产一区二区三区日韩| 成人小视频在线观看| 99久久精品免费看国产| 一本久久精品一区二区| 日本丶国产丶欧美色综合| 欧美视频完全免费看| 欧美精品丝袜中出| 欧美成人video| 国产亚洲一区字幕| 亚洲天堂福利av| 亚洲国产另类精品专区| 蜜臀久久99精品久久久画质超高清| 另类的小说在线视频另类成人小视频在线 | 国产成人精品亚洲午夜麻豆| 国产成人99久久亚洲综合精品| 不卡区在线中文字幕| 色婷婷av一区二区三区软件 | 日本在线播放一区二区三区| 狠狠色丁香久久婷婷综| 成人久久久精品乱码一区二区三区| 一本色道a无线码一区v| 欧美一级国产精品| 国产精品网站在线观看| 亚洲五月六月丁香激情| 国产一区二区三区在线看麻豆| 成人教育av在线| 欧美精品色一区二区三区| 国产欧美一区二区在线| 亚洲国产精品久久人人爱蜜臀| 久久成人精品无人区| av不卡一区二区三区| 日韩欧美中文字幕制服| 国产精品福利电影一区二区三区四区| 亚洲午夜免费电影| 丁香激情综合五月| 制服.丝袜.亚洲.另类.中文| 国产视频视频一区| 日本va欧美va欧美va精品| 成人avav在线| 日韩欧美美女一区二区三区| 亚洲免费观看在线观看| 紧缚奴在线一区二区三区| 色老汉av一区二区三区| 久久综合色之久久综合| 亚洲一区电影777| 成人性视频网站| 精品久久人人做人人爽| 香蕉久久一区二区不卡无毒影院 | 成人av资源在线观看| 欧美一区二区视频网站| 亚洲激情网站免费观看| 国产乱子伦视频一区二区三区| 欧美精品vⅰdeose4hd| ...xxx性欧美| 国产91精品一区二区麻豆亚洲| 7777精品久久久大香线蕉| 亚洲欧美国产77777| 国产成人在线看| 日韩三级在线观看| 午夜激情一区二区| 成人h动漫精品| 欧美国产成人精品| 免费成人在线观看| 欧美日韩国产经典色站一区二区三区| 国产精品网站在线观看| 国产电影一区在线| 久久亚洲捆绑美女| 久久国产精品免费| 欧美一卡二卡在线| 日韩影院精彩在线| 51精品久久久久久久蜜臀| 亚洲午夜在线电影| 欧美综合一区二区| 亚洲一卡二卡三卡四卡无卡久久| 99精品在线观看视频| 国产精品嫩草久久久久| 风间由美一区二区三区在线观看 | 中文在线资源观看网站视频免费不卡| 精品在线一区二区三区| 日韩欧美的一区| 激情六月婷婷久久| 精品久久国产字幕高潮| 美女尤物国产一区| 日韩精品一区二区在线| 久久国产免费看| 久久色在线观看| 岛国av在线一区| 亚洲欧美一区二区在线观看| 97国产一区二区| 亚洲乱码国产乱码精品精小说| 色丁香久综合在线久综合在线观看| 一区视频在线播放| 色婷婷av久久久久久久| 午夜精品成人在线| 欧美v日韩v国产v| 国产一区欧美二区| 一区二区中文视频| 欧美三级三级三级| 精品综合久久久久久8888| 国产亚洲污的网站| 色狠狠av一区二区三区| 日韩av一区二| 26uuu另类欧美亚洲曰本| 成人丝袜视频网| 亚洲第一搞黄网站| 日韩欧美卡一卡二| 成人自拍视频在线| 亚洲综合免费观看高清完整版在线 | 久久er99热精品一区二区| 国产欧美一区二区三区网站| 91浏览器入口在线观看| 日韩在线观看一区二区| 国产人成亚洲第一网站在线播放| 色综合网色综合| 蜜臀久久久久久久|