assign(3)
assign(3) β from the Library Functions Manual π
okay bestie, welcome to the assign(3) page, and no cap, this one is a tiny little macro with main character energy. It's giving "assign an integer value, check for truncation" and honestly? iconic.
β¨ NAME β¨
assign β assign an integer value, check for truncation π
π SYNTAX π
#include <libowfat/rangecheck.h>
int assign(dest,a);
That's the whole synopsis, bestie. The include is libowfat/rangecheck.h, and the call looks like int assign(dest,a);. Keep it exact, no edits. π
π DESCRIPTION π
Okay so here's the tea. If a and dest have the same type, OR if the value of a is representable in the type of dest, then you do dest=a and it returns 0. Slay. That's the success path. β¨
Otherwise, it returns 1. That's the "nope, not happening" path. π
Note: This is a macro, so dest does not have to be a pointer. Don't come for me, that's literally what the page says. π
π BUGS π
Not a bug exactly, but a little chaos you need to know: in the multiplication functions, a return value of 1 signals success and 0 means failure. But in add_of, sub_of and assign, it's the other way around. So 0 is success and 1 is failure. Yes, it's giving inconsistent, and yes, you're valid for being confused. π
π SEE ALSO π
signed off from the Library Functions Manual, page assign(3) β the footer doesn't give a version or date, just the page name, so this is the whole vibe ππ periodt
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- debian bookworm: libowfat-dev 0.32-4 Β· GPL-2.0-only
- debian trixie: libowfat-dev 0.32-5 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu noble: libowfat-dev 0.32-4.1build1 Β· GPL-2.0-only
- ubuntu questing: libowfat-dev 0.32-5
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms