Changeset 3083 for trunk/LMDZ.TITAN/libf/muphytitan/csystem.h
- Timestamp:
- Oct 12, 2023, 10:30:22 AM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.TITAN/libf/muphytitan/csystem.h
r1897 r3083 1 /* Copyright Jérémie Burgalat (2010-2015,2017) 2 * 3 * jeremie.burgalat@univ-reims.fr 4 * 5 * This software is a computer program whose purpose is to provide configuration 6 * file and command line arguments parsing features to Fortran programs. 7 * 8 * This software is governed by the CeCILL-B license under French law and 9 * abiding by the rules of distribution of free software. You can use, 10 * modify and/ or redistribute the software under the terms of the CeCILL-B 11 * license as circulated by CEA, CNRS and INRIA at the following URL 12 * "http://www.cecill.info". 13 * 14 * As a counterpart to the access to the source code and rights to copy, 15 * modify and redistribute granted by the license, users are provided only 16 * with a limited warranty and the software's author, the holder of the 17 * economic rights, and the successive licensors have only limited 18 * liability. 19 * 20 * In this respect, the user's attention is drawn to the risks associated 21 * with loading, using, modifying and/or developing or reproducing the 22 * software by the user in light of its specific status of free software, 23 * that may mean that it is complicated to manipulate, and that also 24 * therefore means that it is reserved for developers and experienced 25 * professionals having in-depth computer knowledge. Users are therefore 26 * encouraged to load and test the software's suitability as regards their 27 * requirements in conditions enabling the security of their systems and/or 28 * data to be ensured and, more generally, to use and operate it in the 29 * same conditions as regards security. 30 * 31 * The fact that you are presently reading this means that you have had 32 * knowledge of the CeCILL-B license and that you accept its terms. 1 /* 2 * Copyright (c) (2013-2015,2017) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr). 3 * 4 * This file is part of SWIFT 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 * this software and associated documentation files (the "Software"), to deal in 8 * the Software without restriction, including without limitation the rights to 9 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 * the Software, and to permit persons to whom the Software is furnished to do so, 11 * subject to the following conditions: 12 * 13 * The above copyright notice and this permission notice shall be included in all 14 * copies or substantial portions of the Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 33 22 */ 34 23 … … 43 32 int c_umask(); 44 33 45 /** 46 * Get directory name of input path 34 /** 35 * Get directory name of input path 47 36 * @param[in] in A C string with the input path 48 37 * @return A pointer to a char array with the directory name of @bti{input} path. 49 38 * @note On error, a NULL pointer is returned. 50 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 39 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 51 40 * (using fsystem::free_c). 52 41 */ 53 42 char * c_dirname(const char *in); 54 43 55 /** 56 * Get base name of input path 44 /** 45 * Get base name of input path 57 46 * @param[in] in A C string with the input path 58 47 * @return A pointer to a char array with the base name of @bti{input} path. 59 48 * @note On error, a NULL pointer is returned. 60 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 49 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 61 50 * (using fsystem::free_c). 62 51 */ 63 52 char* c_basename(const char *in); 64 53 65 /** 54 /** 66 55 * Get the current working directory. 67 56 * @return A pointer to a char array with the current workind directory. 68 57 * @note On error, a NULL pointer is returned. 69 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 58 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 70 59 * (using fsystem::free_c). 71 60 */ … … 73 62 74 63 75 /** 64 /** 76 65 * Get the realpath of input path. 77 66 * @param[in] input A C string with the input path 78 67 * @return A pointer to a char array with the realpath of @bti{input} path. 79 68 * @note On error, a NULL pointer is returned. 80 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 69 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 81 70 * (using fsystem::free_c). 82 71 */ … … 91 80 * @return A pointer to a char array with the relative path. 92 81 * @note On error, a NULL pointer is returned. 93 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 82 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 94 83 * (using fsystem::free_c). 95 84 */ … … 101 90 * @return A pointer to a char array with the user name. 102 91 * @note On error, a NULL pointer is returned. 103 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 92 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 104 93 * (using fsystem::free_c). 105 94 */ … … 111 100 * @return A pointer to a char array with the group name. 112 101 * @note On error, a NULL pointer is returned. 113 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 102 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 114 103 * (using fsystem::free_c). 115 104 */ … … 122 111 int c_get_errno(); 123 112 124 /** 113 /** 125 114 * Get the error message of the given error id 126 115 * @param err An integer with the error id 127 116 * @return A pointer to a char array with the group name. 128 117 * @note On error, the hard-coded message "Unknown error" is returned. 129 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 118 * @warning In any case, the returned pointer must be freed in the Fortran counterpart 130 119 * (using fsystem::free_c). 131 120 */ … … 139 128 * @return An integer with 0 on success, last errno on failure 140 129 */ 141 int c_mkdirp(const char *path, mode_t mode); 130 int c_mkdirp(const char *path, mode_t mode); 142 131 143 132 /** … … 151 140 /** 152 141 * Change path permissions 153 * @param path A string with the path 142 * @param path A string with the path 154 143 * @param mode A integer with the new permissions to set 155 144 * @return An integer with 0 on success, last errno on failure … … 170 159 * (as well as all the parent directorie created, if any). 171 160 * @return An integer with 0 on success, last errno on failure 172 */ 161 */ 173 162 int c_mkdir(const char *path, mode_t mode); 174 163 … … 200 189 * Remove a directory and its contents recursively 201 190 * 202 * This method mimics 'rm -rf' command. 191 * This method mimics 'rm -rf' command. 203 192 * @param path A C string with the path of the directory to remove. 204 193 * @return An integer with 0 on success, last errno on failure … … 208 197 /** 209 198 * Get some file informations 210 * @note If the path cannot be "stat", most of the output parameters are set 199 * @note If the path cannot be "stat", most of the output parameters are set 211 200 * to -1. 212 201 * @param[in] p A C string with the path of a file (or directory) 213 * @param[out] pe An int with the permissions of the path 202 * @param[out] pe An int with the permissions of the path 214 203 * @param[out] nl An int with the inumber of links 215 204 * @param[out] ty An int with the type of the file : … … 219 208 * - 3 -> link to a directory 220 209 * - 4 -> Other (fifo, socket, block special, char special ...) 221 * @param[out] ui An int with the user id of the path 222 * @param[out] gi An int with the group id of the path 223 * @param[out] si An int with the size of the path 210 * @param[out] ui An int with the user id of the path 211 * @param[out] gi An int with the group id of the path 212 * @param[out] si An int with the size of the path 224 213 * @param[out] a A C string (20 chars wide, including NULL character) with the 225 214 * last access date 226 215 * @param[out] m A C string (20 chars wide, including NULL character) with the 227 216 * last modification date 228 * @param[out] c A C string (20 chars wide, including NULL character) with the 217 * @param[out] c A C string (20 chars wide, including NULL character) with the 229 218 * creation date 230 * @return An integer with 0 on success, last errno on failure 231 */ 232 int c_fstat(const char *p, int *pe, int *nl, int *ty, int *ui, int *gi, 219 * @return An integer with 0 on success, last errno on failure 220 */ 221 int c_fstat(const char *p, int *pe, int *nl, int *ty, int *ui, int *gi, 233 222 long *si, char a[20], char m[20], char c[20]); 234 223 … … 238 227 * @param[in] perm An integer with the user's permission to check : 239 228 * - 0 do not check for permissions 240 * - 1 check for execute permission 229 * - 1 check for execute permission 241 230 * - 2 check for write permission 242 231 * - 4 check for read permission … … 259 248 * @param[out] rows Number of rows of the current terminal window 260 249 * @param[out] cols Number of columns of the current terminal window 261 * @return An int with 0 on success, errno on failure. On failure, rows is set 250 * @return An int with 0 on success, errno on failure. On failure, rows is set 262 251 * to 80 and cols to 20. 263 252 */
Note: See TracChangeset
for help on using the changeset viewer.