X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fplist.c;h=b749f73de45b1454b3d0c1dc6d9a11b68b2ba24f;hp=048305ac8514e7cc2995cdf52a4b28f84cb12d26;hb=f76cbab7698c988217d56a96f3ef68005cddd5ec;hpb=d4bd55e7d9b1cf63cd6fdc96b70010a0c2aca963 diff --git a/src/plist.c b/src/plist.c index 048305a..b749f73 100644 --- a/src/plist.c +++ b/src/plist.c @@ -148,6 +148,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) {