66 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			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 );
 | 
						|
}
 |