+/*
+ * 'archive_url': LP URL of the archive.
+ * 'size': size of the reply array. Between 1-300, else default value is used.
+ */
+static char *create_query_get_bpph(const char *archive_url,
+ const char *status,
+ int size)
+{
+ static const char *default_opt = "?ws.op=getPublishedBinaries&ws.size=";
+ static const char *status_opt = "&status=";
+ char *url;
+ size_t n;
+
+ if (size < 1 || size > 300)
+ size = DEFAULT_WS_SIZE;
+
+ n = strlen(archive_url) + strlen(default_opt) + 3 + 1;
+
+ if (status)
+ n += strlen(status_opt) + strlen(status);
+
+ url = malloc(n);
+ sprintf(url, "%s%s%d", archive_url, default_opt, size);
+
+ if (status) {
+ strcat(url, status_opt);
+ strcat(url, status);
+ }
+
+ return url;
+}
+
+struct bpph **get_bpph_list(const char *archive_url,
+ const char *pkg_status,
+ int ws_size)