Libsolv documentation

I wish to create tool similar to cnf(command-not-found), but instead of writing it for users, I’m writing it for scripts.

Script only call tool-needed(my shell script), which invoke “which” program for each parameter and if result is different than 0, then add program name to array. When all arguments are processed, my script pass the array to my program in C. The script is completed, I only must wrote program in C.

The program will asks user to install missing programs, but will be written in libgreattao. Libgreattao allows program to works with Gtk+ backend, Qt backend, console backend and in network or shell mode, so I will create universal dialog to ask user to install missing software.

If I had done, then shell scripts could look like that:


#!/bin/bash

tool-needed zcat tar
if  $? -eq 1 ]; then
   # User don't agree to install one of missing component or some components are not available in repos 
  exit 1
fi
zcat READTME.gz
tar -xf ./some_program

So, where Can I find libsolv documentation? Can libsolv help me to create tool-needed component?

I must tell that my program will be release under GNU/GPLv3.

Ok. I have found thiis program:
https://github.com/openSUSE/libsolv/blob/master/examples/solv.c

It’s under BSD license, so I can change the license and don’t link to authors/this program. Is that true?

Sorry for replying too often, but I don’t understand one line. Why we get next line if first three character aren’t ‘deb’? This is the line:
if (strncmp(kp, “deb”, 3) != 0) continue;

Ok. I’m so stupid, I was not realize this is code for debian.

Ok. I find that libsolver is rather libzypp component and I can’t use it to search for programs.

Perror prints bad parameter:


Pool *pool;
Dataiterator namesiterator;
  
pool = pool_create();
//dataiterator_init(&namesiterator, pool, NULL, SOLVID_META, SUSETAGS_FILE_NAME, 0, 0);
dataiterator_init(&namesiterator, pool, NULL, 0, 0, "shell", SEARCH_SUBSTRING);
perror("");

I don’t understand how to load repodata. I look at solv.c code and don’t see it.