GD_SIZE(3)
π GD_SIZE(3) π
ok so bestie, this is a page from the GETDATA manual β and today's main character is GD_SIZE. it's a tiny little macro with one job and honestly? she ate. β¨
β¨ NAME β¨
GD_SIZE β report the size of a GetData data sample π
πΈ SYNOPSIS πΈ
#include <getdata.h>
int GD_SIZE(gd_type_t type);
like, that's it. one include, one macro, one argument. no notes. π
π¦ DESCRIPTION π¦
okay so the GD_SIZE() preprocessor macro returns the size in bytes of a single sample of data of the type you hand it via type. and type should be one of these iconic little symbols:
GD_NULLGD_UINT8GD_INT8GD_UINT16GD_INT16GD_UINT32GD_INT32GD_FLOAT32GD_FLOAT64GD_COMPLEX64GD_COMPLEX128GD_STRINGGD_UNKNOWN
so here's the tea on what you get back:
- pass
GD_NULLorGD_UNKNOWNand you get zero. literally nothing. zero bytes. it's giving void. π³οΈ - pass
GD_STRINGand you getsizeof(const char*). yes bestie, the size of the pointer, not the string. she's a pointer girlie. π - for all the other types, the value returned is just the bit-size encoded in the type symbol divided by eight. so like,
GD_SIZE(GD_COMPLEX64)will return8. math queen fr fr. π
β οΈ no cap, no error checking happens on type. so if you pass literally anything that isn't one of the symbols listed above, the behaviour is unspecified. do not do that. i'm begging. π
and if you wanna know what all those symbols even mean, go read gd_getdata(3). iykyk. π
π HISTORY π
the GD_SIZE() macro appeared in GetData-0.3.0 β a true vintage icon, she's been serving since day one. π«Ά
β SEE ALSO β
and that's the whole page, bestie!! this was Version 0.10.0, dated 25 December 2016 β happy holidays from the GetData girlies, mwah ππβ¨π¦πΈ
π¦ where this page comes from
- debian bookworm: libgetdata-doc 0.11.0-6
- debian trixie: libgetdata-doc 0.11.0-15
- fedora 43: getdata-devel 0.11.0-13.fc43 Β· GPL-2.0-or-later
- fedora 43: getdata-devel 0.11.0-13.fc43 Β· GPL-2.0-or-later
- fedora 44: getdata-devel 0.11.0-14.fc44 Β· GPL-2.0-or-later
- fedora 44: getdata-devel 0.11.0-14.fc44 Β· GPL-2.0-or-later
- nixos 26.05: getdata 0.11.0
- nixpkgs unstable: getdata 0.11.0
- ubuntu jammy: libgetdata-doc 0.11.0-3ubuntu1
- ubuntu noble: libgetdata-doc 0.11.0-13
- ubuntu questing: libgetdata-doc 0.11.0-15
- ubuntu resolute: libgetdata-doc 0.11.0-17build1
- ubuntu stonking: libgetdata-doc 0.11.0-17build2
- Copyright (C) 2016 D. V. Wiebe
- Copyright (C) 2013, 2016 D. V. Wiebe
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms