src/ucx/stack.h

changeset 135
471e28cca288
parent 99
b9a6af0ae41a
equal deleted inserted replaced
134:44415e4399ce 135:471e28cca288
1 /* 1 /*
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3 * 3 *
4 * Copyright 2015 Olaf Wintermann. All rights reserved. 4 * Copyright 2016 Olaf Wintermann. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met: 7 * modification, are permitted provided that the following conditions are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
37 37
38 #ifndef UCX_STACK_H 38 #ifndef UCX_STACK_H
39 #define UCX_STACK_H 39 #define UCX_STACK_H
40 40
41 #include "ucx.h" 41 #include "ucx.h"
42 #include <stdint.h>
43 #include "allocator.h" 42 #include "allocator.h"
44 43
45 #ifdef __cplusplus 44 #ifdef __cplusplus
46 extern "C" { 45 extern "C" {
47 #endif 46 #endif
177 * @param dest the location where the contents shall be written to, or <code> 176 * @param dest the location where the contents shall be written to, or <code>
178 * NULL</code>, if the element shall only be removed. 177 * NULL</code>, if the element shall only be removed.
179 * @see ucx_stack_free 178 * @see ucx_stack_free
180 * @see ucx_stack_popn 179 * @see ucx_stack_popn
181 */ 180 */
182 #define ucx_stack_pop(stack, dest) ucx_stack_popn(stack, dest, SIZE_MAX) 181 #define ucx_stack_pop(stack, dest) ucx_stack_popn(stack, dest, (size_t)-1)
183 182
184 /** 183 /**
185 * Removes the top most element from the stack and copies the content to <code> 184 * Removes the top most element from the stack and copies the content to <code>
186 * dest</code>. 185 * dest</code>.
187 * 186 *

mercurial