Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef __BASE64_H__
- #define __BASE64_H__
- #include <stdio.h>
- #include <stdlib.h>
- static const char cb64[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- static const char cd64[]="|$$$}rstuvwxyz{$$$$$$$>?@ABCDEFGHIJKLMNOPQRSTUVW$$$$$$XYZ[\\]^_`abcdefghijklmnopq";
- #define B64_SYNTAX_ERROR 1
- #define B64_FILE_ERROR 2
- #define B64_FILE_IO_ERROR 3
- #define B64_ERROR_OUT_CLOSE 4
- #define B64_LINE_SIZE_TO_MIN 5
- #define B64_SYNTAX_TOOMANYARGS 6
- /*
- ** b64_message
- **
- ** Gather text messages in one place.
- **
- */
- #define B64_MAX_MESSAGES 7
- static char *b64_msgs[ B64_MAX_MESSAGES ] = {
- "b64:000:Invalid Message Code.",
- "b64:001:Syntax Error -- check help (-h) for usage.",
- "b64:002:File Error Opening/Creating Files.",
- "b64:003:File I/O Error -- Note: output file not removed.",
- "b64:004:Error on output file close.",
- "b64:005:linesize set to minimum.",
- "b64:006:Syntax: Too many arguments."
- };
- #define b64_message( ec ) ((ec > 0 && ec < B64_MAX_MESSAGES ) ? b64_msgs[ ec ] : b64_msgs[ 0 ])
- int encode( FILE *infile, FILE *outfile, int linesize );
- void decodeblock( unsigned char *in, unsigned char *out );
- int decode( FILE *infile, FILE *outfile );
- int b64( char opt, char *infilename, char *outfilename, int linesize );
- #endif /* __BASE_H__ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement