67 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			67 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
/*
 | 
						|
 * EX00CON.C
 | 
						|
 *
 | 
						|
 *  C/DOS Example program for ArchiveLib 2.0
 | 
						|
 *
 | 
						|
 *  Copyright (c) Greenleaf Software, Inc. 1994 - 1996
 | 
						|
 *  All Rights Reserved
 | 
						|
 *
 | 
						|
 * MEMBERS/FUNCTIONS DEMONSTRATED
 | 
						|
 *
 | 
						|
 *  ALArchiveCreate()
 | 
						|
 *  newALArchive()
 | 
						|
 *  ALArchiveAddFilesToList()
 | 
						|
 *  newALEntryList()
 | 
						|
 *  newALBarGraph()
 | 
						|
 *
 | 
						|
 * DESCRIPTION
 | 
						|
 *
 | 
						|
 *  This example program creates an archive and adds files to it, while
 | 
						|
 *  using an ALBarGraph 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.
 | 
						|
 *
 | 
						|
 * REVISION HISTORY
 | 
						|
 *
 | 
						|
 *  February 1, 1996  2.0A  : Second release
 | 
						|
 *
 | 
						|
 */
 | 
						|
 | 
						|
#include <stdio.h>
 | 
						|
#include <conio.h>
 | 
						|
 | 
						|
#include "arclib.h"
 | 
						|
#include "bargraph.h"
 | 
						|
#include "pkarc.h"
 | 
						|
#include "glarc.h"
 | 
						|
 | 
						|
int main()
 | 
						|
{
 | 
						|
 hALArchive archive;
 | 
						|
 hALMonitor monitor;
 | 
						|
 hALEntryList list;
 | 
						|
 | 
						|
 printf( "Archive Library 2.0\nEX00CON.C\n\n" );
 | 
						|
 printf( "This example program creates an archive and adds files to it, while\n" );
 | 
						|
 printf( "using an ALBarGraph 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.\n" );
 | 
						|
 getch();
 | 
						|
 | 
						|
 monitor = newALBarGraph( AL_MONITOR_OBJECTS );
 | 
						|
#if defined( ZIP )
 | 
						|
 archive = newALPkArchive( "dos00.zip" );
 | 
						|
 printf( "\nAdding input*.dat and *.bak to dos00.zip" );
 | 
						|
 list = newALListPkCompressTools( monitor, 6, 13, 6 );
 | 
						|
#else
 | 
						|
 archive = newALGlArchive( "dos00.gal" );
 | 
						|
 printf( "\nAdding input*.dat and *.bak to dos00.gal" );
 | 
						|
 list = newALListGlCompressTools( monitor, AL_GREENLEAF_LEVEL_4 );
 | 
						|
#endif
 | 
						|
 printf( " using an ALBarGraphMonitor\n\n" );
 | 
						|
 ALEntryListAddWildCardFiles( list, "input*.dat, *.bak", 0 );
 | 
						|
 ALArchiveCreate( archive, list );
 | 
						|
 printf( "%s\n", ALArchiveGetStatusDetail( archive ) );
 | 
						|
 return ALArchiveGetStatusCode( archive );
 | 
						|
}
 |