ESAPI-C 1.0
The OWASP Enterprise Security API for C

codec.c File Reference

A Codec module implementation. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include "codec.h"

Go to the source code of this file.

Functions

bool hasNext (char *input, int index, char pushback)
char next (const char *input, int *index, char *pushback)
char * ctohex (char c)
char * nonatohex (char c)
 Lookup the hex value of any character that is not alphanumeric.
void codec_init ()
 Initialize an array to mark which characters are to be encoded.

Variables

codec codec_unix = { "Unix", encode_unix_char, decode_unix_char }
codecpcodec_unix = &codec_unix
 A pointer to the global UNIX command shell codec definition.
codec codec_windows = { "Windows", encode_windows_char, decode_windows_char }
codecpcodec_windows = &codec_windows
 A pointer to the global Windows command shell codec definition.

Detailed Description

A Codec module implementation.

Since:
January 30, 2011

Definition in file codec.c.


Function Documentation

void codec_init ( )

Initialize an array to mark which characters are to be encoded.

Store the hex string for that character to save time later. If the character shouldn't be encoded, then store null.

Definition at line 136 of file codec.c.

char* nonatohex ( char  c)

Lookup the hex value of any character that is not alphanumeric.

Parameters:
cThe character to lookup.
Returns:
, return null if alphanumeric or the character code in hex.

Definition at line 127 of file codec.c.

Referenced by encode_windows_char().

 All Data Structures Files Functions Variables Typedefs Defines