/*
 * EX02CON.C
 *
 *  C/DOS Example program for ArchiveLib 2.0
 *
 *  Copyright (c) Greenleaf Software, Inc. 1994 - 1996
 *  All Rights Reserved
 *
 * MEMBERS/FUNCTIONS DEMONSTRATED
 *
 *  ALArchiveAppend()
 *
 * DESCRIPTION
 *
 *  This example program adds all *.CPP files to the existing dos00.gal
 *  archive.  If you haven't already created dos00.gal, you can do so
 *  easily by executing EX00CON or EX01CON.
 *
 * REVISION HISTORY
 *
 *  February 1, 1996  2.0A  : Second release
 *
 */

#include <stdio.h>
#include <conio.h>

#include "arclib.h"
#include "pkarc.h"
#include "glarc.h"
#include "spinner.h"

int main()
{
 hALArchive archive;
 hALMonitor monitor;
 hALEntryList list;
 int status;

 printf( "Archive Library 2.0\nEX02CON.C\n\n" );
 printf( "This example program adds all *.CPP files to the existing dos00.gal\n" );
 printf( "archive.  If you haven't already created dos00.gal, you can do so\n" );
 printf( "easily by executing EX00CON or EX01CON.\n" );
 getch();

 monitor = newALSpinner( AL_MONITOR_OBJECTS );

#if defined( ZIP )
 printf( "\nAppending all *.cpp files to dos00.zip.\n\n" );
 archive = newALPkArchive( "dos00.zip" );
 list = newALListPkCompressFileTools( monitor, 9, 13, 6 );
#else
 printf( "\nAppending all *.cpp files to dos00.gal.\n\n" );
 archive = newALGlArchive( "dos00.gal" );
 list = newALListGlCompressFileTools( monitor, AL_GREENLEAF_LEVEL_1 );
#endif
 ALEntryListAddWildCardFiles( list, "*.CPP", 0 );
 status = ALArchiveAppend( archive, list );
 printf( "Result of append operation is %d\n", status );
 return status;
}