HPlogo MPE/iX Developer's Kit Reference Manual Volume I: HP 3000 MPE/iX Computer Systems > Chapter 4  POSIX/iX Library Function Descriptions

regerror

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Convert regular expression errors to messages.

Syntax

   #include <sys/types.h>

   #include <regex.h>

   size_t regerror(int errcode, const regex_t *reg,

 char *errbuf, size_t len)

Parameters

errcode

Is the last non-zero value returned by a call to regcomp() or `regexec()''.

reg

Points to an object where regcomp() stored a compiled regular expression. regex_t is defined in <regex.h>. reg is currently unused in this implementation.

errbuf

Points to the region of memory where regerror() stores the generated error message.

len

Is the maximum number of characters that can be placed in errbuf. If this is not enough to hold the generated message, regerror() truncates the message to len-1 characters and appends a \0 character.

Description

regerror() takes an error code produced by regcomp() or regexec() and produces a printable error message that corresponds to the error condition. The return value of regerror() is the length of this error message.

If the len argument is not zero, regerror() places the error message in the buffer pointed to by errbuf, truncating it, if necessary. If the len is zero, regerror() ignores the buffer, but still returns the length of the appropriate error message.

Erorrs

regerror() normally places one of the messages from the regerror(3) man page in the buffer indicated by *errbuf. All messages are shown with the error code returned by regcomp() or regexec()''.

See Also

regexec(), regfree(), regexp(3)

Feedback to webmaster