MCPcopy Create free account
hub / github.com/KaisenAmin/c_std / stack_pop_value

Function stack_pop_value

stack/stack.h:94–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92
93
94static inline bool stack_pop_value(Stack* stk, void* out_buf) {
95 if (!stk || !stk->vec || stk->vec->size == 0) {
96 return false;
97 }
98 stk->vec->size--;
99 if (out_buf) {
100 memcpy(out_buf,
101 (char*)stk->vec->items + stk->vec->size * stk->vec->itemSize,
102 stk->vec->itemSize);
103 }
104 return true;
105}
106
107
108static inline void* stack_pop(Stack* stk) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected