#pragma title l$clsamp -- SAMP sample locale 00000100
/*--------------------------------------------------------------------+
| |
| Copyright 1996 (c), SAS Institute Inc. |
| Unpublished - All Rights Reserved |
| |
| S A S / C S A M P L E |
| |
| Name: L$CLSAMP |
| |
| Language: C |
| |
| EntryPoint: @DYNAMN |
| |
| EntryType : C Linkage, reentrant |
| |
| Files Note: 'prefix' is the installation defined high level |
| qualifier for the SAS/C product. |
| |
| Purpose: Provide a sample SAS/C user-added locale module. |
| |
| MVS - |
| |
| Source: prefix.SAMPLE.C(L$CLSAMP) |
| |
| Comp/Link: Use proc LC370CL, with parameter RENT and ENTRY=DYN. |
| Output module should placed in a library that can be |
| located by loadm() when the setlocale() function is |
| executed at run time. |
| |
| Execute: via setlocale() function |
| |
| CMS - |
| |
| Source: SAMPLC MACLIB (L$CLSAMP) |
| |
| Note: The following compile/link are used for executing the |
| module as a nucelus extension. |
| |
| Compile: |
| global maclig lc370 |
| lc370 l$clsamp ( rent sname l$clsam |
| |
| Link: |
| clink l$clsamp |
| load clink370 ( rldsave |
| genmode l$clsamp |
| |
| Execute: via setlocale() function |
| |
| Notes: |
| |
| When setlocale() is issued the first four characters of the |
| locale name are appended to L$CL to form the module name to be |
| loaded by loadm(), for example 'SAMP' is appended create a |
| module name of L$CLSAMP. |
| |
| This is SAMP locale value module table to provide a skeleton | 0000770
| example to modify for a particular locale. For those locales | 0000780
| requiring double byte character support, see the DBCS locale | 0000790
| (L$DLDBEX) for setting up a double byte locale LC_CTYPE and |
| LC_COLLATE. |
| | 0000760
| Any addressess of functions or table not specified with a category| 0000760
| will use the "C" locale equivalent function or table. | 0000760
| | 0000760
| If a whole category is not specified and the locale is requested | 0000760
| for that category via setlocale,effectivly the "C" locale is used.| 0000760
| though the locale string returned will contain the locale's name | 0000760
| |
| |
| |
+--------------------------------------------------------------------*/
00004000
#include <stddef.h> 00004100
#include <locale.h> 00004200
#include <localeu.h> 00004300
#include <dynam.h> 00004400
#include <stdlib.h> 00004410
#include <signal.h> 00004411
#include <errno.h> 00004420
#include <stdio.h> 00004430
#include <string.h> 00004440
#include <time.h> 00004440
00004500
#eject 00005400
00005410
/*------------------------------------------------------------------- 00005500
* 00005510
* ENTRY: <=== _dynamn (externally visible) needs to be compiled 00005600
* with sname l$clsam 00005700
* 00005701
* 00005710
* USAGE: <=== Prototype call: _dynamn (dynamically loaded with 00005800
* the loadm function from the setlocale function 00005900
* 00005901
* When the a call is made to setlocale e.g.: 00005902
* ptr = setlocale(LC_ALL,"SAMP"); 00005903
* 00005904
* The following code is executed within setlocale 00005905
* code to load L$CLSAMP: 00005906
* 00005908
* . 00005909
* . 00005910
* . 00005911
* loadm(L$CLSAMP,&fp) 00005914
* fncptr = (char *** ) (*fp)(); 00005915
* . 00005916
* . 00005917
* . 00005918
* 00005919
* 00006000
* 00006200
* 00006300
* ARGUMENTS: <=== None 00006400
* 00006500
* 00006600
* RETURNS: <=== A pointer to an arrary of pointers 00006700
* 00006701
* static const void *lc_all_samp [5] = { 00006710
* &collate, collate pointer 00006720
* &ctype, ctype pointer 00006730
* &monetary monetary pointer 00006740
* &numeric numeric pointer 00006750
* &time time format pointer 00006760
* } 00006770
* 00006800
* 00006900
* 00007000
* END 00007100
*-----------------------------------------------------------------*/ 00007200
00007300
00007400
00008100
#eject
/**********************************************************************/
/* COLLATION category */
/**********************************************************************/
static const unsigned char sbcs_collate_table_samp [256] = {
/*-------------------------------------------------------------------*/
/* */
/* Note if a collation table is specified i.e. its address */
/* is non-zero and a locale strxfrm function is not coded and */
/* the locale is not a multibyte (double byte) locale, then */
/* the collation array must have 256 elements that translate */
/* any chars 8-bit representation to its proper place in the */
/* locale's collating sequence. */
/* */
/*-------------------------------------------------------------------*/
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 00-0f */
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-1f */
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /*0x20-0x2f*/
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /*0x30-0x3f*/
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /*0x40-0x4f*/
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /*0x50-0x5f*/
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /*0x60-0x6f*/
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /*0x70-0x7f*/
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /*0x80-0x8f*/
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /*0x90-0x9f*/
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /*0xa0-0xaf*/
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /*0xb0-0xbf*/
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /*0xc0-0xcf*/
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /*0xd0-0xdf*/
0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /*0xe0-0xef*/
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /*0xf0-0xff*/
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff};
#define SBCS 0
#define DBCS 1
static const struct _lc_collate lc_collate_samp = {
SBCS, /* single byte character mode */
&sbcs_collate_table_samp, /* collation table address */
0, /* strcoll collation function address */
0 /* strxfrm transform function address */
};
/* see L$CLDBCS for DBCS example of */
/* strcoll and strxfrm functions */
#eject
/**********************************************************************/
/* CTYPE category */
/**********************************************************************/
#define U 1 /* upper case */
#define L 2 /* lower case */
#define N 4 /* number */
#define W 8 /* white space */
#define P 16 /* punctuation */
#define S 32 /* blank */
#define AX 64 /* alpha extender */
#define X 128 /* hexadecimal */
static const unsigned char lc_ctab_samp [513] =
{
/*-------------------------------------------------------------------*/
/* */
/* The character type table array, if coded, must contain 513 single */
/* char elements. The first element is the EOF representation (-1 or */
/* 0xff) followed by 256 elements that contain the char types for */
/* any 8-bit character returned by functions isalpha, isnumeric, */
/* et al. The next 256 elements contain the mappings for the */
/* tolower/toupper string transformation functions */
/* */
/*-------------------------------------------------------------------*/
0, /* -1 = EOF */
0, /* 00 = nul */
0, /* 01 = soh */
0, /* 02 = stx */
0, /* 03 = etx */
0, /* 04 = sel */
W, /* 05 = ht */
0, /* 06 = rnl */
0, /* 07 = del */
0, /* 08 = ge */
0, /* 09 = sps */
0, /* 0a = rpt */
W, /* 0B = vt */
W, /* 0C = ff */
W, /* 0D = cr */
0, /* 0E = so */
0, /* 0F = si */
0, /* 10 = dle */
0, /* 11 = dcl */
0, /* 12 = dc2 */
0, /* 13 = dc3 */
0, /* 14 = res */
W, /* 15 = nl */
0, /* 16 = bs */
0, /* 17 = poc */
0, /* 18 = can */
0, /* 19 = em */
0, /* 1A = ubs */
0, /* 1B = cu1 */
0, /* 1C = ifs */
0, /* 1D = igs */
0, /* 1E = irs */
0, /* 1F = ius */
0, /* 20 = ds */
0, /* 21 = sos */
0, /* 22 = fs */
0, /* 23 = wus */
0, /* 24 = byp */
0, /* 25 = lf */
0, /* 26 = etb */
0, /* 27 = esc */
0, /* 28 = sa */
0, /* 29 = sfe */
0, /* 2A = sm */
0, /* 2B = csp */
0, /* 2C = mfa */
0, /* 2D = enq */
0, /* 2E = ack */
0, /* 2F = bel */
0, /* 30 */
0, /* 31 */
0, /* 32 = syn */
0, /* 33 = ir */
0, /* 34 = pp */
0, /* 35 = trn */
0, /* 36 = nbs */
0, /* 37 = eot */
0, /* 38 = sbs */
0, /* 39 = it */
0, /* 3A = rf */
0, /* 3B = cu3 */
0, /* 3C = dc4 */
0, /* 3D = nak */
0, /* 3E */
0, /* 3F = sub */
W|S, /* 40 = sp */
0, /* 41 = rsp */
0, /* 42 */
0, /* 43 */
0, /* 44 */
0, /* 45 */
0, /* 46 */
0, /* 47 */
0, /* 48 */
0, /* 49 */
0, /* 4A = › (cent sign) */
P, /* 4B = . */
P, /* 4C = < */
P, /* 4D = ( */
P, /* 4E = + */
P, /* 4F = | */
P, /* 50 = & */
0, /* 51 */
0, /* 52 */
0, /* 53 */
0, /* 54 */
0, /* 55 */
0, /* 56 */
0, /* 57 */
0, /* 58 */
0, /* 59 */
0, /* 5A = ! (exclamation point) */
P, /* 5B = $ */
P, /* 5C = * */
P, /* 5D = ) */
P, /* 5E = ; */
P, /* 5F = ^ (circumflex) */
P, /* 60 = - */
P, /* 61 = / */
0, /* 62 */
0, /* 63 */
0, /* 64 */
0, /* 65 */
0, /* 66 */
0, /* 67 */
0, /* 68 */
0, /* 69 */
0, /* 6A = º (broken bar) */
P, /* 6B = , */
P, /* 6C = % */
P|AX, /* 6D = _ */
P, /* 6E = > */
P, /* 6F = ? */
0, /* 70 */
0, /* 71 */
0, /* 72 */
0, /* 73 */
0, /* 74 */
0, /* 75 */
0, /* 76 */
0, /* 77 */
0, /* 78 */
0, /* 79 = ` (prime) */
P, /* 7A = : */
P, /* 7B = # */
P, /* 7C = @ */
P, /* 7D = ' */
P, /* 7E = = */
P, /* 7F = " */
0, /* 80 */
L|X, /* 81 = a */
L|X, /* 82 = b */
L|X, /* 83 = c */
L|X, /* 84 = d */
L|X, /* 85 = e */
L|X, /* 86 = f */
L, /* 87 = g */
L, /* 88 = h */
L, /* 89 = i */
0, /* 8A */
0, /* 8B */
0, /* 8C */
0, /* 8D */
0, /* 8E */
0, /* 8F */
0, /* 90 */
L, /* 91 = j */
L, /* 92 = k */
L, /* 93 = l */
L, /* 94 = m */
L, /* 95 = n */
L, /* 96 = o */
L, /* 97 = p */
L, /* 98 = q */
L, /* 99 = r */
0, /* 9A */
0, /* 9B */
0, /* 9C */
0, /* 9D */
0, /* 9E */
0, /* 9F */
0, /* A0 */
0, /* A1 = ~ (tilde) */
L, /* A2 = W */
L, /* A3 = t */
L, /* A4 = u */
L, /* A5 = v */
L, /* A6 = w */
L, /* A7 = x */
L, /* A8 = y */
L, /* A9 = z */
0, /* AA */
0, /* AB */
0, /* AC */
0, /* AD = [ (open bracket) */
0, /* AE */
0, /* AF */
0, /* B0 */
0, /* B1 */
0, /* B2 */
0, /* B3 */
0, /* B4 */
0, /* B5 */
0, /* B6 */
0, /* B7 */
0, /* B8 */
0, /* B9 */
0, /* BA */
0, /* BB */
0, /* BC */
0, /* BD = ] (close bracket) */
0, /* BE */
0, /* BF */
0, /* C0 = { (open brace) */
U|X, /* C1 = A */
U|X, /* C2 = B */
U|X, /* C3 = C */
U|X, /* C4 = D */
U|X, /* C5 = E */
U|X, /* C6 = F */
U, /* C7 = G */
U, /* C8 = H */
U, /* C9 = I */
0, /* CA = shy */
0, /* CB */
0, /* CC */
0, /* CD */
0, /* CE */
0, /* CF */
0, /* D0 = } (close brace) */
U, /* D1 = J */
U, /* D2 = K */
U, /* D3 = L */
U, /* D4 = M */
U, /* D5 = N */
U, /* D6 = O */
U, /* D7 = P */
U, /* D8 = Q */
U, /* D9 = R */
0, /* DA */
0, /* DB */
0, /* DC */
0, /* DD */
0, /* DE */
0, /* DF */
0, /* E0 = \\ (backslash) */
0, /* E1 = nsp */
U, /* E2 = W */
U, /* E3 = T */
U, /* E4 = U */
U, /* E5 = V */
U, /* E6 = W */
U, /* E7 = X */
U, /* E8 = Y */
U, /* E9 = Z */
0, /* EA */
0, /* EB */
0, /* EC */
0, /* ED */
0, /* EE */
0, /* EF */
N|X, /* F0 = 0 */
N|X, /* F1 = 1 */
N|X, /* F2 = 2 */
N|X, /* F3 = 3 */
N|X, /* F4 = 4 */
N|X, /* F5 = 5 */
N|X, /* F6 = 6 */
N|X, /* F7 = 7 */
N|X, /* F8 = 8 */
N|X, /* F9 = 9 */
0, /* FA */
0, /* FB */
0, /* FC */
0, /* FD */
0, /* FE */
0, /* FF = eo */
/* lower 257 bytes contain char types, next 256 contains the
tolower/toupper character mappings */
0x00, /* 00 = nul */
0x01, /* 01 = soh */
0x02, /* 02 = stx */
0x03, /* 03 = etx */
0x04, /* 04 = sel */
0x05, /* 05 = ht */
0x06, /* 06 = rnl */
0x07, /* 07 = del */
0x08, /* 08 = ge */
0x09, /* 09 = sps */
0x0a, /* 0a = rpt */
0x0b, /* 0B = vt */
0x0c, /* 0C = ff */
0x0d, /* 0D = cr */
0x0e, /* 0E = so */
0x0f, /* 0F = si */
0x10, /* 10 = dle */
0x11, /* 11 = dcl */
0x12, /* 12 = dc2 */
0x13, /* 13 = dc3 */
0x14, /* 14 = res */
0x15, /* 15 = nl */
0x16, /* 16 = bs */
0x17, /* 17 = poc */
0x18, /* 18 = can */
0x19, /* 19 = em */
0x1a, /* 1A = ubs */
0x1b, /* 1B = cu1 */
0x1c, /* 1C = ifs */
0x1d, /* 1D = igs */
0x1e, /* 1E = irs */
0x1f, /* 1F = ius */
0x20, /* 20 = ds */
0x21, /* 21 = sos */
0x22, /* 22 = fs */
0x23, /* 23 = wus */
0x24, /* 24 = byp */
0x25, /* 25 = lf */
0x26, /* 26 = etb */
0x27, /* 27 = esc */
0x28, /* 28 = sa */
0x29, /* 29 = sfe */
0x2a, /* 2A = sm */
0x2b, /* 2B = csp */
0x2c, /* 2C = mfa */
0x2d, /* 2D = enq */
0x2e, /* 2E = ack */
0x2f, /* 2F = bel */
0x30, /* 30 */
0x31, /* 31 */
0x32, /* 32 = syn */
0x33, /* 33 = ir */
0x34, /* 34 = pp */
0x35, /* 35 = trn */
0x36, /* 36 = nbs */
0x37, /* 37 = eot */
0x38, /* 38 = sbs */
0x39, /* 39 = it */
0x3a, /* 3A = rf */
0x3b, /* 3B = cu3 */
0x3c, /* 3C = dc4 */
0x3d, /* 3D = nak */
0x3e, /* 3E */
0x3f, /* 3F = sub */
0x40, /* 40 = sp */
0x41, /* 41 = rsp */
0x42, /* 42 */
0x43, /* 43 */
0x44, /* 44 */
0x45, /* 45 */
0x46, /* 46 */
0x47, /* 47 */
0x48, /* 48 */
0x49, /* 49 */
0x4a, /* 4A = › (cent sign) */
0x4b, /* 4B = . */
0x4c, /* 4C = < */
0x4d, /* 4D = ( */
0x4e, /* 4E = + */
0x4f, /* 4F = | */
0x50, /* 50 = & */
0x51, /* 51 */
0x52, /* 52 */
0x53, /* 53 */
0x54, /* 54 */
0x55, /* 55 */
0x56, /* 56 */
0x57, /* 57 */
0x58, /* 58 */
0x59, /* 59 */
0x5a, /* 5A = ! (exclamation point) */
0x5b, /* 5B = $ */
0x5c, /* 5C = * */
0x5d, /* 5D = ) */
0x5e, /* 5E = ; */
0x5f, /* 5F = ^ (circumflex) */
0x60, /* 60 = - */
0x61, /* 61 = / */
0x62, /* 62 */
0x63, /* 63 */
0x64, /* 64 */
0x65, /* 65 */
0x66, /* 66 */
0x67, /* 67 */
0x68, /* 68 */
0x69, /* 69 */
0x6a, /* 6A = º (broken bar) */
0x6b, /* 6B = , */
0x6c, /* 6C = % */
0x6d, /* 6D = _ */
0x6e, /* 6E = > */
0x6f, /* 6F = ? */
0x70, /* 70 */
0x71, /* 71 */
0x72, /* 72 */
0x73, /* 73 */
0x74, /* 74 */
0x75, /* 75 */
0x76, /* 76 */
0x77, /* 77 */
0x78, /* 78 */
0x79, /* 79 = ` (prime) */
0x7a, /* 7A = : */
0x7b, /* 7B = # */
0x7c, /* 7C = @ */
0x7d, /* 7D = ' */
0x7e, /* 7E = = */
0x7f, /* 7F = " */
0x80, /* 80 */
0xc1, /* 81 = a -> C1 = A */
0xc2, /* 82 = b -> C2 = B */
0xc3, /* 83 = c -> C3 = C */
0xc4, /* 84 = d -> C4 = D */
0xc5, /* 85 = e -> C5 = E */
0xc6, /* 86 = f -> C6 = F */
0xc7, /* 87 = g -> C7 = G */
0xc8, /* 88 = h -> C8 = H */
0xc9, /* 89 = i -> C9 = I */
0x8a, /* 8A */
0x8b, /* 8B */
0x8c, /* 8C */
0x8d, /* 8D */
0x8e, /* 8E */
0x8f, /* 8F */
0x90, /* 90 */
0xd1, /* 91 = j -> D1 = J */
0xd2, /* 92 = k -> D2 = K */
0xd3, /* 93 = l -> D3 = L */
0xd4, /* 94 = m -> D4 = M */
0xd5, /* 95 = n -> D5 = N */
0xd6, /* 96 = o -> D6 = O */
0xd7, /* 97 = p -> D7 = P */
0xd8, /* 98 = q -> D8 = Q */
0xd9, /* 99 = r -> D9 = R */
0x9a, /* 9A */
0x9b, /* 9B */
0x9c, /* 9C */
0x9d, /* 9D */
0x9e, /* 9E */
0x9f, /* 9F */
0xa0, /* A0 */
0xa1, /* A1 = ~ (tilde) */
0xe2, /* a2 = s -> E2 = S */
0xe3, /* a3 = t -> E3 = T */
0xe4, /* a4 = u -> E4 = U */
0xe5, /* a5 = v -> E5 = V */
0xe6, /* a6 = w -> E6 = W */
0xe7, /* a7 = x -> E7 = X */
0xe8, /* a8 = y -> E8 = Y */
0xe9, /* a9 = z -> E9 = Z */
0xaa, /* AA */
0xab, /* AB */
0xac, /* AC */
0xad, /* AD = [ (open bracket) */
0xae, /* AE */
0xaf, /* AF */
0xb0, /* B0 */
0xb1, /* B1 */
0xb2, /* B2 */
0xb3, /* B3 */
0xb4, /* B4 */
0xb5, /* B5 */
0xb6, /* B6 */
0xb7, /* B7 */
0xb8, /* B8 */
0xb9, /* B9 */
0xba, /* BA */
0xbb, /* BB */
0xbc, /* BC */
0xbd, /* BD = ] (close bracket) */
0xbe, /* BE */
0xbf, /* BF */
0xc0, /* C0 = { (open brace) */
0x81, /* C1 = A -> 81 = a */
0x82, /* C2 = B -> 82 = b */
0x83, /* C3 = C -> 83 = c */
0x84, /* C4 = D -> 84 = d */
0x85, /* C5 = E -> 85 = e */
0x86, /* C6 = F -> 86 = f */
0x87, /* C7 = G -> 87 = g */
0x88, /* C8 = H -> 88 = h */
0x89, /* C9 = I -> 89 = i */
0xca, /* CA = shy */
0xcb, /* CB */
0xcc, /* CC */
0xcd, /* CD */
0xce, /* CE */
0xcf, /* CF */
0xd0, /* D0 = } (close brace) */
0x91, /* D1 = J -> 91 = j */
0x92, /* D2 = K -> 92 = k */
0x93, /* D3 = L -> 93 = l */
0x94, /* D4 = M -> 94 = m */
0x95, /* D5 = N -> 95 = n */
0x96, /* D6 = O -> 96 = o */
0x97, /* D7 = P -> 97 = p */
0x98, /* D8 = Q -> 98 = q */
0x99, /* D9 = R -> 99 = r */
0xda, /* DA */
0xdb, /* DB */
0xdc, /* DC */
0xdd, /* DD */
0xde, /* DE */
0xdf, /* DF */
0xe0, /* E0 = \\ (backslash) */
0xe1, /* E1 = nsp */
0xa2, /* E2 = S -> a2 = s */
0xa3, /* E3 = T -> a3 = t */
0xa4, /* E4 = U -> a4 = u */
0xa5, /* E5 = V -> a5 = v */
0xa6, /* E6 = W -> a6 = w */
0xa7, /* E7 = X -> a7 = x */
0xa8, /* E8 = Y -> a8 = y */
0xa9, /* E9 = Z -> a9 = z */
0xea, /* EA */
0xea, /* EB */
0xea, /* EC */
0xea, /* ED */
0xea, /* EE */
0xea, /* EF */
0xf0, /* F0 = 0 */
0xf1, /* F1 = 1 */
0xf2, /* F2 = 2 */
0xf3, /* F3 = 3 */
0xf4, /* F4 = 4 */
0xf5, /* F5 = 5 */
0xf6, /* F6 = 6 */
0xf7, /* F7 = 7 */
0xf8, /* F8 = 8 */
0xf9, /* F9 = 9 */
0xfa, /* FA */
0xfb, /* FB */
0xfc, /* FC */
0xfd, /* FD */
0xfe, /* FE */
0xff /* FF = eo */
} ;
static const struct _lc_ctype lc_ctype_samp = {
SBCS, /* single byte character mode */
&lc_ctab_samp /* ctype (char type) table pointer */
};
#eject
/**********************************************************************/
/* NUMERIC category */
/**********************************************************************/
const static struct _lc_numeric lc_numeric_samp = {
".", /* decimal_point */
",", /* thousands_sep */
"\3" /* grouping */
};
/**********************************************************************/
/* MONETARY category */
/**********************************************************************/
static const struct _lc_monetary lc_monetary_samp = {
/* */
"DOL", /* int_curr_symbol */
"$", /* currency_symbol */
".", /* mon_decimal_point */
",", /* mon_thousands_sep */
"\3", /* mon_grouping */
"", /* positive_sign */
"-", /* negative_sign */
2, /* int_frac_digits */
2, /* frac_digits */
1, /* p_cs_precedes */
0, /* p_sep_by_space */
1, /* n_cs_precedes */
0, /* n_sep_by_space */
1, /* p_sign_posn */
1 /* n_sign_posn */
};
#eject
/**********************************************************************/
/* TIME category */
/**********************************************************************/
char *sampdcnv (struct tm *tp);
static const struct _lc_time lc_time_samp = {
0, /* addr of date/time conv routine */
&sampdcnv, /* addr of date conv routine */
0, /* addr of time conv routine */
{ "Sun", "Mon", "Tue", /* weekday name abbreviations */
"Wed", "Thu", "Fri",
"Sat" },
{ "Sunday", "Monday", /* weekday full names */
"Tuesday", "Wednesday",
"Thursday", "Friday",
"Saturday" },
{ "Jan", "Feb", "Mar", /* month name abbreviations */
"Apr", "May", "Jun",
"Jul", "Aug", "Sep",
"Oct", "Nov", "Dec" },
{ "January", "February", /* month full names */
"March", "April",
"May", "June",
"July", "August",
"September", "October",
"November", "December" },
"AM", /* locale's "AM" equivalent */
"PM" /* locale's "PM" equivalent */
};
char *sampdcnv (struct tm *tp)
{
/*-------------------------------------------------------------------*/
/* */
/* Samp date conversion routine */
/* */
/* Function returns the date in the form: */
/* wkd mon dd 'yy */
/* e.g. Thu Oct 10 '85 */
/* */
/*-------------------------------------------------------------------*/
char *time_format;
time_format = asctime(tp);
memcpy(time_format+11," '",2);
memcpy(time_format+13,time_format+22,2);
*(time_format+15) = '\0';
return time_format;
} /* end sampdcnv */
#eject
/**********************************************************************/
/* ALL category */
/**********************************************************************/
static const void *lc_all_samp [5] = {
&lc_collate_samp , /* pointer to collate category struct*/
&lc_ctype_samp , /* pointer to ctype category */
&lc_monetary_samp , /* pointer to monetary category */
&lc_numeric_samp , /* pointer to numeric samp */
&lc_time_samp /* pointer to time samp */
};
/**********************************************************************/
/* Return category pointers */
/**********************************************************************/
void *_dynamn() /* l$clsamp executable entry point */
{
return (void *) &lc_all_samp;
}
|