%% /llsrv public
do-once
new-list t process-scope
end-do-once
get-param op
get-param key
get-param data
if-true op equal "add"
write-list t key (key) value data append
@Added [<<p-out key>>] value [<<p-out data>>]
else-if op equal "delete"
position-list t first
read-list t key (key) value val status st
if-true st equal GG_ERR_EXIST
@Not found
else-if
@Deleted key [<<p-out key>>], [<<p-out val>>]
delete-list t
end-if
else-if op equal "next"
position-list t next status st
if-true st equal GG_OKAY
@Okay
else-if
@Not found
end-if
else-if op equal "last"
position-list t last status st
if-true st equal GG_OKAY
@Okay
else-if
@Not found
end-if
else-if op equal "previous"
position-list t previous status st
if-true st equal GG_OKAY
@Okay
else-if
@Not found
end-if
else-if op equal "first"
position-list t first status st
if-true st equal GG_OKAY
@Okay
else-if
@Not found
end-if
else-if op equal "query"
read-list t key (key) value val status st
if-true st equal GG_ERR_EXIST
@Not found
else-if
@Key [<<p-out key>>], value [<<p-out val>>]
end-if
else-if op equal "purge"
purge-list t
end-if
%%
Copied!