X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fplist.c;h=8b38fe018dd66b5781286643d7f057cb64bd3bf1;hp=048305ac8514e7cc2995cdf52a4b28f84cb12d26;hb=HEAD;hpb=216e7ac3b97aed5a5d65c511dc061c78be90e79d diff --git a/src/plist.c b/src/plist.c index 048305a..8b38fe0 100644 --- a/src/plist.c +++ b/src/plist.c @@ -23,7 +23,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ -#include "php_psi_stdinc.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#else +# include "php_config.h" +#endif #include "plist.h" @@ -148,6 +152,14 @@ bool psi_plist_unset(struct psi_plist *list, size_t index) { return false; } +bool psi_plist_set(struct psi_plist *list, size_t index, void *ptr) { + if (list && list->count > index) { + PLIST_CPY(list, PLIST_ELE(list, index), ptr); + return true; + } + return false; +} + bool psi_plist_del(struct psi_plist *list, size_t index, void *ptr) { if (list && list->count > index) { if (ptr) {