Boost 빌드 for MinGW

몇번의 시도끝에 얻은 MinGW 용 Boot 빌드 방법.

cmd 창에서 아래를 입력

set path=%path%;C:\MinGW-4.6.1\mingw\bin
bootstrap.bat mingw

다음 32비트의 경우..

b2.exe --prefix=C:\boost_1_55_0\release\win32 toolset=gcc variant=debug,release threading=multi install 

64비트의 경우는..

b2.exe --prefix=C:\boost_1_55_0\release\win64 toolset=gcc address-model=64 variant=debug,release threading=multi install

MySQL Connector for MinGW

우선 아래의 링크에서 mysql-connector-c-6.0.2.mingw-port.tgz 파일을 받는다.

https://sourceforge.net/projects/windiana.u/files/mysql/port-mingw/

다음 압축을 풀고.. 다음과 같이 컴파일한다.

% cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/c/Temp/mysql-connector-c-6.0.2-mingw32
% make
% make install

컴파일 중인 화면

컴파일된 결과 파일: mysql-connector-c-6.0.2-mingw32.zip

다음의 코드로 접속 테스트 실시.

#include <stdio.h>
#include <stdlib.h>
#include "mysql.h"

static void change_user(MYSQL *sock,const char *user, const char *password,
			const char *db,my_bool warning)
{
  if (mysql_change_user(sock,user,password,db) != warning)
  {
    fprintf(stderr,"Couldn't change user to: user: '%s', password: '%s', db: '%s':  Error: %s\n",
	    user, password ? password : "", db ? db : "",
	    mysql_error(sock));
  }
}

int main(int argc, char **argv)
{
  MYSQL *sock;

  if (!(sock=mysql_init(0)))
  {
    fprintf(stderr,"Couldn't initialize mysql struct\n");
    exit(1);
  }
  mysql_options(sock,MYSQL_READ_DEFAULT_GROUP,"connect");
  if (!mysql_real_connect(sock,"1.2.3.4","root","PASSWORD",NULL,0,NULL,0))
  {
    fprintf(stderr,"Couldn't connect to engine!\n%s\n",mysql_error(sock));
    perror("");
    exit(1);
  }
  sock->reconnect= 1;

  if (mysql_select_db(sock,"test"))
  {
    fprintf(stderr,"Couldn't select database test: Error: %s\n",
	    mysql_error(sock));
  }

  mysql_close(sock);
  exit(0);
  return 0;
}
% gcc -o connect_test.exe connect_test.c -I/c/Temp/mysql-connector-c-6.0.2-mingw32/include -L/c/Temp/mysql-connector-c-6.0.2-mingw32/lib -lmysqlclient -lws2_32

컴파일시 아래의 아래와 같은 에러가 나면..

error: unknown type name 'SOCKET'

mysql_com.h 파일에 다음을 추가한다.

#ifndef my_socket_defined
#if  defined(__WIN32__) && !defined(__WIN__)
#define my_socket SOCKET
#else
typedef int my_socket;
#endif /* __WIN__ */
#endif /* my_socket_defined */

다음과 같은 에러가 나면서 접속이 안되면..

$ ./connect_test.exe
No error
Couldn't connect to engine!
Host 'xx.xx.xx.xx' is not allowed to connect to this MySQL server

DB 접근 권한 문제로 localhost 로는 접근이 가능하지만 외부에서 다른 IP로 접근했을시 뜨는 오류 이므로 권한을 부여해서 해결한다.
참고로 root 의 host 값들은 localhost, 127.0.0.1 등으로 기본 등록되어 있지만,


mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select host, user, password from user;
+-------------+-------+-------------------------------------------+
| host        | user  | password                                  |
+-------------+-------+-------------------------------------------+
| localhost   | root  | *xxxx |
| 127.0.0.1   | root  |                                           |
| localhost   |       |                                           |
| localhost   | mysql | *xxxxx |
+-------------+-------+-------------------------------------------+
7 rows in set (0.00 sec)

외부접속을 나타내는 값이 없다. 특정 아이피로 지정할 수도 있지만 여기선 % 기호로 어디서든 접속 가능하게 만든다.

mysql> use mysql;
mysql> grant all privileges on *.* to 'root'@'%' identified by 'root의 패스워드';
mysql> flush privileges;
mysql> select host, user, password from user;
+-------------+-------+-------------------------------------------+
| host        | user  | password                                  |
+-------------+-------+-------------------------------------------+
| localhost   | root  | *xxxx |
| 127.0.0.1   | root  |                                           |
| localhost   |       |                                           |
| localhost   | mysql | *xxxx |
| %           | root  | *xxxx |
+-------------+-------+-------------------------------------------+
8 rows in set (0.00 sec)

mysql> quit;

참고 내용: mysql.txt

참고 싸이트: http://forums.mysql.com/read.php?117,425191,425191#msg-425191

OpenAL

홈페이지: http://kcat.strangesoft.net/openal.html

OpenAL Soft is an LGPL-licensed, cross-platform, software implementation of the OpenAL 3D audio API. It’s forked from the open-sourced Windows version available originally from the SVN repository at openal.org.
OpenAL provides capabilities for playing audio in a virtual 3D environment. Distance attenuation, doppler shift, and directional sound emitters are among the features handled by the API. More advanced effects, including air absorption, occlusion, and environmental reverb, are available through the EFX extension. It also facilitates streaming audio, multi-channel buffers, and audio capture.

OpenAL (Open Audio Library, 오픈 오디오 라이브러리)은 자유 소프트웨어 크로스 플랫폼 오디오 API이다. 다중 채널을 지닌 3차원 오디오을 효율적으로 구현해내기 위해 설계되었다. API의 스타일과 만들어진 경위는 OpenGL과 비슷하다.

빌드시 CMake가 필요하며.. MingW 4.8.1 에서 테스트 되었음.

다운로드: openal-soft-1.15.1.tar.bz2.zip

ffmpeg 를 이용한 비디오 플레이어 만들기

예전에.. ffmpeg를 MinGW로 빌드해서 간단히 테스트 해본적이 있다..
예전에는 이런 튜토리얼을 찾지 못해서.. 고생하면서 테스트한적이 있는데..
괜찮은 번역 자료가 있어 올려둠. 번역자님께 감사.

출처: http://hybridego.net

천라인으로비디오플레이어만들기.zip

각종 네트웍 프로토콜 제어 라이브러리

홈페이지: http://www.datareel.com

DataReel – C++ cross-platform database and communications toolkit.

DataReel 이란 이름을 가진.. 라이브러리.
텔넷 제어 라이브러리를 찾아보다 오픈소스로 프로젝트를 찾았음.
텔넷, ftp, pop3등등.. 여러 프로토콜을 지원함.
간단하게 예제로 들어 있는 텔넷 프로토콜을 MinGW에서 테스트 해보니.. 잘 동작함.

다운로드: dreel464.zip

텔넷 예제

// ——————————- //
// ——– Start of File ——– //
// ——————————- //
// ———————————————————– //
// C++ Source Code File Name: testprog.cpp
// C++ Compiler Used: MSVC, BCC32, GCC, HPUX aCC, SOLARIS CC
// Produced By: DataReel Software Development Team
// File Creation Date: 02/23/2001
// Date Last Modified: 01/01/2009
// Copyright (c) 2001-2009 DataReel Software Development
// ———————————————————– //
// ————- Program Description and Details ————- //
// ———————————————————– //
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA

Test program for the embedded telnet client class.
*/
// ———————————————————– //
#include “gxdlcode.h”

#if defined (__USE_ANSI_CPP__) // Use the ANSI Standard C++ library
#include
using namespace std; // Use unqualified names for Standard C++ library
#else // Use the old iostream library by default
#include
#endif // __USE_ANSI_CPP__

#include
#include
#include
#include “gxtelnet.h”

#ifdef __MSVC_DEBUG__
#include “leaktest.h”
#endif

int CheckError(gxsTelnetClient *telnetc)
// Checks the specified stream socket for an error condition
{
if(telnetc->GetSocketError() != gxSOCKET_NO_ERROR) {
cout << "\n" << flush; cout << telnetc->SocketExceptionMessage() << flush << "\n"; telnetc->Close();
return 0;
}
return 1; // No errors reported
}

int main(int argc, char **argv)
{
#ifdef __MSVC_DEBUG__
InitLeakTest();
#endif

if(argc < 4) { cout << "You must specify host, username, and password" << "\n"; cout << "Example: " << argv[0] << " host usr passwd [port]" << "\n"; cout << "host = Host name of the telnet server" << "\n"; cout << "usr = Your user name" << "\n"; cout << "passwd = Your password" << "\n"; return 0; } char *hostname = argv[1]; char *username = argv[2]; char *password = argv[3]; unsigned short port = (unsigned short)23; if(argc == 5) port = atoi(argv[4]); gxsTelnetClient telnetc; // Test terminal emulations // telnetc.SetTermType(gxsTEL_NVT_TERM); // Default // telnetc.SetTermType(gxsTEL_ENV_TERM); // Use ENV TERM setting // telnetc.SetTermType(gxsTEL_VT100F_TERM); // Filtered VT100 emulation // Try with WIN32 consoles using the ANSI.SYS driver // telnetc.SetTermType("ANSI"); cout << "Connecting to " << hostname << " on port " << port << "\n"; cout << "Our terminal type is: " << telnetc.GetTermType() << "\n"; telnetc.ConnectClient(hostname, port); if(!CheckError(&telnetc)) return 1; telnetc.RecvInitSeq(); if(!CheckError(&telnetc)) return 1; const int sbuf_size = 4096; char sbuf[sbuf_size]; telnetc.RecvString(sbuf, sbuf_size, "login"); if(!CheckError(&telnetc)) { cout << sbuf << "\n" << flush; return 1; } cout << sbuf << flush; telnetc.SendString((const char *)username, strlen(username)); if(!CheckError(&telnetc)) return 1; telnetc.RecvString(sbuf, sbuf_size, "Password"); if(!CheckError(&telnetc)) { cout << sbuf << "\n" << flush; return 1; } cout << sbuf << "\n" << flush; telnetc.SendString((const char *)password, strlen(password)); if(!CheckError(&telnetc)) return 1; telnetc.RecvString(sbuf, sbuf_size, "$"); if(!CheckError(&telnetc)) { cout << sbuf << "\n" << flush; return 1; } cout << sbuf << "\n" << flush; telnetc.SendString("ls -l", strlen("ls -l")); if(!CheckError(&telnetc)) return 1; telnetc.RecvString(sbuf, sbuf_size, "$"); cout << sbuf << "\n" << flush; cout << "Closing the telnet connection..." << "\n"; cout << "Exiting..." << "\n"; telnetc.Close(); return 0; } // ----------------------------------------------------------- // // ------------------------------- // // --------- End of File --------- // // ------------------------------- // [/cpp] FTP 예제 [cpp] // ------------------------------- // // -------- Start of File -------- // // ------------------------------- // // ----------------------------------------------------------- // // C++ Source Code File Name: testprog.cpp // C++ Compiler Used: MSVC, BCC32, GCC, HPUX aCC, SOLARIS CC // Produced By: DataReel Software Development Team // File Creation Date: 02/23/2001 // Date Last Modified: 01/01/2009 // Copyright (c) 2001-2009 DataReel Software Development // ----------------------------------------------------------- // // ------------- Program Description and Details ------------- // // ----------------------------------------------------------- // /* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Test program for the embedded FTP client class. */ // ----------------------------------------------------------- // #include "gxdlcode.h" #if defined (__USE_ANSI_CPP__) // Use the ANSI Standard C++ library #include
using namespace std; // Use unqualified names for Standard C++ library
#else // Use the old iostream library by default
#include
#endif // __USE_ANSI_CPP__

#include
#include “gxsftp.h”

#ifdef __MSVC_DEBUG__
#include “leaktest.h”
#endif

int CheckError(gxsFTPClient *ftp, int close_on_err = 1)
{
if(ftp->GetSocketError() != gxSOCKET_NO_ERROR) {
cout << ftp->SocketExceptionMessage() << "\n" << flush; if(ftp->reply_buf[0] != 0) { // Check the reply buffer
cout << ftp->reply_buf << flush; } if(close_on_err == 1) { ftp->Close();
}
return 0;
}
return 1; // No errors reported
}

void ClearInputStream(istream &s)
// Used to clear istream
{
char c;
s.clear();
while(s.get(c) && c != ‘\n’) { ; }
}

void Menu()
{
cout << "\n" << flush; cout << "(a) Set image type to ASCII" << "\n" << flush; cout << "(A) Set active mode on (default)" << "\n" << flush; cout << "(b, B) Set image type to binary" << "\n" << flush; cout << "(c, C) Change working directory" << "\n" << flush; cout << "(d, D) Delete a file" << "\n" << flush; cout << "(h, H, ?) Display this menu" << "\n" << flush; cout << "(g, G) Get a file" << "\n" << flush; cout << "(l) Long directory listing" << "\n" << flush; cout << "(L) Short directory listing" << "\n" << flush; cout << "(M, m) Make a directory" << "\n" << flush; cout << "(n) Long named directory listing" << "\n" << flush; cout << "(N) Short named directory listing" << "\n" << flush; cout << "(p) Put a file" << "\n" << flush; cout << "(P) Set passive FTP mode on" << "\n" << flush; cout << "(q, Q) Quit this program" << "\n" << flush; cout << "(r, R) Remove directory" << "\n" << flush; cout << "(s, S) Display statistics" << "\n" << flush; cout << "(v, V) Move a file" << "\n" << flush; cout << "(w, W) Get working directory" << "\n" << flush; cout << "(z, Z) Get a file size in bytes" << "\n" << flush; cout << "\n" << flush; } void List(gxsFTPClient *ftp, int full) { const int sbuf_size = 8192; char sbuf[sbuf_size]; sbuf[0] = 0; ftp->FTPList(sbuf, sizeof(sbuf), full);
if(!CheckError(ftp, 0)) return;
cout << sbuf << flush << "\n" << flush; cout << ftp->reply_buf << flush; } void ListDir(gxsFTPClient *ftp, int full) { char name[255]; cout << "Enter file or directory name>“;
cin >> name;

const int sbuf_size = 8192;
char sbuf[sbuf_size];
sbuf[0] = 0;
ftp->FTPList(sbuf, sizeof(sbuf), full, name);
if(!CheckError(ftp, 0)) return;
cout << sbuf << flush << "\n" << flush; cout << ftp->reply_buf << flush; } void Stat(gxsFTPClient *ftp) { ftp->FTPStat();
if(!CheckError(ftp, 0)) return;
cout << ftp->reply_buf << flush; } void PWD(gxsFTPClient *ftp) { ftp->FTPPWD();
if(!CheckError(ftp, 0)) return;
cout << ftp->reply_buf << flush; } void ASC(gxsFTPClient *ftp) { ftp->FTPImageType(‘A’);
if(!CheckError(ftp, 0)) return;
cout << ftp->reply_buf << flush; } void Active(gxsFTPClient *ftp) { ftp->FTPActive();
cout << "Passive mode off" << "\n" << flush; } void Passive(gxsFTPClient *ftp) { ftp->FTPPassive();
cout << "Passive mode on" << "\n" << flush; } void BIN(gxsFTPClient *ftp) { ftp->FTPImageType(‘B’);
if(!CheckError(ftp, 0)) return;
cout << ftp->reply_buf << flush; } void ChDir(gxsFTPClient *ftp) { char sbuf[255]; cout << "Enter directory name>“;
cin >> sbuf;
ftp->FTPChDir((const char *)sbuf);
if(!CheckError(ftp, 0)) return;
cout << ftp->reply_buf << flush; } void MkDir(gxsFTPClient *ftp) { char sbuf[255]; cout << "Enter directory to make>“;
cin >> sbuf;
ftp->FTPMkDir((const char *)sbuf);
if(!CheckError(ftp, 0)) return;
cout << ftp->reply_buf << flush; } void RmDir(gxsFTPClient *ftp) { char sbuf[255]; cout << "Enter directory to remove>“;
cin >> sbuf;
ftp->FTPRmDir((const char *)sbuf);
if(!CheckError(ftp, 0)) return;
cout << ftp->reply_buf << flush; } void Delete(gxsFTPClient *ftp) { char sbuf[255]; cout << "Enter file name to delete>“;
cin >> sbuf;
ftp->FTPDelete((const char *)sbuf);
if(!CheckError(ftp, 0)) return;
cout << ftp->reply_buf << flush; } void Move(gxsFTPClient *ftp) { char from[255]; char to[255]; cout << "Enter file name to rename>“;
cin >> from;
cout << "Enter new name>“;
cin >> to;
ftp->FTPMove((const char *)from, (const char *)to);
if(!CheckError(ftp, 0)) return;
cout << ftp->reply_buf << flush; } void Size(gxsFTPClient *ftp) { char sbuf[255]; cout << "Enter file name>“;
cin >> sbuf;
ftp->FTPSize((const char *)sbuf);
if(!CheckError(ftp, 0)) return;
cout << ftp->reply_buf << flush; } void Get(gxsFTPClient *ftp) { char rfile[255]; char lfile[255]; cout << "Enter file name to download>“;
cin >> rfile;
cout << "Enter local file name>“;
cin >> lfile;

// Open the output and truncate if it already exists
DiskFileB stream(lfile, DiskFileB::df_READWRITE, DiskFileB::df_CREATE);
if(!stream) {
cout << "Could not open the " << lfile << " output file" << "\n" << flush; return; } FAU_t bytes; ftp->FTPGet((const char *)rfile, stream, bytes);
if(!CheckError(ftp, 0)) return;
cout << ftp->reply_buf << flush; cout << (long)bytes << " bytes transferred" << "\n" << flush; } void Put(gxsFTPClient *ftp) { char rfile[255]; char lfile[255]; cout << "Enter file name to upload>“;
cin >> lfile;
cout << "Enter remote file name>“;
cin >> rfile;

DiskFileB stream(lfile);
if(!stream) {
cout << "Could not open the " << lfile << " input file" << "\n" << flush; return; } FAU_t bytes; ftp->FTPPut((const char *)rfile, stream, bytes);
if(!CheckError(ftp, 0)) return;
cout << ftp->reply_buf << flush; cout << (long)bytes << " bytes transfered" << "\n" << flush; } int main(int argc, char **argv) { #ifdef __MSVC_DEBUG__ InitLeakTest(); #endif if(argc < 4) { cout << "Usage: " << argv[0] << " server username password [port]" << "\n" << flush; cout << "server = Your FTP server" << "\n" << flush; cout << "username = Your FTP account user name" << "\n" << flush; cout << "username = Your FTP account password" << "\n" << flush; cout << "port = Optional port number" << "\n" << flush; cout << "\n" << flush; cout << "Example: " << argv[0] << " ftp.xyz.com myname mypassword" << "\n" << flush; return 1; } char *server = argv[1]; char *username = argv[2]; char *password = argv[3]; unsigned short port = (unsigned short)21; if(argc == 5) port = atoi(argv[4]); gxsFTPClient ftp; ftp.SetTimeOut(60, 0); // Set a long time for remote servers cout << "\n" << flush; cout << "Connecting to ftp server" << "\n" << flush; ftp.ConnectClient((const char *)server, port); if(!CheckError(&ftp)) return 1; cout << ftp.reply_buf << flush; ftp.FTPLogin((const char *)username, (const char *)password); if(!CheckError(&ftp)) return 1; cout << ftp.reply_buf << flush; char key; Menu(); int rv = 1; while(rv) { if (!cin) { ClearInputStream(cin); if (!cin) { cout << "Input stream error" << "\n" << flush; return 0; } } cout << '>‘;
cin >> key;
if (!cin) continue;
switch(key) {
case ‘?’ : Menu(); break;
case ‘a’ : ClearInputStream(cin); ASC(&ftp); break;
case ‘A’ : ClearInputStream(cin); Active(&ftp); break;
case ‘b’ : case ‘B’ : ClearInputStream(cin); BIN(&ftp); break;
case ‘c’ : case ‘C’ : ClearInputStream(cin); ChDir(&ftp); break;
case ‘d’ : case ‘D’ : ClearInputStream(cin); Delete(&ftp); break;
case ‘g’ : case ‘G’ : ClearInputStream(cin); Get(&ftp); break;
case ‘h’ : case ‘H’ : Menu(); break;
case ‘l’ : ClearInputStream(cin); List(&ftp, 1); break;
case ‘L’ : ClearInputStream(cin); List(&ftp, 0); break;
case ‘m’ : case ‘M’ : ClearInputStream(cin); MkDir(&ftp); break;
case ‘n’ : ClearInputStream(cin); ListDir(&ftp, 1); break;
case ‘N’ : ClearInputStream(cin); ListDir(&ftp, 0); break;
case ‘p’ : ClearInputStream(cin); Put(&ftp); break;
case ‘P’ : ClearInputStream(cin); Passive(&ftp); break;
case ‘q’ : case ‘Q’ : rv = 0; break;
case ‘r’ : case ‘R’ : ClearInputStream(cin); RmDir(&ftp); break;
case ‘s’ : case ‘S’ : ClearInputStream(cin); Stat(&ftp); break;
case ‘v’ : case ‘V’ : ClearInputStream(cin); Move(&ftp); break;
case ‘w’ : case ‘W’ : ClearInputStream(cin); PWD(&ftp); break;
case ‘z’ : case ‘Z’ : ClearInputStream(cin); Size(&ftp); break;
default:
cout << "Unrecognized command" << "\n" << flush; break; } } ftp.FTPLogout(); if(!CheckError(&ftp)) return 1; cout << ftp.reply_buf << flush; cout << "\n" << flush; ftp.Close(); return 0; } // ----------------------------------------------------------- // // ------------------------------- // // --------- End of File --------- // // ------------------------------- // [/cpp]

MinGW 용 glib static 컴파일하기

libiconv (libiconv-1.14)

% ./configure --prefix=/mingw --disable-shared
% make; make install

gettext (gettext-0.18.1.1)

% ./configure --prefix=/mingw --disable-shared -with-libiconv-prefix=/mingw --enable-threads=win32 --enable-relocatable
% make; make install

glib (glib-2.28.8)

% ./configure --prefix=/mingw --disable-shared
% make; make install

libz를 이용한 스트링 압축하기

easyzlib은 libz 라이브러리를 이용하여 간단하게 스트링을 압축할 수 있는 API를 제공하는 라이브러리이다.

easyzlib는 아래에서 다운로드 가능함.
http://www.firstobject.com/easy-zlib-c++-xml-compression.htm

easyzlib.zip

아래에 간단하게 테스트해본 예제.

#include "easyzlib.h"

void main(void)
{
	char *source = "hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.aaaaaaaaaaaaa";
	char *compressed;
	long int compressedSize;
	compressed = malloc(EZ_COMPRESSMAXDESTLENGTH(strlen(source)));

	ezcompress( compressed, &compressedSize, source, strlen(source) );

	printf("source %d bytes\n", strlen(source));
	printf("compressed %d bytes\n", compressedSize);
	
	char *uncompressed;
	long int uncompressedSize;
	uncompressed = malloc(999999);

	//ezuncompress( uncompressed, &uncompressedSize, 
	//		compressed, compressedSize);
	ezuncompress( uncompressed, &uncompressedSize, 
			compressed, compressedSize);
	*(uncompressed+uncompressedSize) = '\0';
	
	printf("uncompressed %d bytes\n", uncompressedSize);
	printf("compressed \n%s\n", compressed);
	printf("uncompressed \n%s", uncompressed);

	free(compressed);
	free(uncompressed);
}
$ ./test.exe
source 409 bytes
compressed 28 bytes
uncompressed 409 bytes
compressed
x쑰H苽▒W(▒/▒I麒e(;
uncompressed
hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.hello world.aaaaaaaaaaaaa

libxslt

홈페이지: http://xmlsoft.org/XSLT/

확장 마크업 언어(XML: Extensible Markup Language)은 구조화된 데이터를 텍스트 형태로 교환하기 위한 World Wide Web Consortium 표준이다. 이것의 인기는 그 보편성에서 비롯한다. 어떤 컴퓨터든지 텍스트 파일을 읽을 수 있다. 적당한 도구로, 어떤 컴퓨터든지 다른 컴퓨터의 XML 파일을 읽을 수 있다.

이 도구들 가운데 가장 중요한 것의 하나로 확장 마크업 언어 변환(XSLT: Extensible Stylesheet Language Transformations)을 들 수 있다. XSLT 는 선언적인 언어로서 XML 파일을 스타일시트를 이용해 임의의 텍스트 출력으로 변환할 수 있게 해준다. libxslt 는 바로 이러한 변환을 수행 하는 함수를 제공한다.

libxslt 는 Daniel Veillard 가 그놈 프로젝트를 위해 작성한 자유 C 언어 라이브러리로 XSLT 변환을 하는 프로그램을 작성할 수 있도록 하기 위해 만들어졌다.

Libxslt is the XSLT C library developed for the GNOME project. XSLT itself is a an XML language to define transformation for XML. Libxslt is based on libxml2 the XML C library developed for the GNOME project. It also implements most of the EXSLT set of processor-portable extensions functions and some of Saxon’s evaluate and expressions extensions.

다운로드: 1.1.26