Changeset 1698 for trunk/dll/errutil.c


Ignore:
Timestamp:
Nov 7, 2013, 6:18:42 PM (12 years ago)
Author:
Steven Levine
Message:

Update comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/errutil.c

    r1686 r1698  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2004, 2010 Steven H. Levine
     9  Copyright (c) 2004, 2013 Steven H. Levine
    1010
    1111  12 Aug 04 SHL Comments
     
    3737  01 Dec 10 SHL Dos_Error - remap API errors code that with odd oso001*.msg messages
    3838  10 Mar 13 GKY Improvrd readonly check on delete to allow cancel and don't ask again options
    39                 Added saymsg2 for this purpose
     39                Added saymsg2 for this purpose
     40  07 Nov 13 SHL Update comments
    4041
    4142***********************************************************************/
     
    5758#include "notebook.h"                   // fErrorBeepOff
    5859#include "init.h"                       // Data declares
    59 #include "wrappers.h"                   // xmallocz
     60#include "wrappers.h"                   // xmallocz
    6061
    6162#pragma data_seg(DATA1)
     
    6970static APIRET showMsg(ULONG mb_type, HWND hwnd, PCSZ pszTitle, PCSZ pszMsg, BOOL wantLog);
    7071
    71 //=== DbgMsg: output debug message stderr ===
     72/**
     73 * Format debug message and output to stderr
     74 * @note: Local errors also written to stderr
     75 */
    7276
    7377VOID DbgMsg(PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...)
     
    118122} // DbgMsg
    119123
    120 //== Dos_Error: report Dos...() error using passed message string ===
     124/**
     125 * Format Dos...() error and output using showMsg
     126 * @note: Local errors written directly to stderr
     127 */
    121128
    122129// 2010-12-01 SHL fixme for ULONG to be APIRET
     
    298305}
    299306
    300 //== Runtime_Error: report runtime library error using passed message string ===
    301 //If pszFmt is NULL a No Data error message is returned GKY 20 Feb 09 (Replaces Runtime_Error2)
     307/**
     308 * Format runtime error message and output using showMsg
     309 * @note: Local errors written directly to stderr
     310 * @note: If pszFmt is NULL a No Data error message is returned GKY 20 Feb 09 (Replaces Runtime_Error2)
     311 */
    302312
    303313VOID Runtime_Error(PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...)
     
    331341} // Runtime_Error
    332342
    333 //=== saymsg: report misc error using passed message ===
     343/**
     344 * Format message and output using showMsg
     345 * @note: Local errors written directly to stderr
     346 */
    334347
    335348APIRET saymsg(ULONG mb_type, HWND hwnd, PCSZ pszTitle, PCSZ pszFmt, ...)
     
    352365} // saymsg
    353366
     367/**
     368 * Format message with custom buttons and output using showMsg
     369 * Local errors written to stderr
     370 */
     371
    354372APIRET saymsg2(PCSZ pszButtonNames, int DefaultButton, HWND hwnd, PCSZ pszTitle, PCSZ pszFmt, ...)
    355373{
    356   ULONG   i;
    357   APIRET  rc;
    358   CHAR szMsg[4096];
    359   va_list va;
    360   MB2INFO *pmbInfo;     
    361   MB2D mb2dBut[4];   
    362   ULONG   ulInfoSize = (sizeof(MB2INFO) + (sizeof(MB2D) * 3));
     374  ULONG i;
     375  APIRET rc;
     376  CHAR szMsg[4096];
     377  va_list va;
     378  MB2INFO *pmbInfo;
     379  MB2D mb2dBut[4];
     380  ULONG ulInfoSize = (sizeof(MB2INFO) + (sizeof(MB2D) * 3));
    363381
    364382  va_start(va, pszFmt);
     
    386404  pmbInfo = xmallocz(ulInfoSize, pszSrcFile, __LINE__);
    387405  if (pmbInfo) {
    388     pmbInfo->cb         = ulInfoSize;       
     406    pmbInfo->cb         = ulInfoSize;
    389407    pmbInfo->hIcon      = 0;
    390408    pmbInfo->cButtons   = 4;
     
    393411    for (i = 0; i < 4; i++) {
    394412      memcpy( pmbInfo->mb2d+i , mb2dBut+i , sizeof(MB2D));
    395     } 
     413    }
    396414    rc = WinMessageBox2(HWND_DESKTOP, hwnd,
    397                         szMsg, pszTitle, 1234,
    398                         pmbInfo);
     415                        szMsg, pszTitle, 1234,
     416                        pmbInfo);
    399417    free(pmbInfo);
    400418    return rc;
     
    403421}
    404422
    405 //=== showMsg: display error popup ===
     423/**
     424 * Display message in popup message box
     425 * Optionally writes formatted message to stderr
     426 */
    406427
    407428static APIRET showMsg(ULONG mb_type, HWND hwndOwner,
     
    426447} // showMsg
    427448
    428 //== Win_Error: report Win...() error using passed message string ===
     449/**
     450 * Format Win...() error and output using showMsg
     451 */
    429452
    430453VOID Win_Error(HWND hwndErr, HWND hwndOwner,
     
    446469
    447470/**
    448   * Output PM error messsage to stderr
    449   * This does to same reporting as Win_Error, but bypasses the
     471  * Format PM error messsage and output to stderr
     472  * This does the same reporting as Win_Error, but bypasses the
    450473  * message box popup.
    451474  * Use this version when the popup would hang PM.
Note: See TracChangeset for help on using the changeset viewer.