Lely core libraries
2.3.4
|
Go to the source code of this file.
Functions | |
int | errno2c (int errnum) |
Transforms a standard C error number to a native error code. More... | |
errnum_t | errno2num (int errnum) |
Transforms a standard C error number to a platform-independent error number. More... | |
int | errc2no (int errc) |
Transforms a native error code to a standard C error number. More... | |
errnum_t | errc2num (int errc) |
Transforms a native error code to a platform-independent error number. More... | |
int | errnum2no (errnum_t errnum) |
Transforms a platform-independent error number to a standard C error number. More... | |
int | errnum2c (errnum_t errnum) |
Transforms a platform-independent error number to a native error code. More... | |
int | get_errc (void) |
Returns the last (thread-specific) native error code set by a system call or library function. More... | |
void | set_errc (int errc) |
Sets the current (thread-specific) native error code to errc. More... | |
const char * | errno2str_r (int errnum, char *strerrbuf, size_t buflen) |
Returns a string describing a standard C error number. More... | |
const char * | errc2str_r (int errc, char *strerrbuf, size_t buflen) |
Returns a string describing a native error code. More... | |
This file is part of the utilities library; it contains the implementation of the error functions.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file errnum.c.
int errno2c | ( | int | errnum | ) |
errnum_t errno2num | ( | int | errnum | ) |
Transforms a standard C error number to a platform-independent error number.
int errc2no | ( | int | errc | ) |
errnum_t errc2num | ( | int | errc | ) |
Transforms a native error code to a platform-independent error number.
int errnum2no | ( | errnum_t | errnum | ) |
Transforms a platform-independent error number to a standard C error number.
int errnum2c | ( | errnum_t | errnum | ) |
int get_errc | ( | void | ) |
Returns the last (thread-specific) native error code set by a system call or library function.
This is equivalent to GetLastError()
/WSAGetLastError()
on Windows, or errno
on other platforms.
This function returns the thread-specific error number.
void set_errc | ( | int | errc | ) |
Sets the current (thread-specific) native error code to errc.
This is equivalent to SetLastError(errc)
/WSASetLastError(errc)
on Windows, or errno = errc
on other platforms.
const char* errno2str_r | ( | int | errnum, |
char * | strerrbuf, | ||
size_t | buflen | ||
) |
Returns a string describing a standard C error number.
The string is copied to a buffer, if specified, as if by POSIX strerror_r().
errnum | the standard C error number. |
strerrbuf | a pointer to the string buffer. If not NULL, at most buflen bytes are copied to the buffer. The string is guaranteed to be null-terminated. |
buflen | the number of bytes available at strerrbuf. |
errno2str(errnum)
otherwise.const char* errc2str_r | ( | int | errc, |
char * | strerrbuf, | ||
size_t | buflen | ||
) |
Returns a string describing a native error code.
The string is copied to a buffer, if specified..
errc | the native error code. |
strerrbuf | a pointer to the string buffer. If not NULL, at most buflen bytes are copied to the buffer. The string is guaranteed to be null-terminated. |
buflen | the number of bytes available at strerrbuf. |
errno2str(errnum)
otherwise.