main 2.29 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "Licence").
 * You may not use this file except in compliance with the Licence.
 *
 * You can obtain a copy of the licence at
 * RiscOS/Sources/FileSys/ImageFS/SparkFS/Codecs/SparkARJ/LICENCE.
 * See the Licence for the specific language governing permissions
 * and limitations under the Licence.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the Licence file. If applicable, add the
 * following below this CDDL HEADER, with the fields enclosed by
 * brackets "[]" replaced with your own identifying information:
 * Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 1992 David Pilling.  All rights reserved.
 * Use is subject to license terms.
 */
/*->c.main                     */

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <ctype.h>
#include <time.h>
#include <locale.h>

ROOL's avatar
ROOL committed
35 36
#include "kernel.h"
#include "swis.h"
37

ROOL's avatar
ROOL committed
38
#include "Interface/SparkFS.h"
39

ROOL's avatar
ROOL committed
40 41 42 43 44
#include "SparkLib/zflex.h"
#include "SparkLib/sfs.h"
#include "SparkLib/zbuffer.h"
#include "SparkLib/sinterface.h"
#include "SparkLib/err.h"
45

ROOL's avatar
ROOL committed
46 47 48 49
#include "arcs.h"
#include "cat.h"
#include "convert.h"
#include "main.h"
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122



/****************************************************************************/


static flink link=
{
 veneer_updatecat,
 veneer_loadarchive,
 veneer_deletefile,
 veneer_createdir,
 veneer_createfile,
 veneer_loadfile,
 veneer_savefile,
 veneer_opensave,
 veneer_closesave,
 veneer_openload,
 veneer_closeload,
 veneer_rename,
 veneer_create,
 veneer_convert,
 veneer_info,
 veneer_method,
 veneer_validate,
 veneer_diropen,
 veneer_flush
};



static void ARJ_finalise(void)
{
 _kernel_swi_regs rx;

 rx.r[0]=REMLINK;
 rx.r[1]=(int)&link;

 _kernel_swi(LINKSWI,&rx,&rx);
}



static _kernel_oserror * initlink(void * pw)
{
 _kernel_oserror  * err;
 _kernel_swi_regs   rx;

 rx.r[0]=ADDLINK;
 rx.r[1]=(int)&link;
 rx.r[2]=(int)pw;
 rx.r[3]=COMPATIBLE;

 err=_kernel_swi(LINKSWI,&rx,&rx);

 return(err);
}



_kernel_oserror * ARJ_initialise(char * cmd_tail,int podule_base,void * pw)
{
 _kernel_oserror  * err;

 cmd_tail=NULL;
 podule_base=0;

 err=initlink(pw);

 atexit(ARJ_finalise);

 return(NULL);
}