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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? menu.c

?? 一個C語言寫的讀入位置跟蹤器數據的源程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/****************************************************************************
*****************************************************************************
    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 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩在线| 成人不卡免费av| 国产精品久久久久三级| www久久久久| 精品久久久三级丝袜| 欧美精品久久一区二区三区| 欧美性生活久久| 91免费在线播放| 色爱区综合激月婷婷| 色综合激情久久| 欧美亚洲动漫另类| 欧美日韩成人高清| 91精品国产综合久久精品app | 国产a久久麻豆| 国产成人亚洲精品青草天美| 国产在线看一区| 春色校园综合激情亚洲| hitomi一区二区三区精品| 国产成人综合在线| 波多野结衣在线一区| 91老师国产黑色丝袜在线| 欧美亚男人的天堂| 日韩视频在线一区二区| 26uuu精品一区二区| 久久精品人人做人人综合| 国产精品激情偷乱一区二区∴| 一区二区三区成人在线视频| 无吗不卡中文字幕| 精品制服美女久久| av一本久道久久综合久久鬼色| 在线观看亚洲a| 日韩一区二区三区四区| 中文字幕二三区不卡| 一区二区三区成人在线视频| 免费成人深夜小野草| 成人性生交大片免费看中文网站| 一本久道中文字幕精品亚洲嫩| 欧美美女黄视频| 久久精品夜色噜噜亚洲a∨| 亚洲精品精品亚洲| 久久精品理论片| 色综合夜色一区| www国产精品av| 亚洲欧洲精品一区二区精品久久久| 亚洲影院理伦片| 国产在线看一区| 欧美高清视频一二三区| 中文字幕一区在线| 九九视频精品免费| 欧美丰满嫩嫩电影| 亚洲欧美激情视频在线观看一区二区三区| 欧美日韩国产首页| 中文字幕中文在线不卡住| 免费av网站大全久久| heyzo一本久久综合| 久久午夜老司机| 免费在线观看一区| 欧美体内she精高潮| 国产精品成人网| 国产福利一区在线观看| 欧美va在线播放| 日韩国产欧美在线播放| 在线中文字幕一区二区| 国产精品乱人伦| 国产高清亚洲一区| 久久人人97超碰com| 喷水一区二区三区| 777午夜精品视频在线播放| 亚洲视频中文字幕| 成人精品在线视频观看| 国产亚洲1区2区3区| 国内精品伊人久久久久av一坑| 欧美丰满少妇xxxbbb| 午夜久久久久久久久久一区二区| 成人免费av网站| 国产精品久久网站| 99久久国产免费看| 中文字幕色av一区二区三区| 国产成人av网站| 国产亚洲婷婷免费| 国产精品综合一区二区| 久久精品一区蜜桃臀影院| 国产成人亚洲综合a∨猫咪| 国产女人18毛片水真多成人如厕| 久久99九九99精品| 国产亚洲精品精华液| 国产成a人亚洲| 国产精品久久久久永久免费观看 | 亚洲一区二区三区在线播放| 国产精品亚洲第一| 蜜臀99久久精品久久久久久软件| 91精品国产色综合久久不卡电影 | 91网站黄www| 亚洲精品久久7777| 日韩一区二区影院| 国产精品1024久久| 亚洲素人一区二区| 在线电影国产精品| 黄色精品一二区| 国产精品久久久久久久岛一牛影视| 白白色亚洲国产精品| 亚洲欧美日韩在线播放| 日韩一区二区电影在线| 国产综合久久久久久久久久久久| 国产欧美日本一区二区三区| av午夜一区麻豆| 视频一区二区三区在线| 国产亚洲制服色| 日本精品一级二级| 精品一区二区成人精品| 中文字幕一区在线观看| 88在线观看91蜜桃国自产| 国产麻豆视频一区二区| 亚洲免费在线播放| 欧美zozo另类异族| 欧美艳星brazzers| 国产在线播放一区三区四| 亚洲免费高清视频在线| 欧美tk—视频vk| 色综合久久综合| 国产一区二区三区四区在线观看| 亚洲激情自拍视频| 久久综合国产精品| 欧美日韩精品电影| 国产成都精品91一区二区三| 丝袜亚洲精品中文字幕一区| 中文字幕的久久| 欧美成人一级视频| 在线观看91av| 在线欧美小视频| 成人精品视频.| 激情久久五月天| 午夜精品视频在线观看| 国产三级一区二区三区| 欧美一区二区精品久久911| 色婷婷久久99综合精品jk白丝| 国产精品99久久久久久久vr| 亚洲午夜羞羞片| 中文成人综合网| 国产网站一区二区三区| 日韩欧美国产一区二区三区| 91高清视频在线| 播五月开心婷婷综合| 精品一区二区影视| 日韩av一区二区在线影视| 一区二区三区精品| 亚洲图片另类小说| 亚洲色图欧洲色图| 综合久久久久综合| 日韩一区在线免费观看| 亚洲国产高清aⅴ视频| 国产亚洲欧美日韩在线一区| www国产成人免费观看视频 深夜成人网| 91精品国产品国语在线不卡| 欧美老年两性高潮| 欧美疯狂性受xxxxx喷水图片| 91福利在线观看| 欧美日韩一区国产| 欧美日韩电影在线播放| 欧美偷拍一区二区| 欧美日韩免费电影| 欧美群妇大交群的观看方式| 欧美色图免费看| 欧美一区二区三区在线视频| 91精品国产入口在线| 精品国内二区三区| 国产精品色哟哟网站| 亚洲欧洲国产日韩| 一区二区三区电影在线播| 亚洲777理论| 麻豆freexxxx性91精品| 国产一区二区三区电影在线观看| 国产盗摄女厕一区二区三区| 国产成人夜色高潮福利影视| 成人av电影在线观看| 91精品福利视频| 欧美日韩国产成人在线91| 6080亚洲精品一区二区| 久久久久久久免费视频了| 亚洲国产精品成人综合色在线婷婷 | 亚洲嫩草精品久久| 天堂va蜜桃一区二区三区漫画版 | 国产日产欧美一区| 亚洲啪啪综合av一区二区三区| 亚洲午夜在线电影| 国产真实乱偷精品视频免| 97久久久精品综合88久久| 911精品产国品一二三产区| 26uuu精品一区二区| 亚洲亚洲精品在线观看| 精品一区二区三区在线观看国产| 岛国精品在线观看| 91精品国产色综合久久不卡蜜臀| 国产免费久久精品| 午夜视频在线观看一区二区| 国产精品自拍毛片| 成人国产一区二区三区精品| 国产成人免费视频一区| 久久久久久久国产精品影院| 日韩国产一区二|