Back to index

lightning-sunbird  0.9+nobinonly
PatchableAppleSingle.h
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is Mozilla Communicator client code, released
00016  * March 31, 1998.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications Corporation.
00020  * Portions created by the Initial Developer are Copyright (C) 1998
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *   Douglas Turner <dougt@netscape.com>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either of the GNU General Public License Version 2 or later (the "GPL"),
00028  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039  
00040 #ifndef SU_PAS_H
00041 #define SU_PAS_H
00042 
00043 
00044 #include <Errors.h>
00045 #include <Types.h>
00046 #include <Files.h>
00047 #include <Script.h>
00048 #include <Resources.h>
00049 
00050 typedef struct PASHeader /* header portion of Patchable AppleSingle */
00051 {
00052        UInt32 magicNum;     /* internal file type tag = 0x00244200*/
00053        UInt32 versionNum;   /* format version: 1 = 0x00010000 */
00054        UInt8 filler[16];    /* filler */
00055        UInt16 numEntries;   /* number of entries which follow */
00056 } PASHeader ; 
00057 
00058 
00059 typedef struct PASEntry     /* one Patchable AppleSingle entry descriptor */
00060 {
00061         UInt32 entryID;     /* entry type: see list, 0 invalid               */
00062         UInt32 entryOffset; /* offset, in bytes, from beginning       */
00063                             /* of file to this entry's data           */
00064         UInt32 entryLength; /* length of data in octets                      */
00065         
00066 } PASEntry; 
00067 
00068 
00069 typedef struct PASMiscInfo
00070 {
00071        short  fileHasResFork;
00072        short  fileResAttrs;
00073        OSType        fileType;
00074        OSType fileCreator;
00075        UInt32 fileFlags;
00076 
00077 } PASMiscInfo; 
00078 
00079 
00080 typedef struct PASResFork
00081 {
00082        short  NumberOfTypes;
00083        
00084 } PASResFork; 
00085 
00086 
00087 typedef struct PASResource
00088 {
00089        short                attr;
00090        short                attrID;
00091        OSType               attrType;
00092        Str255               attrName;
00093        unsigned long length;
00094               
00095 } PASResource; 
00096 
00097 
00098 
00099 #if PRAGMA_STRUCT_ALIGN
00100 #pragma options align=reset
00101 #endif
00102 
00103 
00104 #define kCreator     'MOSS'
00105 #define kType        'PASf'
00106 #define PAS_BUFFER_SIZE (1024*512)
00107 
00108 #define PAS_MAGIC_NUM       (0x00244200)
00109 #define PAS_VERSION         (0x00010000)
00110 
00111 enum
00112 {
00113        ePas_Data     =      1,
00114        ePas_Misc,
00115        ePas_Resource
00116 };
00117 
00118 #ifdef __cplusplus
00119 extern "C" {
00120 #endif
00121 
00122 /* Prototypes */
00123 OSErr PAS_EncodeFile(FSSpec *inSpec, FSSpec *outSpec);
00124 OSErr PAS_DecodeFile(FSSpec *inSpec, FSSpec *outSpec);
00125 
00126 
00127 
00128 #ifdef __cplusplus
00129 }
00130 #endif
00131 
00132 #endif /* SU_PAS_H */