WA-SDK  3.0.4.0
WA-SDK
issacweb/sample_issacweb_base64.c
#include <stdio.h>
#include "issacweb.h"
static int sample_setup() {
EErrorCode result = wasdk_init();
if (result != EEC_Success) {
printf("[ERROR] %s\n", wasdk_error_message(result));
return 1;
}
return 0;
}
static int sample_issacweb_base64() {
const char *orgMsg = "TEST Message";
int orgMsgLen = (int) strlen(orgMsg);
char encoded[64] = { 0, };
unsigned char decoded[64] = { 0, };
int encodedLen = 0;
int decodedLen = 0;
printf("sample_issacweb_base64() => ");
encodedLen = issacweb_base64_encode((issac_string) encoded, (issac_binary) orgMsg, orgMsgLen);
if (encodedLen <= 0) {
printf("[ERROR] %s\n", errorcode_to_string(encodedLen));
return 1;
}
decodedLen = issacweb_base64_decode((issac_binary) decoded, (issac_string) encoded);
if (encodedLen <= 0) {
printf("[ERROR] %s\n", errorcode_to_string(decodedLen));
return 1;
}
printf("[OK]\n");
return 0;
}
int main() {
int result;
result = sample_setup();
if (result != 0) {
return result;
}
return sample_issacweb_base64();
}
EErrorCode
새롭게 구현된 내부 API 에서 사용되는 에러코드들
Definition: wasdk_errorcode.h:13
@ EEC_Success
성공
Definition: wasdk_errorcode.h:14
char * issac_string
Definition: issacweb.h:29
WA_SDK_API int FUNCCALL issacweb_base64_decode(issac_binary outbuf, issac_string inputstring)
입력한 Base64 문자열을 데이터로 디코딩한다.
WA_SDK_API int FUNCCALL issacweb_base64_encode(issac_string outstring, issac_binary input, int input_len)
입력한 데이터를 Base64 문자열로 인코딩한다.
unsigned char * issac_binary
Definition: issacweb.h:30
WA_SDK_API const char *FUNCCALL wasdk_error_message(EErrorCode errorCode)
에러코드에 해당하는 에러 메시지를 가져온다.
WA_SDK_API EErrorCode FUNCCALL wasdk_init(void)
모듈 초기화를 실행한다.
EXTERNC const char * errorcode_to_string(int code)