summaryrefslogtreecommitdiffstats
path: root/private/nw/nwscript/helpers.c
blob: 9f504490f57750d52ae1a3e5d17f4575c2cbe266 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/******************************************************************************
*
*  HELPERS.C
*
*  Various helper functions.
*
*  Copyright (c) 1995 Microsoft Corporation
*
*   $Log:   N:\NT\PRIVATE\NW4\NWSCRIPT\VCS\HELPERS.C  $
*  
*     Rev 1.1   22 Dec 1995 14:24:48   terryt
*  Add Microsoft headers
*  
*     Rev 1.0   15 Nov 1995 18:07:02   terryt
*  Initial revision.
*  
*     Rev 1.1   25 Aug 1995 16:22:56   terryt
*  Capture support
*  
*     Rev 1.0   15 May 1995 19:10:38   terryt
*  Initial revision.
*  
*  
*******************************************************************************/

#include <nt.h>
#include <ntrtl.h>
#include <nturtl.h>

#include <windows.h>

#include <stdio.h>
#include <stdlib.h>
#include <locale.h>

#include "nwscript.h"


/*******************************************************************************
 *
 *  DisplayMessage
 *      Display a message with variable arguments.  Message
 *      format string comes from the application resources.
 *
 *  ENTRY:
 *      nID (input)
 *          Resource ID of the format string to use in the message.
 *      ... (input)
 *          Optional additional arguments to be used with format string.
 *
 *  EXIT:
 *
 ******************************************************************************/

VOID
DisplayMessage( unsigned int nID, ... )
{
    WCHAR sz1[512];

    va_list args;
    va_start( args, nID );

    if ( LoadString( NULL, nID, sz1, 512 ) ) {

        setlocale(LC_ALL,".ACP") ;
        vwprintf( sz1, args );
        setlocale(LC_ALL,".OCP") ;

    }

    va_end(args);

}  /* DisplayMessage() */


/*******************************************************************************
 *
 *  DisplayOemString
 *      Display an OEM string
 *
 *  ENTRY:
 *      string: string to display
 *
 *  EXIT:
 *
 ******************************************************************************/

VOID
DisplayOemString( char *string )
{
    // this will print % in strings correctly.
    printf( "%s", string );

} /* DisplayAnsiString() */