1 unit Unit_demo_lib; 2 { 3 DESCRIPTION : Demo application using PEA, UnPEA and Raw File Split/Join 4 calling *_lib_procedure procedures with hardcoded parameters, 5 showing different operation modes 6 7 REQUIREMENTS : FPC, Lazarus 8 9 EXTERNAL DATA : --- 10 11 MEMORY USAGE : --- 12 13 DISPLAY MODE : --- 14 15 REFERENCES : --- 16 17 REMARK : --- 18 19 Version Date Author Modification 20 ------- -------- ------- ------------------------------------------ 21 0.10 20060822 G.Tani Initial version 22 0.11 20080704 G.Tani Removed dependency for WinXP package, recompiled with utf8 enabled IDE 23 24 (C) Copyright 2006 Giorgio Tani giorgiotani@interfree.it 25 official pea-peach site http://sourceforge.net/projects/pea-peach/ 26 The program is released under GNU LGPL http://www.gnu.org/licenses/lgpl.txt 27 28 This library is free software; you can redistribute it and/or 29 modify it under the terms of the GNU Lesser General Public 30 License as published by the Free Software Foundation; either 31 version 3 of the License, or (at your option) any later version. 32 33 This library is distributed in the hope that it will be useful, 34 but WITHOUT ANY WARRANTY; without even the implied warranty of 35 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 36 Lesser General Public License for more details. 37 38 You should have received a copy of the GNU Lesser General Public 39 License along with this library; if not, write to the Free Software 40 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 41 } 42 43 {$mode objfpc}{$H+} 44 45 interface 46 47 uses 48 Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons, 49 unit_pea, list_utils; 50 51 type 52 53 { TForm_demo_lib } 54 55 TForm_demo_lib = class(TForm) 56 Button1: TButton; 57 Button2: TButton; 58 Button3: TButton; 59 Button4: TButton; 60 procedure Button1Click(Sender: TObject); 61 procedure Button2Click(Sender: TObject); 62 procedure Button3Click(Sender: TObject); 63 procedure Button4Click(Sender: TObject); 64 private 65 { private declarations } 66 public 67 { public declarations } 68 end; 69 70 var 71 Form_demo_lib: TForm_demo_lib; 72 73 implementation 74 75 { TForm_demo_lib } 76 77 procedure TForm_demo_lib.Button1Click(Sender: TObject); //archive sourcecode .pas files 78 var flist:TFoundList; 79 begin 80 SetLength(flist,8); 81 flist[0]:='list_utils.pas'; 82 flist[1]:='pea_utils.pas'; 83 flist[2]:='peach.pas'; 84 flist[3]:='rfs_utils.pas'; 85 flist[4]:='unit1.pas'; //does not exist, used to demonstrate skipping feature 86 flist[5]:='unit_demo_lib.pas'; 87 flist[6]:='unit_pea.pas'; 88 flist[7]:='unit_report.pas'; 89 pea_lib_procedure('units',25000,'PCOMPRESS2','WHIRLPOOL','SHA256','EAX','this is the passphrase','NOKEYFILE',flist,'BATCH'); 90 end; 91 92 procedure TForm_demo_lib.Button2Click(Sender: TObject); //restore sourcecode .pas files in units folder 93 begin 94 unpea_lib_procedure('units.000001.pea','AUTONAME','RESETDATE','SETATTR','EXTRACT2DIR','this is the passphrase','NOKEYFILE','HIDDEN_REPORT'); 95 end; 96 97 procedure TForm_demo_lib.Button3Click(Sender: TObject); //split present unit in 1000 byte chunks 98 begin 99 rfs_lib_procedure ( 'test',1000,'SHA512','unit_demo_lib.pas','HIDDEN_REPORT'); 100 end; 101 102 procedure TForm_demo_lib.Button4Click(Sender: TObject); //join chunks of present unit in a new, autonamed, file 103 begin 104 rfj_lib_procedure ( 'test.001','AUTONAME','BATCH_REPORT'); 105 end; 106 107 initialization 108 {$I unit_demo_lib.lrs} 109 110 end. 111 112