Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Linux Timesaving Techniques For Dummies.pdf
Скачиваний:
59
Добавлен:
15.03.2015
Размер:
15.98 Mб
Скачать

Installing the Ming Library 407

If the data resides in a file, just fopen() the file browser, and you can often interact with the movies (see line 12) and give the resulting FILE pointer by using the mouse and keyboard. Most Flash movies

to libcurl by using the CURLOPT_READDATA option.

If the data does not reside in a file (maybe you’re computing the data on the fly), you can write a custom function that libcurl calls whenever

it needs more data. See the description of the

CURLOPT_READFUNCTION option in man curl_ easy_setopt for more information.

Line 23: Starting the transfer

After you’ve primed the CURL handle with all the options that you need, start the transfer with the curl_easy_perform() function (see line 23). curl_ easy_perform() carries out the transfer operation that you defined with the series of calls to curl_ easy_setopt(). In fact, you can use the same CURL handle in a whole series of transfer operations just by changing the options in between each transfer. (Typically, you’ll change the CURLOPT_URL and CURLOPT_READDATA before you start the next transfer.)

If the transfer succeeds, curl_easy_perform() returns 0. If an error occurs, curl_easy_perform() stores an error message in errorMsg[ ], and curlupload displays the text of the message at line 24.

Line 26: Finishing the upload

When you’re finished with the CURL handle, you should call the curl_easy_cleanup() function (see line 26). This function discards all the data structures hidden behind the handle and frees any resources that might still be in use.

are created with the help of expensive graphical editors, but you can also produce movies from a simple C program.

Ming is a small software library that lets you create Flash movies from several programming languages (C, C++, Perl, Python, and Java). When you run a Ming program, you aren’t viewing the movie; you’re only creating it. You still need a Flash player (or a Flash play plug-in for your Web browser) to watch the movies that you create.

Ming is easy to install, but it doesn’t follow the typical download, configure, make tango. Ming comes in source form, so you have to compile it after downloading. Before you build Ming, make sure you have the libpng and libungif packages installed on your computer (these two libraries should be included in your distribution media). Use the command:

$ rpm -q libpng libungif

If rpm complains that either package is not currently installed, be sure to install it before you continue (see Technique 17 for help installing RPM packages).

Follow these steps to install and compile Ming:

1. You can find the latest version of Ming at ming.sourceforge.net. Just download the version you want and unpack it.

The Ming Web site currently hosts gzip, bzip2, and zip versions.

2. Move into the directory created when you unpacked the tarball and type make to start the compile process (note, you may see a few warnings but it’s safe to ignore them).

Installing the Ming Library

If you’ve crawled around on the Web, you’ve seen Flash-based Web pages. Flash is an interactive movie technology created by Macromedia (www.macromedia. com). Flash movies typically play within a Web

3. When the compile step finishes, give yourself superuser privileges and type make install.

That’s it — the Ming shared library is copied to /usr/lib/libming.so, and the Ming header file is copied to /usr/include/ming.h.

Соседние файлы в предмете Операционные системы