Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.8 KiB

  1. /****************************Module*Header***********************************\
  2. * Module Name: INPUT.H
  3. *
  4. * Module Descripton:
  5. *
  6. * Warnings:
  7. *
  8. * Created:
  9. *
  10. * Author:
  11. \****************************************************************************/
  12. // the string must hold, at a minimun, enough digits for a quadword binary number (ie 64)
  13. #define MAX_STRLEN 64 // Seems to be the magic value for calc...
  14. #define C_NUM_MAX_DIGITS MAX_STRLEN
  15. #define C_EXP_MAX_DIGITS 4
  16. typedef struct
  17. {
  18. BOOL fEmpty; // TRUE if the number has no digits yet
  19. BOOL fNeg; // TRUE if number is negative
  20. INT cchVal; // number of characters in number (including dec. pnt)
  21. TCHAR szVal[MAX_STRLEN+1]; //
  22. } CALCNUMSEC, *PCALCNUMSEC;
  23. #if C_NUM_MAX_DIGITS > MAX_STRLEN || C_EXP_MAX_DIGITS > MAX_STRLEN
  24. # pragma error(CALCNUMSEC.szVal is too small)
  25. #endif
  26. typedef struct
  27. {
  28. BOOL fExp; // TRUE if number has exponent
  29. INT iDecPt; // index to decimal point of number portion. -1 if no dec pnt
  30. CALCNUMSEC cnsNum; // base number
  31. CALCNUMSEC cnsExp; // exponent if it exists
  32. } CALCINPUTOBJ, *PCALCINPUTOBJ;
  33. #define CIO_bDecimalPt(pcio) ((pcio)->iDecPt != -1)
  34. void CIO_vClear(PCALCINPUTOBJ pcio);
  35. BOOL CIO_bAddDigit(PCALCINPUTOBJ pcio, int iValue);
  36. void CIO_vToggleSign(PCALCINPUTOBJ pcio);
  37. BOOL CIO_bAddDecimalPt(PCALCINPUTOBJ pcio);
  38. BOOL CIO_bExponent(PCALCINPUTOBJ pcio);
  39. BOOL CIO_bBackspace(PCALCINPUTOBJ pcio);
  40. void CIO_vUpdateDecimalSymbol(PCALCINPUTOBJ pcio, TCHAR chLastDP);
  41. void CIO_vConvertToString(LPTSTR *ppszOut, int* pcchszOut, PCALCINPUTOBJ pcio, int nRadix);
  42. void CIO_vConvertToNumObj(PHNUMOBJ phnoNum, PCALCINPUTOBJ pcio);