/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * * root level of an installed copy of the electronic HDF5 document set and * * is linked from the top-level documents page. It can also be found at * * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * This file contains function prototypes for each exported function in * the H5I module. */ #ifndef _H5Ipublic_H #define _H5Ipublic_H /* Public headers needed by this file */ #include "H5public.h" /* * Library type values. Start with `1' instead of `0' because it makes the * tracing output look better when hid_t values are large numbers. Change the * TYPE_BITS in H5I.c if the MAXID gets larger than 32 (an assertion will * fail otherwise). * * When adding types here, add a section to the 'misc19' test in test/tmisc.c * to verify that the H5I{inc|dec|get}_ref() routines work correctly with in. * */ typedef enum H5I_type_t { H5I_UNINIT = (-2), /*uninitialized type */ H5I_BADID = (-1), /*invalid Type */ H5I_FILE = 1, /*type ID for File objects */ H5I_GROUP, /*type ID for Group objects */ H5I_DATATYPE, /*type ID for Datatype objects */ H5I_DATASPACE, /*type ID for Dataspace objects */ H5I_DATASET, /*type ID for Dataset objects */ H5I_ATTR, /*type ID for Attribute objects */ H5I_REFERENCE, /*type ID for Reference objects */ H5I_VFL, /*type ID for virtual file layer */ H5I_GENPROP_CLS, /*type ID for generic property list classes */ H5I_GENPROP_LST, /*type ID for generic property lists */ H5I_ERROR_CLASS, /*type ID for error classes */ H5I_ERROR_MSG, /*type ID for error messages */ H5I_ERROR_STACK, /*type ID for error stacks */ H5I_NTYPES /*number of library types, MUST BE LAST! */ } H5I_type_t; /* Type of atoms to return to users */ typedef int hid_t; #define H5_SIZEOF_HID_T H5_SIZEOF_INT /* An invalid object ID. This is also negative for error return. */ #define H5I_INVALID_HID (-1) /* * Function for freeing objects. This function will be called with an object * ID type number and a pointer to the object. The function should free the * object and return non-negative to indicate that the object * can be removed from the ID type. If the function returns negative * (failure) then the object will remain in the ID type. */ typedef herr_t (*H5I_free_t)(void*); /* Type of the function to compare objects & keys */ typedef int (*H5I_search_func_t)(void *obj, hid_t id, void *key); #ifdef __cplusplus extern "C" { #endif /* Public API functions */ H5_DLL hid_t H5Iregister(H5I_type_t type, void *object); H5_DLL void *H5Iobject_verify(hid_t id, H5I_type_t id_type); H5_DLL void *H5Iremove_verify(hid_t id, H5I_type_t id_type); H5_DLL H5I_type_t H5Iget_type(hid_t id); H5_DLL hid_t H5Iget_file_id(hid_t id); H5_DLL ssize_t H5Iget_name(hid_t id, char *name/*out*/, size_t size); H5_DLL int H5Iinc_ref(hid_t id); H5_DLL int H5Idec_ref(hid_t id); H5_DLL int H5Iget_ref(hid_t id); H5_DLL H5I_type_t H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func); H5_DLL herr_t H5Iclear_type(H5I_type_t type, hbool_t force); H5_DLL herr_t H5Idestroy_type(H5I_type_t type); H5_DLL int H5Iinc_type_ref(H5I_type_t type); H5_DLL int H5Idec_type_ref(H5I_type_t type); H5_DLL int H5Iget_type_ref(H5I_type_t type); H5_DLL void *H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key); H5_DLL herr_t H5Inmembers(H5I_type_t type, hsize_t *num_members); H5_DLL htri_t H5Itype_exists(H5I_type_t type); #ifdef __cplusplus } #endif #endif a> 41 42 43 44 45 46 47 48 49 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
/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    $RCSfile$
  Language:  C++
  Date:      $Date$
  Version:   $Revision$

Copyright (c) 2001 Insight Consortium
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice,
   this list of conditions and the following disclaimer.

 * Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

 * The name of the Insight Consortium, nor the names of any consortium members,
   nor of any contributors, may be used to endorse or promote products derived
   from this software without specific prior written permission.

  * Modified source versions must be plainly marked as such, and must not be
    misrepresented as being the original software.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

=========================================================================*/
#ifndef cmUnixMakefileGenerator_h
#define cmUnixMakefileGenerator_h

#include "cmMakefile.h"
#include "cmMakefileGenerator.h"

/** \class cmUnixMakefileGenerator
 * \brief Write a Unix makefiles.
 *
 * cmUnixMakefileGenerator produces a Unix makefile from its
 * member m_Makefile.
 */
class cmUnixMakefileGenerator : public cmMakefileGenerator
{
public:
  ///! Set cache only and recurse to false by default.
  cmUnixMakefileGenerator();
  
  /**
   * If cache only is on.
   * and only stub makefiles are generated, and no depends, for speed.
   * The default is OFF.
   **/
  void SetCacheOnlyOn()  {m_CacheOnly = true;}
  void SetCacheOnlyOff()  {m_CacheOnly = false;}
  /**
   * If recurse is on, then all the makefiles below this one are parsed as well.
   */
  void SetRecurseOn() {m_Recurse = true;}
  void SetRecurseOff() {m_Recurse = false;}
  
  /**
   * Produce the makefile (in this case a Unix makefile).
   */
  virtual void GenerateMakefile();

  /**
   * Output the depend information for all the classes 
   * in the makefile.  These would have been generated
   * by the class cmMakeDepend.
   */
  void OutputObjectDepends(std::ostream&);

private:
  void RecursiveGenerateCacheOnly();
  void GenerateCacheOnly();
  void OutputMakefile(const char* file);
  void OutputMakeFlags(std::ostream&);
  void OutputTargetRules(std::ostream& fout);
  void OutputLinkLibraries(std::ostream&, const char*, const cmTarget &);
  void OutputTargets(std::ostream&);
  void OutputSubDirectoryRules(std::ostream&);
  void OutputDependInformation(std::ostream&);
  void OutputDependencies(std::ostream&);
  void OutputCustomRules(std::ostream&);
  void OutputMakeVariables(std::ostream&);
  void OutputMakeRules(std::ostream&);
  void OutputSubDirectoryVars(std::ostream& fout,
                              const char* var,
                              const char* target,
                              const char* target1,
                              const char* target2,
                              const std::vector<std::string>& SubDirectories);
  void OutputMakeRule(std::ostream&, 
                      const char* comment,
                      const char* target,
                      const char* depends, 
                      const char* command);
private:
  bool m_CacheOnly;
  bool m_Recurse;
};

#endif