aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/tester.c')
-rw-r--r--src/tester.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/tester.c b/src/tester.c
new file mode 100644
index 0000000..02e43df
--- /dev/null
+++ b/src/tester.c
@@ -0,0 +1,51 @@
+#include <stdlib.h>
+#include "interpreter.h"
+
+int main(int argc, char *argv[])
+{
+ argc = argc;
+ argv = argv;
+ int ret = 0;
+ portageInit();
+
+ /*Message *msg = messageCreate("portage", 0, 0, 0);
+ BareConfig *cfg = bareConfigCreate(msg, 0, 0, 0);
+
+ LaymanAPI *l = portageAPICreate(cfg, 0, 0);
+ if (0 == portageAPIFetchRemoteList(l))
+ {
+ printf("Unable to fetch the remote list.\n");
+ ret = -1;
+ }
+
+ StringList *strs = portageAPIGetAvailable(l, 0);
+ printf("list:\n");
+ stringListPrint(strs);
+
+ printf("\n");
+
+ unsigned int len = stringListCount(strs);
+ //OverlayInfo *infos = calloc(len, sizeof(OverlayInfo));
+ //int count = portageAPIGetAllInfos(l, strs, infos);
+
+ OverlayInfo *oi = portageAPIGetAllInfo(l, "kuroo");
+ if (oi)
+ {
+ printf("%s\n~~~~~~~~~~~~~~~~~~~~\n", oi->name);
+ printf("%s\n\n", oi->description);
+ overlayInfoFree(*oi);
+ free(oi);
+ }
+
+ printf("\n");
+
+ //free(infos);
+ stringListFree(strs);
+
+ bareConfigFree(cfg);
+ portageAPIFree(l);*/
+
+ portageFinalize();
+
+ return ret;
+}