1 /********************************************************************* 2 Arithmetic operations on data structures. 3 This is part of GNU Astronomy Utilities (Gnuastro) package. 4 5 Original author: 6 Mohammad Akhlaghi <mohammad@akhlaghi.org> 7 Contributing author(s): 8 Copyright (C) 2021, Free Software Foundation, Inc. 9 10 Gnuastro is free software: you can redistribute it and/or modify it 11 under the terms of the GNU General Public License as published by the 12 Free Software Foundation, either version 3 of the License, or (at your 13 option) any later version. 14 15 Gnuastro is distributed in the hope that it will be useful, but 16 WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 General Public License for more details. 19 20 You should have received a copy of the GNU General Public License 21 along with Gnuastro. If not, see <http://www.gnu.org/licenses/>. 22 **********************************************************************/ 23 #ifndef __ARITHMETIC_SET_H__ 24 #define __ARITHMETIC_SET_H__ 25 26 #define GAL_ARITHMETIC_SET_PREFIX "set-" 27 #define GAL_ARITHMETIC_SET_PREFIX_LENGTH strlen(GAL_ARITHMETIC_SET_PREFIX) 28 29 30 struct gal_arithmetic_set_params 31 { 32 void *tokens; /* Full list of tokens. */ 33 size_t tokencounter; /* Counter of current token. */ 34 gal_data_t *named; /* List of named datasets. */ 35 void *params; /* Internal parameters in caller. */ 36 gal_data_t * (*pop)(void *in_prm); /* Function to use. */ 37 int (*used_later)(void *in_prm, char *name); /* Function to use. */ 38 }; 39 40 void 41 gal_arithmetic_set_name(struct gal_arithmetic_set_params *p, 42 char *token); 43 44 int 45 gal_arithmetic_set_is_name(gal_data_t *named, char *token); 46 47 gal_data_t * 48 gal_arithmetic_set_copy_named(struct gal_arithmetic_set_params *p, 49 char *name); 50 51 #endif 52