The uci_lookup_package() procedure finds the given package among the configurations currently loaded by the uci context while uci_load() loads the given configuration if it is not already loaded yet.
Calling uci_lookup_package() is useful if you need to obtain the package pointer normally returned by uci_load() from a given uci context later in your program flow.
Example:
struct uci_context *c;
c = uci_alloc_context();
uci_load(c, "network", NULL);
uci_load(c, "firewall", NULL);
uci_load(c, "wireless", NULL);
// ...
struct uci_package *p;
p = uci_lookup_package(c, "firewall");
if (!p)
fprintf(stderr, "Package firewall not loaded in context\n");