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

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

?? calc.c

?? 計算器源代碼c。和windows自帶的功能差不多。很多科學計算還沒有加入。
?? C
?? 第 1 頁 / 共 2 頁
字號:
/**************************************************************************\
 *** SCICALC Scientific Calculator for Windows 3.00.12
 *** By Kraig Brockschmidt, Microsoft Co-op, Contractor, 1988-1989
 *** (c)1989 Microsoft Corporation.  All Rights Reserved.
 ***
 *** scimain.c
 ***
 *** Definitions of all globals, WinMain procedure
 ***
 *** Last modification
 ***    Fri  22-Nov-1996
 ***
 *** -by- Jonathan Parati. [jonpa]   22-Nov-1996
 *** Converted Calc from floating point to infinite precision.
 *** The new math engine is in ..\ratpak
 ***
 ***
 *** -by- Amit Chatterjee. [amitc]  05-Jan-1990.
 *** Calc did not have a floating point exception signal handler. This
 *** would cause CALC to be forced to exit on a FP exception as that's
 *** the default.
 *** The signal handler is defined in SCIFUNC.C, in WinMain we hook the
 *** the signal.
\**************************************************************************/

#include "scicalc.h"
#include "calchelp.h"
#include "signal.h"
#include "unifunc.h"
#include "input.h"


/**************************************************************************/
/*** Global variable declarations and initializations                   ***/
/**************************************************************************/

int        nCalc=0;        /* 0=Scientific, 1=Simple.                      */
BOOL       gbUseSep=FALSE; /* display the number with a separator          */
ANGLE_TYPE nDecMode=ANGLE_DEG;   /* Holder for last used Deg/Rad/Grad mode.      */
int        nHexMode=0;     /* Holder for last used Dword/Word/Byte mode.   */

int        nTempCom=0,     /* Holding place for the last command.          */
           nParNum=0,      /* Number of parenthases.                       */
           nOpCode=0,      /* ID value of operation.                       */
           nOp[25],        /* Holding array for parenthasis operations.    */
           nPrecOp[25],    /* Holding array for precedence  operations.    */
           nPrecNum=0,     /* Current number of precedence ops in holding. */
           gcIntDigits;    /* Number of digits allowed in the current base */

eNUMOBJ_FMT nFE = FMT_FLOAT; /* Scientific notation conversion flag.       */

HWND       g_hwndDlg=0,     /* Global handle to main window.               */
           hEdit=0,         /* Handle to Clibboard I/O edit control        */
           hStatBox=0,      /* Global handle to statistics box.            */
           hListBox=0;      /* Global handle for statistics list box.      */
            

HMENU      g_hHexMenu=NULL;     // Global handle for hex menu 
HMENU      g_hDecMenu=NULL;     // Global handle for dec menu 

HANDLE     hAccel;              // Accelerator handle.
HINSTANCE  hInst;               // Global instance.

BOOL       bHyp=FALSE,          // Hyperbolic on/off flag.
           bInv=FALSE,          // Inverse on/off flag.
           bError=FALSE,        // Error flag.
           bColor=TRUE;         // Flag indicating if color is available.

HNUMOBJ    ghnoNum=NULL,        // Currently displayed number used everywhere.
           ghnoParNum[25],      // Holding array for parenthasis values.
           ghnoPrecNum[25],     // Holding array for precedence  values.
           ghnoMem=NULL,        // Current memory value.
           ghnoLastNum = NULL;  // Number before operation (left operand).

LONG       nPrecision = 32,         // number of digits to use in decimal mode
           nDecimalPlaces = 10,     // number of decimal places to show
           nRadix=10,               // the current base (2, 8, 10, or 16)
           dwWordBitWidth = 64;     // # of bits in currently selected word size

HNUMOBJ g_ahnoChopNumbers[4];   // word size inforcement

BOOL    bFarEast;       // true if we need to use Far East localization

#ifdef USE_MIRRORING
BOOL    g_fLayoutRTL = FALSE;
#endif

extern CALCINPUTOBJ gcio;
extern BOOL         gbRecord;

/* DO NOT LOCALIZE THESE STRINGS.                                           */

TCHAR      szAppName[10]=TEXT("SciCalc"), /* Application name.              */
           szDec[5]=TEXT("."),            /* Default decimal character      */
           gszSep[5]=TEXT(","),           /* Default thousand seperator     */
           szBlank[6]=TEXT("");           /* Blank space.                   */

LPTSTR     gpszNum = NULL;
static TCHAR szInitNum[] = TEXT("0");      // text to init gpszNum with

/* END WARNING */


/* rgpsz[] is an array of pointers to strings in a locally allocated      */
/* memory block.  This block is fixed such that LocalLock does not need   */
/* to be called to use a string.                                          */

TCHAR     *rgpsz[CSTRINGS];
RECT      rcDeg[6];


void ParseCmdLine( LPSTR pszCmdA );
BOOL InitializeWindowClass( HINSTANCE hPrevInstance );
void InitialOneTimeOnlySetup();
void EverythingResettingNumberSetup();

/**************************************************************************/
/*** Main Window Procedure.                                             ***/
/***                                                                    ***/
/*** Important functions:                                               ***/
/***     1)  Gets text dimensions and sets conversion units correctly.  ***/
/***                                                                    ***/
/***     2)  Checks the display device driver for color capability.     ***/
/***         If only 2 colors are available (mono, cga), bColor is      ***/
/***         set to FALSE, and the background brush is gray.  If        ***/
/***         color is available, the background brush colors are read   ***/
/***         from WIN.INI and the brush is created.                     ***/
/***                                                                    ***/
/***     3)  Window and hidden edit control are created.                ***/
/***                                                                    ***/
/***     4)  Contains message loop and deletes the brushes used.        ***/
/***                                                                    ***/
/**************************************************************************/

int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
        LPSTR lpCmdLine,
        int nCmdShow)
{
    MSG        msg;
    INT        nx;
    TCHAR      *psz;
    WORD       cch = 0, cchTotal = 0;
    HANDLE     hMem;
    TCHAR      szTempString[100];
#ifdef USE_MIRRORING
    DWORD      dwLayout;
#endif

    // A bunch of sanity checks to ensure nobody is violating any of the
    // bazillion
    // assumptions calc makes about the order of controls.  Of course these 
    // asserts
    // wouldn't prevent a really dedicated idiot from messing things up but they
    // should help guide a rational person who might not be aware of calc's 
    // idiosyncrasies.
    // Anyone who modifies the resource file should hit these asserts which
    // will then
    // alert them to the consequences of their actions.

    // IDC_0 to IDC_F must be in sequential increasing order
    ASSERT( 15 == (IDC_F - IDC_0) );
    // Binary operators IDC_AND through IDC_PWR must be in order
    ASSERT( (95-86) == (IDC_PWR - IDC_AND) );
    // Unary operators IDC_CHOP through IDC_EQU must be in order
    ASSERT( (112-96) == (IDC_EQU - IDC_CHOP) );
    // menu item id's must be in order
    ASSERT( 5 == (IDM_LASTMENU - IDM_FIRSTMENU) );

#ifdef USE_MIRRORING
    GetProcessDefaultLayout(&dwLayout);
    if (dwLayout & LAYOUT_RTL)
    {
        SetProcessDefaultLayout(dwLayout & ~LAYOUT_RTL);
        g_fLayoutRTL = TRUE;
    }
#endif

    ParseCmdLine( lpCmdLine );

    hInst = hInstance;

    if ( !InitializeWindowClass( hPrevInstance ) )
        return FALSE;

    // Read strings for keys, errors, trig types, etc.
    // These will be copied from the resources to local memory.  A larger
    // than needed block is allocated first and then reallocated once we
    // know how much is actually used.

    try
    {
        hMem = LocalAlloc(LPTR, ByteCountOf(CCHSTRINGSMAX));
        if (!hMem)
            throw;

        psz = (TCHAR *)hMem;

        for (nx = 0; nx <= CSTRINGS; nx++)
        {
            ASSERT( (CCHSTRINGSMAX-cchTotal) > LoadString(hInstance, (WORD) IDS_FIRSTKEY + nx, NULL, 0) );
            cch = (WORD)(1 + LoadString(hInstance, (WORD) IDS_FIRSTKEY + nx, psz, (int) (CCHSTRINGSMAX-cchTotal)));
            cchTotal += cch;
            rgpsz[nx] = psz;
            psz += cch;
        }

        if (!LocalReAlloc(hMem, ByteCountOf(cchTotal), LMEM_FIXED))
            throw;
    }
    catch ( ... )
    {
        if (!LoadString(hInst, IDS_NOMEM, szTempString, CharSizeOf(szTempString)))
        {
            // only do this if LoadString Fails, means system is really hosed!
            lstrcpy(szTempString, TEXT("<Main> Not enough memory."));
        }
        MessageBox((HWND) NULL, szTempString, NULL, MB_OK | MB_ICONHAND);
        return FALSE;
    }

    // The display in calc isn't really an edit control so we use this edit 
    // control to simplify cutting to the clipboard

    hEdit = CreateWindow( TEXT("EDIT"), TEXT("CalcMsgPumpWnd"), 
                          WS_OVERLAPPED | WS_VISIBLE, 
                          CW_USEDEFAULT,0,CW_USEDEFAULT,0, 
                          NULL, NULL, hInst, NULL );

    // This initializes things that only need to be set up once, including a 
    // call to ratpak so that ratpak can create any constants it needs

    InitialOneTimeOnlySetup();

    // we store in the win.ini file our desired display mode, Scientific 
    //  or Standard

    nCalc = (INT)GetProfileInt(szAppName, TEXT("layout"), 1);

    gbUseSep = (INT)GetProfileInt(szAppName, TEXT("UseSep"), 0);

    // InitSciCalc creates a dialog based on what the value of nCalc is. 
    // A handle to the window that is created is stored in g_hwndDlg

    InitSciCalc(TRUE);

    hAccel = LoadAccelerators(hInst, MAKEINTRESOURCE(IDA_ACCELTABLE));


    while (GetMessage(&msg, NULL, 0, 0))
    {
        if (!hStatBox || !IsDialogMessage(hStatBox, &msg))
        {
            if ( ((msg.hwnd == g_hwndDlg)||IsChild(g_hwndDlg, msg.hwnd)) && TranslateAccelerator (g_hwndDlg, (HACCEL)hAccel, &msg))
                continue;

            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
    }

    LocalFree(hMem);
    return (DWORD)msg.wParam;
}


/**************************************************************************\
*
*   Command Line processing routines
*
*   History
*       22-Nov-1996 JonPa       Wrote it
*
\**************************************************************************/

#define IsWhiteSpace( ch )  ((ch) == TEXT(' ') || (ch) == TEXT('\t'))
#define IsDigit( ch )       ((ch) >= TEXT('0') && (ch) <= TEXT('9'))

LPTSTR TtoL( LPTSTR psz, LONG *pl ) {
    LONG l = 0;

    while( IsDigit( *psz ) ) {
        l = l * 10 + (*psz - TEXT('0'));
        psz = CharNext( psz );
    }

    *pl = l;
    return psz;
}

void ParseCmdLine( LPSTR pszCmdA ) {
    BOOL fInQuote;
    LPTSTR pszCmdT = GetCommandLine();

    // parse cmd line
    // usage: -p:## -r:## -w:## -e -x -i
    // -e, -x, and -i currently do nothing.

    // Skip app name
    while( *pszCmdT && IsWhiteSpace( *pszCmdT )) {
        pszCmdT = CharNext( pszCmdT );
    }

    fInQuote = FALSE;
    while( *pszCmdT && (fInQuote || !IsWhiteSpace(*pszCmdT)) ) {
        if (*pszCmdT == TEXT('\"'))
            fInQuote = !fInQuote;
        pszCmdT = CharNext( pszCmdT );
    }

    while( *pszCmdT )
    {
        switch( *pszCmdT )
        {
        case TEXT('p'):
        case TEXT('P'):
            // -p:## precision
            pszCmdT = CharNext(pszCmdT);

            // Skip ':' and white space
            while( *pszCmdT && (*pszCmdT == TEXT(':') || IsWhiteSpace(*pszCmdT)) ) {
                pszCmdT = CharNext(pszCmdT);
            }

            pszCmdT = TtoL( pszCmdT, &nPrecision );

            // a percision > C_NUM_MAX_DIGITS will allow a string too long for it's buffer
            if ( nPrecision > C_NUM_MAX_DIGITS)
            {
                ASSERT( nPrecision <= C_NUM_MAX_DIGITS );
                nPrecision = C_NUM_MAX_DIGITS;
            }

            // NOTE: this code assumes there MUST be a space after the number
            break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品久久久久影视| 欧美日韩免费高清一区色橹橹 | 精品一区二区三区在线观看| 成人永久aaa| 国产精品丝袜久久久久久app| 一区二区三区精品在线观看| 国产一区二区三区蝌蚪| 欧美揉bbbbb揉bbbbb| 中文文精品字幕一区二区| 日本sm残虐另类| 欧美中文字幕一区二区三区| 国产女人水真多18毛片18精品视频| 日韩av一区二区在线影视| 91亚洲精品久久久蜜桃| 欧美—级在线免费片| 久久66热偷产精品| 在线电影一区二区三区| 亚洲激情图片qvod| 91蜜桃在线免费视频| 欧美国产一区二区| 精品一区二区三区在线播放| 欧美一级午夜免费电影| 日韩精品亚洲专区| 色噜噜夜夜夜综合网| 亚洲欧洲日韩女同| 成人99免费视频| 国产精品午夜久久| 波多野结衣精品在线| 国产免费观看久久| 成人福利视频网站| 中文无字幕一区二区三区| 国产传媒欧美日韩成人| 国产午夜久久久久| 成人黄页在线观看| 中文字幕精品在线不卡| 粉嫩一区二区三区性色av| 久久伊99综合婷婷久久伊| 国产主播一区二区三区| 日韩视频中午一区| 麻豆91精品视频| 欧美大片在线观看一区二区| 蜜臀av一级做a爰片久久| 欧美电视剧在线看免费| 国产精品中文字幕欧美| 国产精品麻豆久久久| 99久久99久久综合| 亚洲国产综合色| 欧美肥胖老妇做爰| 国产精品69毛片高清亚洲| 国产视频一区在线播放| 色综合av在线| 日韩在线一区二区三区| 日韩手机在线导航| 丁香亚洲综合激情啪啪综合| 伊人色综合久久天天人手人婷| 欧美亚洲国产bt| 六月丁香综合在线视频| 国产欧美视频在线观看| 色天使久久综合网天天| 日本美女一区二区三区视频| 国产日产亚洲精品系列| 色94色欧美sute亚洲13| 一区二区三区蜜桃网| 91精品福利在线一区二区三区 | 成人污污视频在线观看| 亚洲香肠在线观看| 久久女同互慰一区二区三区| 色婷婷综合久色| 另类小说一区二区三区| 亚洲嫩草精品久久| 日韩你懂的电影在线观看| eeuss鲁片一区二区三区在线观看| 天天影视网天天综合色在线播放| 国产亚洲欧美激情| 91精品国产综合久久精品app | 中文字幕精品一区| 欧美精品第一页| 成人app在线| 婷婷综合五月天| 亚洲你懂的在线视频| 久久精品亚洲国产奇米99| 欧美美女喷水视频| www.亚洲免费av| 国产在线精品免费| 日韩电影免费在线观看网站| 亚洲免费资源在线播放| 久久欧美中文字幕| 日韩亚洲欧美一区二区三区| 色婷婷久久久亚洲一区二区三区 | 色欧美88888久久久久久影院| 国产呦精品一区二区三区网站| 亚洲一二三专区| 欧美国产激情二区三区| 精品三级在线观看| 在线91免费看| 欧美午夜不卡在线观看免费| 成人国产在线观看| 国产xxx精品视频大全| 精品一区二区三区视频在线观看| 香蕉久久一区二区不卡无毒影院| 最新欧美精品一区二区三区| 久久久99精品免费观看| 欧美成人伊人久久综合网| 欧美日韩的一区二区| 欧美性生交片4| 欧美在线一二三四区| 91在线观看地址| av亚洲产国偷v产偷v自拍| 成人一区二区三区视频在线观看 | 91成人免费在线| 97精品视频在线观看自产线路二| 成人午夜大片免费观看| 成人黄色777网| www.欧美日韩国产在线| 成人午夜大片免费观看| 99国产精品一区| 色呦呦一区二区三区| 91麻豆精品一区二区三区| 91免费看视频| 欧美在线影院一区二区| 欧美麻豆精品久久久久久| 欧美高清你懂得| 日韩一区二区免费在线观看| 日韩午夜电影在线观看| 久久综合狠狠综合| 久久久99免费| 亚洲欧洲av在线| 亚洲专区一二三| 天天影视色香欲综合网老头| 麻豆91精品视频| 国产成人无遮挡在线视频| av电影一区二区| 欧美日韩午夜在线视频| 日韩亚洲欧美一区| 国产精品久久久久久久久免费樱桃 | 国产精品国产自产拍高清av王其| 亚洲精品中文字幕乱码三区| 亚洲成年人网站在线观看| 美女脱光内衣内裤视频久久影院| 国产一区二区三区精品欧美日韩一区二区三区 | 亚洲精品国产成人久久av盗摄| 亚洲最大成人综合| 日韩成人精品在线| 国产成a人亚洲| 欧美日韩在线免费视频| 精品国产sm最大网站免费看| 国产精品成人午夜| 麻豆国产精品视频| 99re这里只有精品视频首页| 欧美在线免费观看亚洲| 久久久噜噜噜久久人人看 | 青青国产91久久久久久| 国产98色在线|日韩| 欧美视频三区在线播放| 久久品道一品道久久精品| 亚洲综合激情小说| 国产精品99精品久久免费| 日本道在线观看一区二区| 久久久亚洲午夜电影| 亚洲国产成人va在线观看天堂| 久久精品国产澳门| 91蝌蚪porny| 久久久久久久久99精品| 亚洲18女电影在线观看| www.亚洲在线| 久久女同性恋中文字幕| 天天影视网天天综合色在线播放| av激情亚洲男人天堂| 精品电影一区二区| 日韩激情一二三区| 色综合天天综合网国产成人综合天| 日韩一区二区免费电影| 一区二区三区四区亚洲| 岛国av在线一区| 精品国产精品网麻豆系列 | 欧美一区二区视频在线观看2020 | 国产精品久久久久久久久图文区| 麻豆精品在线观看| 欧美日韩色一区| 亚洲少妇中出一区| 不卡一区二区在线| 欧美国产97人人爽人人喊| 麻豆精品久久久| 91精品国产综合久久香蕉的特点 | 亚洲黄色片在线观看| 丁香婷婷综合网| 日本一区二区视频在线观看| 精品亚洲欧美一区| 日韩一区二区免费在线电影| 日韩中文字幕91| 欧美日韩情趣电影| 亚洲成人精品一区| 欧美色手机在线观看| 亚洲国产精品一区二区www| 色综合久久久久久久久| 亚洲欧美日韩久久精品| 91一区一区三区| 亚洲免费观看在线视频| 色噜噜狠狠色综合中国| 亚洲午夜激情网站|