[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions , Volume 2


strncollen Subroutine

Purpose

Returns the number of collation values for a given string.

Library

Standard C Library (libc.a)

Syntax


include <string.h>


int strncollen ( String, Number)
const char *String;
const int Number;

Description

The strncollen subroutine returns the number of collation values for a given string pointed to by the String parameter. The count of collation values is terminated when either a null character is encountered or when the number of bytes indicated by the Number parameter have been examined.

The collation values are set by the setlocale subroutine for the LC_COLLATE category. For example, if the locale is set to Es_ES (Spanish spoken in Spain) for the LC_COLLATE category, where `ch' has one collation value, then strncollen ('abchd', 5) returns 4.

In German, the <Sharp-S> character has two collation values, so substituting the <Sharp-S> character for B in the following example, strncollen ('straBa', 6) returns 7.

If a character has no collation value, its collation length is 0.

Parameters


Number The number of bytes in a string to be examined.
String Pointer to a string to be examined for collation value.

Return Values

Upon successful completion, the strncollen subroutine returns the collation value for a given string, pointed to by the String parameter.

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The setlocale (setlocale Subroutine) subroutine, strcat, strncat, strxfrm, strcpy, strncpy, or strdup (strcat, strncat, strxfrm, strcpy, strncpy, or strdup Subroutine) subroutine, strcmp, strncmp, strcasecmp, strncasecmp, or strcoll (strcmp, strncmp, strcasecmp, strncasecmp, or strcoll Subroutine) subroutine, strlen, strchr, strrchr, strpbrk, strspn, strcspn, strstr, or strtok (strlen, strchr, strrchr, strpbrk, strspn, strcspn, strstr, or strtok Subroutine) subroutine.

National Language Support Overview for Programming in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]