~ubuntu-branches/ubuntu/intrepid/xulrunner-1.9/intrepid

« back to all changes in this revision

Viewing changes to mozilla/modules/libmar/src/mar.h

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack, Alexander Sack, Fabien Tassin
  • Date: 2008-02-13 11:47:21 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080213114721-7om0mgzngvuk9czv
Tags: 1.9~b3+nobinonly-0ubuntu1
* release FIREFOX_3_0b3_RELEASE

[ Alexander Sack ]
* submit patch that ships xpcshell to bugzilla
  - rename debian/patches/ship_xpcshell.patch =>
           debian/patches/bz410617_att295212_ship_xpcshell.patch
  - update debian/patches/series
* fix tooltip in epiphany: previously displayed out of screen bounds
  (LP: #37507)
  - add debian/patches/bz233371_att297343_fix_outofscreen_embed_tooltip.patch
  - update debian/patches/series
* use default upstream gcc tweaks for improved performance - especially of the
  javascript engine
  - update debian/rules
* update global extension/plugin patch to apply cleanly against latest code
  - update debian/patches/bzXXX_gre_extension_plugin_support.patch
* fix pyxpcom build failure introduced by recent commit
  - add debian/patches/bzXXX_fix_pyxpcom_build_failure.patch
  - update debian/patches/series
* add distro independent global install locations for extensions,
  /usr/lib/mozilla/extensions and /usr/share/mozilla/extensions
  - update debian/xulrunner-1.9.dirs
* support embedded tarball layout when either there is a *.tar.bz2 in orig tarball
  or if DEBIAN_MOZCLIENT_EMBEDDED is not unset (you will need this to produce embedded
  tarballs during |get-orig-source|
  - update debian/rules
* bump minimum libnss3-dev build requirements to >= 3.12.0~1.9b3
  - update debian/control
* bump minimum libnspr4-dev build requirements to >= 4.7.0~1.9b3
  - update debian/control

[ Fabien Tassin ]
* Drop patches applied upstream
  - drop debian/patches/bz410617_att295212_ship_xpcshell.patch
  - drop debian/patches/bz404634_att294921.patch
  - drop debian/patches/bz386610_python2.5_ftbfs_amd64.patch
  - drop debian/patches/bz373918_att295042.patch
  - drop debian/patches/bz408062_unstable_pc.patch
  - drop debian/patches/bz384304_fix_recursive_symlinks.patch
  - update debian/patches/series
* Refresh diverged patches:
  - update debian/patches/bzXXX_pc_honour_system_nspr_nss.patch
  - update debian/patches/rename_venkman_addon.patch
  - update debian/patches/bz344818_cairo_xrender.patch
* Install links for all .so libs in the -dev package
  - update debian/patches/dont_install_so_in_dev.patch
* Bump gtk requirement to 2.12 as per Mozilla bug 412432
  - update debian/control
* Add #DEBHELPER# token to postinst/prerm scripts
  - update debian/xulrunner-1.9.{postinst,prerm}
* Install previously missed libdbusservice.so
  - update debian/xulrunner-1.9.install
* Update venkman patch to also rename locales
  - update debian/patches/rename_venkman_addon.patch
* Bump requirement for system cairo to >= 1.5.8 as we now need
  the newly added cairo_path_extents()
  - update debian/rules
* Include mozilla-devscripts file using -include so ifneq could be omitted
  - update debian/rules
* Fix missing .so symlinks regression
  - update debian/patches/dont_install_so_in_dev.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
 
/* vim:set ts=2 sw=2 sts=2 et cindent: */
3
 
/* ***** BEGIN LICENSE BLOCK *****
4
 
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5
 
 *
6
 
 * The contents of this file are subject to the Mozilla Public License Version
7
 
 * 1.1 (the "License"); you may not use this file except in compliance with
8
 
 * the License. You may obtain a copy of the License at
9
 
 * http://www.mozilla.org/MPL/
10
 
 *
11
 
 * Software distributed under the License is distributed on an "AS IS" basis,
12
 
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13
 
 * for the specific language governing rights and limitations under the
14
 
 * License.
15
 
 *
16
 
 * The Original Code is Mozilla Archive code.
17
 
 *
18
 
 * The Initial Developer of the Original Code is Google Inc.
19
 
 * Portions created by the Initial Developer are Copyright (C) 2005
20
 
 * the Initial Developer. All Rights Reserved.
21
 
 *
22
 
 * Contributor(s):
23
 
 *  Darin Fisher <darin@meer.net>
24
 
 *
25
 
 * Alternatively, the contents of this file may be used under the terms of
26
 
 * either the GNU General Public License Version 2 or later (the "GPL"), or
27
 
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28
 
 * in which case the provisions of the GPL or the LGPL are applicable instead
29
 
 * of those above. If you wish to allow use of your version of this file only
30
 
 * under the terms of either the GPL or the LGPL, and not to allow others to
31
 
 * use your version of this file under the terms of the MPL, indicate your
32
 
 * decision by deleting the provisions above and replace them with the notice
33
 
 * and other provisions required by the GPL or the LGPL. If you do not delete
34
 
 * the provisions above, a recipient may use your version of this file under
35
 
 * the terms of any one of the MPL, the GPL or the LGPL.
36
 
 *
37
 
 * ***** END LICENSE BLOCK ***** */
38
 
 
39
 
#ifndef MAR_H__
40
 
#define MAR_H__
41
 
 
42
 
/* We use NSPR here just to import the definition of PRUint32 */
43
 
#include "prtypes.h"
44
 
 
45
 
#ifdef __cplusplus
46
 
extern "C" {
47
 
#endif
48
 
 
49
 
/**
50
 
 * The MAR item data structure.
51
 
 */
52
 
typedef struct MarItem_ {
53
 
  struct MarItem_ *next;  /* private field */
54
 
  PRUint32 offset;        /* offset into archive */
55
 
  PRUint32 length;        /* length of data in bytes */
56
 
  PRUint32 flags;         /* contains file mode bits */
57
 
  char name[1];           /* file path */
58
 
} MarItem;
59
 
 
60
 
typedef struct MarFile_ MarFile;
61
 
 
62
 
/**
63
 
 * Signature of callback function passed to mar_enum_items.
64
 
 * @param mar       The MAR file being visited.
65
 
 * @param item      The MAR item being visited.
66
 
 * @param data      The data parameter passed by the caller of mar_enum_items.
67
 
 * @returns         A non-zero value to stop enumerating.
68
 
 */
69
 
typedef int (* MarItemCallback)(MarFile *mar, const MarItem *item, void *data);
70
 
 
71
 
/**
72
 
 * Open a MAR file for reading.
73
 
 * @param path      Specifies the path to the MAR file to open.  This path must
74
 
 *                  be compatible with fopen.
75
 
 * @returns         NULL if an error occurs.
76
 
 */
77
 
MarFile *mar_open(const char *path);
78
 
 
79
 
/**
80
 
 * Close a MAR file that was opened using mar_open.
81
 
 * @param mar       The MarFile object to close.
82
 
 */
83
 
void mar_close(MarFile *mar);
84
 
 
85
 
/**
86
 
 * Find an item in the MAR file by name.
87
 
 * @param mar       The MarFile object to query.
88
 
 * @param item      The name of the item to query.
89
 
 * @returns         A const reference to a MAR item or NULL if not found.
90
 
 */
91
 
const MarItem *mar_find_item(MarFile *mar, const char *item);
92
 
 
93
 
/**
94
 
 * Enumerate all MAR items via callback function.
95
 
 * @param mar       The MAR file to enumerate.
96
 
 * @param callback  The function to call for each MAR item.
97
 
 * @param data      A caller specified value that is passed along to the
98
 
 *                  callback function.
99
 
 * @returns         Zero if the enumeration ran to completion.  Otherwise, any
100
 
 *                  non-zero return value from the callback is returned.
101
 
 */
102
 
int mar_enum_items(MarFile *mar, MarItemCallback callback, void *data);
103
 
 
104
 
/**
105
 
 * Read from MAR item at given offset up to bufsize bytes.
106
 
 * @param mar       The MAR file to read.
107
 
 * @param item      The MAR item to read.
108
 
 * @param offset    The byte offset relative to the start of the item.
109
 
 * @param buf       A pointer to a buffer to copy the data into.
110
 
 * @param bufsize   The length of the buffer to copy the data into.
111
 
 * @returns         The number of bytes written or a negative value if an
112
 
 *                  error occurs.
113
 
 */
114
 
int mar_read(MarFile *mar, const MarItem *item, int offset, char *buf,
115
 
             int bufsize);
116
 
 
117
 
/**
118
 
 * Create a MAR file from a set of files.
119
 
 * @param dest      The path to the file to create.  This path must be
120
 
 *                  compatible with fopen.
121
 
 * @param numfiles  The number of files to store in the archive.
122
 
 * @param files     The list of null-terminated file paths.  Each file
123
 
 *                  path must be compatible with fopen.
124
 
 * @returns         A non-zero value if an error occurs.
125
 
 */
126
 
int mar_create(const char *dest, int numfiles, char **files);
127
 
 
128
 
/**
129
 
 * Extract a MAR file to the current working directory.
130
 
 * @param path      The path to the MAR file to extract.  This path must be
131
 
 *                  compatible with fopen.
132
 
 * @returns         A non-zero value if an error occurs.
133
 
 */
134
 
int mar_extract(const char *path);
135
 
 
136
 
#ifdef __cplusplus
137
 
}
138
 
#endif
139
 
 
140
 
#endif  /* MAR_H__ */