dkcp.h File Reference

Codepage handling. More...

#include <dk.h>
#include <dktypes.h>

Go to the source code of this file.

Functions

unsigned char * dkcp_open (dk_stream_t *s)
 Open codepage structure, read data from stream.
unsigned char dkcp_convert (unsigned char *p, unsigned char c)
 Convert one character.
void dkcp_fputs (FILE *o, unsigned char *p, char *s)
 Write string to file, do codepage conversions if necessary.


Detailed Description

Codepage handling.

A codepage is a table of 256 unsigned bytes used for byte replacements. On Windows systems the same text when printed to command prompt box looks differently than printed to file and viewed in a text editor. We can get both texts look equally applying codepage replacements before printing the texts.


Function Documentation

unsigned char dkcp_convert ( unsigned char *  p,
unsigned char  c 
)

Convert one character.

Parameters:
p Pointer to the codepage structure.
c Character to convert.
Returns:
The converted character.

void dkcp_fputs ( FILE *  o,
unsigned char *  p,
char *  s 
)

Write string to file, do codepage conversions if necessary.

Parameters:
o Output file.
p Pointer to codepage structure.
s String to write.

unsigned char* dkcp_open ( dk_stream_t s  ) 

Open codepage structure, read data from stream.

The codepage structure is created in dynamically allocated memory, use dk_delete() to release the memory.

Parameters:
s Stream to read codepage from.
Returns:
Pointer to codepage structure on success, NULL on error.


Generated on Mon Jan 4 15:50:55 2010 for dklibs by  doxygen 1.5.8