< prev index next >

src/java.base/share/native/libjli/manifest_info.h

Print this page


   1 /*
   2  * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #ifndef _MANIFEST_INFO_H
  27 #define _MANIFEST_INFO_H
  28 
  29 #include <sys/types.h>

  30 
  31 /*
  32  * Zip file header signatures
  33  */
  34 #define SIGSIZ 4                    /* size of all header signatures */
  35 
  36 #define PKZIP_SIGNATURE_AT(p, b2, b3) \
  37   (((p)[0] == 'P') & ((p)[1] == 'K') & ((p)[2] == b2) & ((p)[3] == b3))
  38 #define CENSIG_AT(p)       PKZIP_SIGNATURE_AT(p, 1, 2)
  39 #define LOCSIG_AT(p)       PKZIP_SIGNATURE_AT(p, 3, 4)
  40 #define ENDSIG_AT(p)       PKZIP_SIGNATURE_AT(p, 5, 6)
  41 #define EXTSIG_AT(p)       PKZIP_SIGNATURE_AT(p, 7, 8)
  42 #define ZIP64_ENDSIG_AT(p) PKZIP_SIGNATURE_AT(p, 6, 6)
  43 #define ZIP64_LOCSIG_AT(p) PKZIP_SIGNATURE_AT(p, 6, 7)
  44 
  45 /*
  46  * Header sizes including signatures
  47  */
  48 #define LOCHDR 30
  49 #define EXTHDR 16


 169     char        *manifest_version;      /* Manifest-Version string */
 170     char        *main_class;            /* Main-Class entry */
 171     char        *jre_version;           /* Appropriate J2SE release spec */
 172     char        jre_restrict_search;    /* Restricted JRE search */
 173     char        *splashscreen_image_file_name; /* splashscreen image file */
 174 } manifest_info;
 175 
 176 /*
 177  * Attribute closure to provide to manifest_iterate.
 178  */
 179 typedef void (*attribute_closure)(const char *name, const char *value,
 180         void *user_data);
 181 
 182 /*
 183  * Function prototypes.
 184  */
 185 int     JLI_ParseManifest(char *jarfile, manifest_info *info);
 186 void    *JLI_JarUnpackFile(const char *jarfile, const char *filename,
 187                 int *size);
 188 void    JLI_FreeManifest(void);
 189 int     JLI_ManifestIterate(const char *jarfile, attribute_closure ac,


 190                 void *user_data);
 191 
 192 #endif  /* _MANIFEST_INFO_H */
   1 /*
   2  * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #ifndef _MANIFEST_INFO_H
  27 #define _MANIFEST_INFO_H
  28 
  29 #include <sys/types.h>
  30 #include "jni.h"
  31 
  32 /*
  33  * Zip file header signatures
  34  */
  35 #define SIGSIZ 4                    /* size of all header signatures */
  36 
  37 #define PKZIP_SIGNATURE_AT(p, b2, b3) \
  38   (((p)[0] == 'P') & ((p)[1] == 'K') & ((p)[2] == b2) & ((p)[3] == b3))
  39 #define CENSIG_AT(p)       PKZIP_SIGNATURE_AT(p, 1, 2)
  40 #define LOCSIG_AT(p)       PKZIP_SIGNATURE_AT(p, 3, 4)
  41 #define ENDSIG_AT(p)       PKZIP_SIGNATURE_AT(p, 5, 6)
  42 #define EXTSIG_AT(p)       PKZIP_SIGNATURE_AT(p, 7, 8)
  43 #define ZIP64_ENDSIG_AT(p) PKZIP_SIGNATURE_AT(p, 6, 6)
  44 #define ZIP64_LOCSIG_AT(p) PKZIP_SIGNATURE_AT(p, 6, 7)
  45 
  46 /*
  47  * Header sizes including signatures
  48  */
  49 #define LOCHDR 30
  50 #define EXTHDR 16


 170     char        *manifest_version;      /* Manifest-Version string */
 171     char        *main_class;            /* Main-Class entry */
 172     char        *jre_version;           /* Appropriate J2SE release spec */
 173     char        jre_restrict_search;    /* Restricted JRE search */
 174     char        *splashscreen_image_file_name; /* splashscreen image file */
 175 } manifest_info;
 176 
 177 /*
 178  * Attribute closure to provide to manifest_iterate.
 179  */
 180 typedef void (*attribute_closure)(const char *name, const char *value,
 181         void *user_data);
 182 
 183 /*
 184  * Function prototypes.
 185  */
 186 int     JLI_ParseManifest(char *jarfile, manifest_info *info);
 187 void    *JLI_JarUnpackFile(const char *jarfile, const char *filename,
 188                 int *size);
 189 void    JLI_FreeManifest(void);
 190 
 191 JNIEXPORT int JNICALL
 192 JLI_ManifestIterate(const char *jarfile, attribute_closure ac,
 193                 void *user_data);
 194 
 195 #endif  /* _MANIFEST_INFO_H */
< prev index next >