1 /* EXTRAITS DE LA LICENCE 2 Copyright CEA, contributeurs : Luc BILLARD et Damien 3 CALISTE, laboratoire L_Sim, (2001-2005) 4 5 Adresse m�l : 6 BILLARD, non joignable par m�l ; 7 CALISTE, damien P caliste AT cea P fr. 8 9 Ce logiciel est un programme informatique servant � visualiser des 10 structures atomiques dans un rendu pseudo-3D. 11 12 Ce logiciel est r�gi par la licence CeCILL soumise au droit fran�ais et 13 respectant les principes de diffusion des logiciels libres. Vous pouvez 14 utiliser, modifier et/ou redistribuer ce programme sous les conditions 15 de la licence CeCILL telle que diffus�e par le CEA, le CNRS et l'INRIA 16 sur le site "http://www.cecill.info". 17 18 Le fait que vous puissiez acc�der � cet en-t�te signifie que vous avez 19 pris connaissance de la licence CeCILL, et que vous en avez accept� les 20 termes (cf. le fichier Documentation/licence.fr.txt fourni avec ce logiciel). 21 */ 22 23 /* LICENCE SUM UP 24 Copyright CEA, contributors : Luc BILLARD et Damien 25 CALISTE, laboratoire L_Sim, (2001-2005) 26 27 E-mail address: 28 BILLARD, not reachable any more ; 29 CALISTE, damien P caliste AT cea P fr. 30 31 This software is a computer program whose purpose is to visualize atomic 32 configurations in 3D. 33 34 This software is governed by the CeCILL license under French law and 35 abiding by the rules of distribution of free software. You can use, 36 modify and/ or redistribute the software under the terms of the CeCILL 37 license as circulated by CEA, CNRS and INRIA at the following URL 38 "http://www.cecill.info". 39 40 The fact that you are presently reading this means that you have had 41 knowledge of the CeCILL license and that you accept its terms. You can 42 find a copy of this licence shipped with this software at Documentation/licence.en.txt. 43 */ 44 #ifndef NQ_BASIC_H 45 #define NQ_BASIC_H 46 47 #include <glib.h> 48 #include <netcdf.h> 49 50 #define NQ_ERROR nqError_quark() 51 GQuark nqError_quark(void); 52 enum 53 { 54 NQ_ERROR_FILE_OPEN, /* Error when opening. */ 55 NQ_ERROR_FILE_UNKNOWN, /* Wrong or unknown headers. */ 56 NQ_ERROR_FILE_HEADER, /* Wrong header value. */ 57 NQ_ERROR_FILE_FORMAT /* Wrong syntax (missing variables... */ 58 }; 59 60 /** 61 * nqOpen_netcdfFile: 62 * @filename: a path to the file to load ; 63 * @netcdfId: a pointer to store the id returned by netcdf ; 64 * @error: a pointer to store possible error. 65 * 66 * Open a file supposed to be a NETCDF file following the Nanoquanta 67 * specifications. The @netcdfId argument will store the integer id used by 68 * netcdf in future calls if the given @filename has a right header. 69 * 70 * Returns: TRUE if the file is a valid NETCDF file, if FALSE, no file 71 * is opened. 72 */ 73 gboolean nqOpen_netcdfFile(const char* filename, int *netcdfId, GError **error); 74 75 /** 76 * nqClose_netcdfFile: 77 * @netcdfId: a netcdf identifier ; 78 * 79 * Close the file that is currently opened by Netcdf. 80 * 81 * Returns: TRUE if the file is succesfully closed. 82 */ 83 gboolean nqClose_netcdfFile(int netcdfId); 84 85 /** 86 * nqGetDim: 87 * @netcdfId: a netcdf identifier ; 88 * @error: a location to store an error (target should NULL on enter) ; 89 * @name: the name of the dimension to get the value from ; 90 * @varId: a location to store the id used to identify this dimension ; 91 * @value: a location to store the returned value. 92 * 93 * Inquire the given @netcdfId file to read the value of the given dimension. 94 * 95 * Returns: TRUE if the dimension exists and the value is readable. 96 */ 97 gboolean nqGetDim(int netcdfId, GError **error, char *name, int *varId, size_t *value); 98 /** 99 * nqCheckVar: 100 * @netcdfId: a netcdf identifier ; 101 * @error: a location to store an error (target should NULL on enter) ; 102 * @name: the name of the value to check the definition of ; 103 * @varId: a location to store the id used to identify this variable ; 104 * @ncType: the supposed type of the variable ; 105 * @nbDims: the supposed number of dimenions of the variable ; 106 * @nbEleDims: an array of size @nbDims with the supposed size of each 107 * dimenion; 108 * 109 * Inquire the given @netcdfId file to read the variable definition 110 * and check that it matches with the given arguments. 111 * 112 * Returns: TRUE if the variable exists and match the given definition. 113 */ 114 gboolean nqCheckVar(int netcdfId, GError **error, char *name, int *varId, 115 nc_type ncType, int nbDims, size_t *nbEleDims); 116 117 118 #endif 119