NeoMutt  2024-10-02-37-gfa9146
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
number.h File Reference

Type representing a number. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int number_he_toggle (struct ConfigSubset *sub, struct HashElem *he, struct Buffer *err)
 Toggle the value of a number (value <-> 0)
 

Detailed Description

Type representing a number.

Authors
  • Pietro Cerutti

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file number.h.

Function Documentation

◆ number_he_toggle()

int number_he_toggle ( struct ConfigSubset sub,
struct HashElem he,
struct Buffer err 
)

Toggle the value of a number (value <-> 0)

Parameters
subConfig Subset
heHashElem representing config item
errBuffer for error messages
Return values
numResult, e.g. CSR_SUCCESS

Definition at line 301 of file number.c.

302{
303 if (!sub || !he || !he->data)
304 return CSR_ERR_CODE;
305
306 struct HashElem *he_base = cs_get_base(he);
307 if (DTYPE(he_base->type) != DT_NUMBER)
308 return CSR_ERR_CODE;
309
310 struct ConfigDef *cdef = he_base->data;
311 native_toggle(&cdef->var);
312
314
315 return CSR_SUCCESS;
316}
struct HashElem * cs_get_base(struct HashElem *he)
Find the root Config Item.
Definition: set.c:160
#define CSR_ERR_CODE
Problem with the code.
Definition: set.h:36
#define CSR_SUCCESS
Action completed successfully.
Definition: set.h:35
static void native_toggle(void *var)
Toggle a Number config item.
Definition: number.c:67
Definition: set.h:64
intptr_t var
Storage for the variable.
Definition: set.h:85
The item stored in a Hash Table.
Definition: hash.h:43
int type
Type of data stored in Hash Table, e.g. DT_STRING.
Definition: hash.h:44
void * data
User-supplied data.
Definition: hash.h:46
void cs_subset_notify_observers(const struct ConfigSubset *sub, struct HashElem *he, enum NotifyConfig ev)
Notify all observers of an event.
Definition: subset.c:237
@ NT_CONFIG_SET
Config item has been set.
Definition: subset.h:62
#define DTYPE(t)
Definition: types.h:50
@ DT_NUMBER
a number
Definition: types.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function: