1717#include "logger/logger.h"
1818#include "parson/parson.h"
1919#include "registry-manager.h"
20- #include "registry/wiki- registry.h"
20+ #include "registry/registry.h"
2121#include "strdup/strdup.h"
2222#include "tempdir/tempdir.h"
2323#include "version.h"
@@ -63,7 +63,7 @@ static void setopt_json(command_t *self) { opt_json = 1; }
6363 } \
6464 }
6565
66- static int matches (int count , char * args [], wiki_package_ptr_t pkg ) {
66+ static int matches (int count , char * args [], registry_package_ptr_t pkg ) {
6767 // Display all packages if there's no query
6868 if (0 == count )
6969 return 1 ;
@@ -74,16 +74,16 @@ static int matches(int count, char *args[], wiki_package_ptr_t pkg) {
7474 char * href = NULL ;
7575 int rc = 0 ;
7676
77- name = clib_package_parse_name (wiki_package_get_id (pkg ));
77+ name = clib_package_parse_name (registry_package_get_id (pkg ));
7878 COMPARE (name );
7979
80- description = strdup (wiki_package_get_description (pkg ));
80+ description = strdup (registry_package_get_description (pkg ));
8181 COMPARE (description );
8282
83- repo = strdup (wiki_package_get_id (pkg ));
83+ repo = strdup (registry_package_get_id (pkg ));
8484 COMPARE (repo );
8585
86- href = strdup (wiki_package_get_href (pkg ));
86+ href = strdup (registry_package_get_href (pkg ));
8787 COMPARE (href );
8888
8989 cleanup :
@@ -122,26 +122,26 @@ static char *wiki_html_cache() {
122122}
123123*/
124124
125- static void display_package (const wiki_package_ptr_t pkg ,
125+ static void display_package (const registry_package_ptr_t pkg ,
126126 cc_color_t fg_color_highlight ,
127127 cc_color_t fg_color_text ) {
128- cc_fprintf (fg_color_highlight , stdout , " %s\n" , wiki_package_get_id (pkg ));
128+ cc_fprintf (fg_color_highlight , stdout , " %s\n" , registry_package_get_id (pkg ));
129129 printf (" url: " );
130- cc_fprintf (fg_color_text , stdout , "%s\n" , wiki_package_get_href (pkg ));
130+ cc_fprintf (fg_color_text , stdout , "%s\n" , registry_package_get_href (pkg ));
131131 printf (" desc: " );
132- cc_fprintf (fg_color_text , stdout , "%s\n" , wiki_package_get_description (pkg ));
132+ cc_fprintf (fg_color_text , stdout , "%s\n" , registry_package_get_description (pkg ));
133133 printf ("\n" );
134134}
135135
136- static void add_package_to_json (const wiki_package_ptr_t pkg ,
136+ static void add_package_to_json (const registry_package_ptr_t pkg ,
137137 JSON_Array * json_list ) {
138138 JSON_Value * json_pkg_root = json_value_init_object ();
139139 JSON_Object * json_pkg = json_value_get_object (json_pkg_root );
140140
141- json_object_set_string (json_pkg , "repo" , wiki_package_get_id (pkg ));
142- json_object_set_string (json_pkg , "href" , wiki_package_get_href (pkg ));
143- json_object_set_string (json_pkg , "description" , wiki_package_get_description (pkg ));
144- json_object_set_string (json_pkg , "category" , wiki_package_get_category (pkg ));
141+ json_object_set_string (json_pkg , "repo" , registry_package_get_id (pkg ));
142+ json_object_set_string (json_pkg , "href" , registry_package_get_href (pkg ));
143+ json_object_set_string (json_pkg , "description" , registry_package_get_description (pkg ));
144+ json_object_set_string (json_pkg , "category" , registry_package_get_category (pkg ));
145145
146146 json_array_append_value (json_list , json_pkg_root );
147147}
@@ -198,11 +198,11 @@ int main(int argc, char *argv[]) {
198198 */
199199
200200 registry_iterator_t it = registry_iterator_new (registries );
201- wiki_registry_ptr_t registry = NULL ;
201+ registry_ptr_t registry = NULL ;
202202 while ((registry = registry_iterator_next (it ))) {
203- printf ("SEARCH: packages from %s\n" , wiki_registry_get_url (registry ));
204- wiki_package_ptr_t pkg ;
205- wiki_registry_iterator_t it = wiki_registry_iterator_new (registry );
203+ printf ("SEARCH: packages from %s\n" , registry_get_url (registry ));
204+ registry_package_ptr_t pkg ;
205+ registry_package_iterator_t it = registry_package_iterator_new (registry );
206206
207207 JSON_Array * json_list = NULL ;
208208 JSON_Value * json_list_root = NULL ;
@@ -214,15 +214,15 @@ int main(int argc, char *argv[]) {
214214
215215 printf ("\n" );
216216
217- while ((pkg = wiki_registry_iterator_next (it ))) {
217+ while ((pkg = registry_package_iterator_next (it ))) {
218218 if (matches (program .argc , program .argv , pkg )) {
219219 if (opt_json ) {
220220 add_package_to_json (pkg , json_list );
221221 } else {
222222 display_package (pkg , fg_color_highlight , fg_color_text );
223223 }
224224 } else {
225- debug (& debugger , "skipped package %s" , wiki_package_get_id (pkg ));
225+ debug (& debugger , "skipped package %s" , registry_package_get_id (pkg ));
226226 }
227227 }
228228
@@ -234,7 +234,7 @@ int main(int argc, char *argv[]) {
234234 json_value_free (json_list_root );
235235 }
236236
237- wiki_registry_iterator_destroy (it );
237+ registry_package_iterator_destroy (it );
238238 }
239239 command_free (& program );
240240 return 0 ;
0 commit comments