1818#include "logger/logger.h"
1919#include "parson/parson.h"
2020#include "registry-manager.h"
21- #include "registry/wiki- registry.h"
21+ #include "registry/registry.h"
2222#include "strdup/strdup.h"
2323#include "tempdir/tempdir.h"
2424#include "version.h"
@@ -64,7 +64,7 @@ static void setopt_json(command_t *self) { opt_json = 1; }
6464 } \
6565 }
6666
67- static int matches (int count , char * args [], wiki_package_ptr_t pkg ) {
67+ static int matches (int count , char * args [], registry_package_ptr_t pkg ) {
6868 // Display all packages if there's no query
6969 if (0 == count )
7070 return 1 ;
@@ -75,16 +75,16 @@ static int matches(int count, char *args[], wiki_package_ptr_t pkg) {
7575 char * href = NULL ;
7676 int rc = 0 ;
7777
78- name = clib_package_parse_name (wiki_package_get_id (pkg ));
78+ name = clib_package_parse_name (registry_package_get_id (pkg ));
7979 COMPARE (name );
8080
81- description = strdup (wiki_package_get_description (pkg ));
81+ description = strdup (registry_package_get_description (pkg ));
8282 COMPARE (description );
8383
84- repo = strdup (wiki_package_get_id (pkg ));
84+ repo = strdup (registry_package_get_id (pkg ));
8585 COMPARE (repo );
8686
87- href = strdup (wiki_package_get_href (pkg ));
87+ href = strdup (registry_package_get_href (pkg ));
8888 COMPARE (href );
8989
9090 cleanup :
@@ -123,26 +123,26 @@ static char *wiki_html_cache() {
123123}
124124*/
125125
126- static void display_package (const wiki_package_ptr_t pkg ,
126+ static void display_package (const registry_package_ptr_t pkg ,
127127 cc_color_t fg_color_highlight ,
128128 cc_color_t fg_color_text ) {
129- cc_fprintf (fg_color_highlight , stdout , " %s\n" , wiki_package_get_id (pkg ));
129+ cc_fprintf (fg_color_highlight , stdout , " %s\n" , registry_package_get_id (pkg ));
130130 printf (" url: " );
131- cc_fprintf (fg_color_text , stdout , "%s\n" , wiki_package_get_href (pkg ));
131+ cc_fprintf (fg_color_text , stdout , "%s\n" , registry_package_get_href (pkg ));
132132 printf (" desc: " );
133- cc_fprintf (fg_color_text , stdout , "%s\n" , wiki_package_get_description (pkg ));
133+ cc_fprintf (fg_color_text , stdout , "%s\n" , registry_package_get_description (pkg ));
134134 printf ("\n" );
135135}
136136
137- static void add_package_to_json (const wiki_package_ptr_t pkg ,
137+ static void add_package_to_json (const registry_package_ptr_t pkg ,
138138 JSON_Array * json_list ) {
139139 JSON_Value * json_pkg_root = json_value_init_object ();
140140 JSON_Object * json_pkg = json_value_get_object (json_pkg_root );
141141
142- json_object_set_string (json_pkg , "repo" , wiki_package_get_id (pkg ));
143- json_object_set_string (json_pkg , "href" , wiki_package_get_href (pkg ));
144- json_object_set_string (json_pkg , "description" , wiki_package_get_description (pkg ));
145- json_object_set_string (json_pkg , "category" , wiki_package_get_category (pkg ));
142+ json_object_set_string (json_pkg , "repo" , registry_package_get_id (pkg ));
143+ json_object_set_string (json_pkg , "href" , registry_package_get_href (pkg ));
144+ json_object_set_string (json_pkg , "description" , registry_package_get_description (pkg ));
145+ json_object_set_string (json_pkg , "category" , registry_package_get_category (pkg ));
146146
147147 json_array_append_value (json_list , json_pkg_root );
148148}
@@ -199,11 +199,11 @@ int main(int argc, char *argv[]) {
199199 */
200200
201201 registry_iterator_t it = registry_iterator_new (registries );
202- wiki_registry_ptr_t registry = NULL ;
202+ registry_ptr_t registry = NULL ;
203203 while ((registry = registry_iterator_next (it ))) {
204- printf ("SEARCH: packages from %s\n" , wiki_registry_get_url (registry ));
205- wiki_package_ptr_t pkg ;
206- wiki_registry_iterator_t it = wiki_registry_iterator_new (registry );
204+ printf ("SEARCH: packages from %s\n" , registry_get_url (registry ));
205+ registry_package_ptr_t pkg ;
206+ registry_package_iterator_t it = registry_package_iterator_new (registry );
207207
208208 JSON_Array * json_list = NULL ;
209209 JSON_Value * json_list_root = NULL ;
@@ -215,15 +215,15 @@ int main(int argc, char *argv[]) {
215215
216216 printf ("\n" );
217217
218- while ((pkg = wiki_registry_iterator_next (it ))) {
218+ while ((pkg = registry_package_iterator_next (it ))) {
219219 if (matches (program .argc , program .argv , pkg )) {
220220 if (opt_json ) {
221221 add_package_to_json (pkg , json_list );
222222 } else {
223223 display_package (pkg , fg_color_highlight , fg_color_text );
224224 }
225225 } else {
226- debug (& debugger , "skipped package %s" , wiki_package_get_id (pkg ));
226+ debug (& debugger , "skipped package %s" , registry_package_get_id (pkg ));
227227 }
228228 }
229229
@@ -235,7 +235,7 @@ int main(int argc, char *argv[]) {
235235 json_value_free (json_list_root );
236236 }
237237
238- wiki_registry_iterator_destroy (it );
238+ registry_package_iterator_destroy (it );
239239 }
240240 command_free (& program );
241241 return 0 ;
0 commit comments