campo-sirio/al/examples/ex01con.c
alex 714dd74636 Archive Library versione 2.00
git-svn-id: svn://10.65.10.50/trunk@5350 c028cbd2-c16b-5b4b-a496-9718f37d4682
1997-10-09 16:09:54 +00:00

66 lines
2.0 KiB
C
Executable File

/*
* EX01CON.C
*
* C/DOS Example program for ArchiveLib 2.0
*
* Copyright (c) Greenleaf Software, Inc. 1994 - 1996
* All Rights Reserved
*
* MEMBERS/FUNCTIONS DEMONSTRATED
*
* newALSpinner()
*
* DESCRIPTION
*
* This example program creates an archive and adds files to it, while
* using an ALSpinner monitor. It doesn't pay any attention to the
* command line, it just adds INPUT*.DAT and *.BAK to dos00.gal. Any
* existing dos00.gal gets obliterated. Note that this program is
* nearly identical to EX00CON.C, except for the monitor. They could
* easily be merged into a single program.
*
* REVISION HISTORY
*
* February 1, 1996 2.0A : Second release
*
*/
#include <stdio.h>
#include <conio.h>
#include "arclib.h"
#include "spinner.h"
#include "pkarc.h"
#include "glarc.h"
int main()
{
hALArchive archive;
hALMonitor monitor;
hALEntryList list;
printf( "Archive Library 2.0\nEX01CON.C\n\n" );
printf( "This example program creates an archive and adds files to it, while\n" );
printf( "using an ALSpinner monitor. It doesn't pay any attention to the\n" );
printf( "command line, it just adds INPUT*.DAT and *.BAK to dos00.gal. Any\n" );
printf( "existing dos00.gal gets obliterated. Note that this program is\n" );
printf( "nearly identical to EX00CON.C, except for the monitor. They could\n" );
printf( "easily be merged into a single program.\n" );
getch();
monitor = newALSpinner( AL_MONITOR_OBJECTS );
#if defined( ZIP )
archive = newALPkArchive( "dos00.zip" );
list = newALListPkTools( monitor, 6, 13, 6 );
#else
archive = newALGlArchive( "dos00.gal" );
list = newALListGlTools( monitor, AL_GREENLEAF_LEVEL_4 );
#endif
printf( "\nAdding input*.dat and *.bak to %s",
ALStorageGetName( ALArchiveGetStorage( archive ) ) );
printf( " using an ALSpinner object\n\n" );
ALEntryListAddWildCardFiles( list, "input*.dat, *.bak", 0 );
return ALArchiveCreate( archive, list );
}