home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / xp / xp_intl.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  1.9 KB  |  69 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19.  
  20. #include "prtypes.h"
  21. #define RESOURCE_STR
  22. #include <allxpstr.h>
  23.  
  24.  
  25. #ifndef MOZILLA_CLIENT
  26. /*
  27.  * This routine picks up a builtin (compiled in) numbered string.
  28.  * (I.e. error messages, etc.)
  29.  *
  30.  * If you are getting an unresolved symbol XP_GetString and you don't
  31.  * want to get strings from resources (which is how the Win, Mac and X
  32.  * versions of the Navigator do it), then you can define your own
  33.  * wrapper function like this:
  34.  */
  35. char *
  36. XP_GetString(int16 i)
  37. {
  38.     extern char * XP_GetBuiltinString(int16 i);
  39.  
  40.     return XP_GetBuiltinString(i);
  41. }
  42. #endif /* ! MOZILLA_CLIENT */
  43.  
  44. char *
  45. XP_GetBuiltinString(int16 i)
  46. {
  47.     static char    buf[128];
  48.     char        *ret;
  49.  
  50.     i += RES_OFFSET;
  51.  
  52.     if
  53.     (
  54.         ((ret = mcom_include_merrors_i_strings (i))) ||
  55.         ((ret = mcom_include_secerr_i_strings  (i))) ||
  56.         ((ret = mcom_include_sec_dialog_strings(i))) ||
  57.         ((ret = mcom_include_sslerr_i_strings  (i))) ||
  58.         ((ret = mcom_include_xp_error_i_strings(i))) ||
  59.         ((ret = mcom_include_xp_msg_i_strings  (i)))
  60.     )
  61.     {
  62.         return ret;
  63.     }
  64.  
  65.     (void) sprintf(buf, "XP_GetBuiltinString: %d not found", i);
  66.  
  67.     return buf;
  68. }
  69.