campo-sirio/al/examples/ex04con.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

63 lines
1.7 KiB
C
Executable File

/*
* EX04CON.C
*
* C/DOS Example program for ArchiveLib 2.0
*
* Copyright (c) Greenleaf Software, Inc. 1994 - 1996
* All Rights Reserved
*
* MEMBERS/FUNCTIONS DEMONSTRATED
*
* ALArchiveSetComment()
* ALArchiveWriteDirectory()
* ALEntrySetComment()
*
* DESCRIPTION
*
* This example program demonstrates ArchiveLib's ability to set
* comments both for an entire archive as well as individual objects
* within the archive. If you don't have a copy of dos00.gal already,
* you can create one using EX00CON.EXE.
*
* REVISION HISTORY
*
* February 1, 1996 2.0A : Second release
*
*/
#include <stdio.h>
#include <conio.h>
#include "al.h"
int main()
{
hALArchive archive;
hALEntryList list;
hALEntry entry;
printf( "Archive Library 2.0\nEX04CON.C\n\n" );
printf( "This example program demonstrates ArchiveLib's ability to set\n" );
printf( "comments both for an entire archive as well as individual objects\n" );
printf( "within the archive. If you don't have a copy of dos00.gal already,\n" );
printf( "you can create one using EX00CON.\n" );
getch();
#if defined( ZIP )
archive = newALPkArchive( "dos00.zip" );
#else
archive = newALGlArchive( "dos00.gal" );
#endif
list = newALListFullTools( 0 );
ALArchiveReadDirectory( archive, list );
printf( "Setting archive comment\n" );
ALArchiveSetComment( archive, "Greenleaf was here" );
entry = ALEntryListGetFirstEntry( list );
printf( "Setting comment for: %s\n",
ALStorageGetName( ALEntryGetStorage( entry ) ) );
ALEntrySetComment( entry, "Greenleaf was here." );
ALArchiveWriteDirectory( archive, list );
return 0;
}