zoslib
z/OS C/C++ Library
|
#include "zos-char-util.h"
#include "zos-base.h"
#include "zos-io.h"
#include <_Ccsid.h>
#include <ctest.h>
#include <fcntl.h>
#include <iconv.h>
#include <pthread.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unordered_map>
Classes | |
class | __csConverter |
struct | IntHash |
class | fdAttributeCache |
Macros | |
#define | _AE_BIMODAL 1 |
Typedefs | |
typedef unsigned long | fd_attribute |
typedef std::unordered_map< int, fd_attribute, IntHash >::const_iterator | cursor_t |
Functions | |
void * | _convert_e2a (void *dst, const void *src, size_t size) |
void * | _convert_a2e (void *dst, const void *src, size_t size) |
int | __guess_ue (const void *src, size_t size, char *errmsg, size_t er_size) |
void | __set_ccsid_guess_buf_size (int nbytes) |
int | __guess_fd_ue (int fd, char *errmsg, size_t er_size, int is_new_fd) |
int | __guess_ae (const void *src, size_t size) |
int | conv_utf8_utf16 (char *out, size_t outsize, const char *in, size_t insize) |
int | conv_utf16_utf8 (char *out, size_t outsize, const char *in, size_t insize) |
void | __fd_close (int fd) |
int | __file_needs_conversion (int fd) |
int | __file_needs_conversion_init (const char *name, int fd) |
void | __set_autocvt_on_fd_stream (int fd, unsigned short ccsid, unsigned char txtflag, int on_untagged_only) |
Variables | |
fdAttributeCache | fdcache |
#define _AE_BIMODAL 1 |
typedef std::unordered_map<int,fd_attribute,IntHash>::const_iterator cursor_t |
typedef unsigned long fd_attribute |
void __fd_close | ( | int | fd | ) |
Unsets fd attributes
[in] | fd | file descriptor |
int __file_needs_conversion | ( | int | fd | ) |
Determines if file descriptor needs conversion from EBCDIC to ASCII. Call __file_needs_conversion_init first before calling this function.
[in] | fd | file descriptor |
int __file_needs_conversion_init | ( | const char * | name, |
int | fd | ||
) |
Determines if file needs conversion from EBCDIC to ASCII.
[in] | name | path to file |
[in] | fd | file descriptor |
int __guess_ae | ( | const void * | src, |
size_t | size | ||
) |
Guess if string is ASCII or EBCDIC.
[in] | src | - character string. |
[in] | size | - number of bytes to analyze. |
int __guess_fd_ue | ( | int | fd, |
char * | errmsg, | ||
size_t | er_size, | ||
int | is_new_fd | ||
) |
Guess if string is UTF8 (ASCII) or EBCDIC based on the first CCSID_GUESS_BUF_SIZE_ENVAR of the file associated with the given fd. CCSID_GUESS_BUF_SIZE_ENVAR is default at 4KB.
[in] | fd | - open file descriptor to guess. |
int __guess_ue | ( | const void * | src, |
size_t | size, | ||
char * | errmsg, | ||
size_t | er_size | ||
) |
Guess if string is UTF8 (ASCII) or EBCDIC.
[in] | src | - character string. |
[in] | size | - number of bytes to analyze. |
void __set_autocvt_on_fd_stream | ( | int | fd, |
unsigned short | ccsid, | ||
unsigned char | txtflag, | ||
int | on_untagged_only | ||
) |
Sets file descriptor to auto convert.
[in] | fd | - file descriptor. |
[in] | ccsid | - CCSID to auto convert to. |
[in] | txtflag | - Indicates if ccsid is text. |
[in] | on_untagged_only | - applies only to untagged |
void __set_ccsid_guess_buf_size | ( | int | nbytes | ) |
void * _convert_a2e | ( | void * | dst, |
const void * | src, | ||
size_t | size | ||
) |
Convert from ASCII to EBCDIC
[out] | dst | Destination string (must be pre-allocated). |
[in] | src | Source string. |
[in] | size | Number of bytes to convert |
void * _convert_e2a | ( | void * | dst, |
const void * | src, | ||
size_t | size | ||
) |
Convert from EBCDIC to ASCII.
[out] | dst | Destination string (must be pre-allocated). |
[in] | src | Source string. |
[in] | size | Number of bytes to convert. |
int conv_utf16_utf8 | ( | char * | out, |
size_t | outsize, | ||
const char * | in, | ||
size_t | insize | ||
) |
Convert string from UTF16 to UTF8.
int conv_utf8_utf16 | ( | char * | out, |
size_t | outsize, | ||
const char * | in, | ||
size_t | insize | ||
) |
Convert string from UTF8 to UTF16
fdAttributeCache fdcache |