-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgetlen.c
More file actions
70 lines (53 loc) · 1.39 KB
/
getlen.c
File metadata and controls
70 lines (53 loc) · 1.39 KB
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
/* -MODULE----------------------------------------------------------------------
RapidBATCH
Copyright (C) 2009 by Phorward Software Technologies
http://www.phorward-software.com ++ contact<at>phorward<dash>software<dot>com
File: getlen.c
Author: Jan Max Meyer
Usage: Implements the function GETLEN.
----------------------------------------------------------------------------- */
/*
* Includes
*/
#include "rb_global.h"
/*
* Global variables
*/
/*
* Functions
*/
/*RBDOC
%%function
getlen( str )
%%desc:en
Returns the length (number of characters) of a string '''str'''.
%%desc:ge
Gibt die Länge (Anzahl der Zeichen) des Strings '''str''' zurück.
%%parm:en
str The string, which length should be retrieved.
%%parm:ge
str Der String, dessen Länge bestimmt werden soll.
%%return:en
The length (number of characters) of str.
%%return:ge
Die Länge (Anzahl der Zeichen) von str.
%%notice:en
%%notice:ge
RBDOC*/
RB_FCT( getlen )
{
/*RBAUTOIMPORT function getlen v*/
char* str;
PROC( "getlen" );
RB_FCT_DUMP_PARMS();
str = RB_PARM_VAL_GET_STR( RB_FCT_PARM_ACCESS( 0 ) );
VARS( "str", "%s", str );
#ifdef UTF8
RB_PARM_VAL_SET_LONG( RB_FCT_RET, ( (unsigned long)putf8_strlen( str ) ) );
VARS( "Length", "%ld", putf8_strlen( str ) );
#else
RB_PARM_VAL_SET_LONG( RB_FCT_RET, ( (unsigned long)pstrlen( str ) ) );
VARS( "Length", "%ld", pstrlen( str ) );
#endif
RETURN( 0 );
}