Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – tendra.SVN – Blame – /branches/tendra5/src/utilities/shared/ustring.h – Rev 2

Subversion Repositories tendra.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
#ifndef USTRING_INCLUDED
32
#define USTRING_INCLUDED
33
 
34
 
35
/*
36
    UNSIGNED STRING HANDLING
37
 
38
    These macros are used to convert the normal string operations to the
39
    corresponding unsigned string operations.  The portability assumption,
40
    that char * and unsigned char * are interchangeable in these operations
41
    is encapsulated in the tokens U2S and S2U.
42
*/
43
 
44
#if FS_TENDRA
45
#pragma TenDRA begin
46
#pragma TenDRA conversion analysis (pointer-pointer) off
47
#pragma token PROC ( EXP : unsigned char * : ) EXP : char * : U2S #
48
#pragma token PROC ( EXP : char * : ) EXP : unsigned char * : S2U #
49
#define U2S( S )		( ( char * ) ( S ) )
50
#define S2U( S )		( ( unsigned char * ) ( S ) )
51
#pragma TenDRA end
52
#else
53
#define U2S( S )		( ( char * ) ( S ) )
54
#define S2U( S )		( ( unsigned char * ) ( S ) )
55
#endif
56
 
57
#define ustrlit( S )		( S2U ( S ) )
58
#define strlit( S )		( U2S ( S ) )
59
 
60
#define ustrlen( S )		( strlen ( U2S ( S ) ) )
61
#define ustrcpy( S, T )		( S2U ( strcpy ( U2S ( S ), U2S ( T ) ) ) )
62
#define ustrcpy_v( S, T )	( strcpy_v ( U2S ( S ), U2S ( T ) ) )
63
#define ustrcmp( S, T )		( strcmp ( U2S ( S ), U2S ( T ) ) )
64
#define ustreq( S, T )		( strcmp ( U2S ( S ), U2S ( T ) ) == 0 )
65
#define ustrchr( S, C )		( S2U ( strchr ( U2S ( S ), ( C ) ) ) )
66
#define ustrrchr( S, C )	( S2U ( strrchr ( U2S ( S ), ( C ) ) ) )
67
 
68
#define xustr( N )		( S2U ( xstr ( N ) ) )
69
#define xustrcpy( S )		( S2U ( xstrcpy ( U2S ( S ) ) ) )
70
#define xustrcat( S, T )	( S2U ( xstrcat ( U2S ( S ), U2S ( T ) ) ) )
71
 
72
 
73
#endif