AUTRESIZEBLOCK(3)

πŸ“¦ version 5.1.1, in fedora 43, fedora 44

✨ AUTRESIZEBLOCK(3) ✨ β€” it's an AUT FUNCTIONS girlie, and she resizes memory blocks πŸ’…

okay bestie, sit down, hydrate, because we're about to talk about autresizeblock β€” and no, it's not the name of a new dance, it's a memory block glow-up. πŸ¦‹


🌸 NAME 🌸

autresizeblock β€” resizes a memory block. that's it. that's the whole job. iconic, honestly. πŸ’–


🌈 ORIGIN 🌈

so this software belongs to the ALLIANCE CAD SYSTEM, which was developed by the ASIM team at the LIP6 laboratory of UniversitΓ© Pierre et Marie CURIE, in Paris, France. πŸ‡«πŸ‡· oui oui, trΓ¨s slay.


✨ SYNOPSIS ✨

#include "aut101.h"
  char βˆ—autresize( Source, OldSize, NewSize )
   char         βˆ—Source;
   unsigned int OldSize;
   unsigned int NewSize;

like, look at her. so retro. so C. πŸŽ€


🫢 PARAMETERS 🫢

  • Source β€” pointer to the memory block that's about to be resized. she's the main character here.
  • OldSize β€” the old size of the memory block. the before. the pre-glow-up era.
  • NewSize β€” the new size of the memory block. the after. the transformation. ✨

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea β˜•: autresizeblock resizes a memory block from OldSize to NewSize. and the way that it's lowkey generous β€” if NewSize is greater than OldSize, then the new bytes are set to zero. no random leftover garbage bytes, no mystery data haunting your buffer. she zeroes it. she's clean. she's thoughtful. we love her. πŸ’…


πŸ‘‘ RETURN VALUE πŸ‘‘

autresizeblock returns the pointer to the resized block. so like, catch it, don't drop it. 🫴


πŸ’€ ERRORS πŸ’€

if you see this, bestie, it's over:

"autresize: resize error, can't continue !"

what happened? the system break can't be moved anymore, which means no more memory can be retrieved from the system. she tried. the system said no. periodt. 😭


🧚 EXAMPLE 🧚

here's the moment you've all been waiting for β€” actual code, and it's a whole concatstring:

#include "aut101.h"
     char βˆ—concatstring( t, s )
        char βˆ— t;
        char βˆ— s;
     {
        t = (char βˆ—)autresizeblock( t, strlen(t)+1, strlen(t)+strlen(s)+1);
        strcat(t, s);
        return t;
     }

not her resizing, then strcatting, then handing it back like a gift. ate. πŸ”₯


🌟 SEE ALSO 🌟

go read these next, they're the friend group:


πŸ“ BUG REPORT πŸ“

this tool is under development at the ASIM department of the LIP6 laboratory. and they need your feedback to improve documentation and tools. so like, if something's weird, tell them! it's giving community. it's giving collaboration. iykyk. πŸ™ˆ


ASIM/LIP6 β€” October 1, 1997 β€” and that's the AUTRESIZEBLOCK(3) page, bestie. go resize something responsibly. mwah. πŸ’‹πŸ’–