betaur

[WIP] A better AUR helper written in C
git clone git@nonplanar.org:betaur.git
Log | Files | Refs | README

request.h (1116B)


      1 #ifndef __AUR_REQUEST_H
      2 #define __AUR_REQUEST_H
      3 
      4 #include <stddef.h>
      5 #include <stdbool.h>
      6 
      7 /* Metadata fields */
      8 #define BETAUR_SEARCHBY_MAP(X) \
      9 	X(BETAUR_INVALID, invalid) \
     10 	X(BETAUR_NAME, name) \
     11 	X(BETAUR_NAME_DESC, name-desc) \
     12 	X(BETAUR_MAINTAINER, maintainer) \
     13 	X(BETAUR_DEPENDS, depends) \
     14 	X(BETAUR_MAKEDEPENDS, makedepends) \
     15 	X(BETAUR_OPTDEPENDS, optdepends) \
     16 	X(BETAUR_CHECKDEPENDS, checkdepends) \
     17 	X(BETAUR_SUBMITTER, submitter) \
     18 	X(BETAUR_PROVIDES, provides) \
     19 	X(BETAUR_CONFLICTS, conflicts) \
     20 	X(BETAUR_REPLACES, replaces) \
     21 	X(BETAUR_KEYWORDS, keywords) \
     22 	X(BETAUR_GROUPS, groups) \
     23 	X(BETAUR_COMAINTAINERS, comaintainers)
     24 
     25 typedef enum {
     26 #define X(ENUM, STR) ENUM,
     27 BETAUR_SEARCHBY_MAP(X)
     28 #undef X
     29 } betaur_searchby_t;
     30 
     31 /* clone */
     32 char* betaur_clone_request_str(size_t baseurl_len, char* baseurl) {
     33 	char* clone_str = (char *) malloc(baseurl_len + clone_url_len + 1);
     34 	strcat(baseurl, reporname);
     35 }
     36 
     37 /* info */
     38 
     39 /* search */
     40 bool betaur_http_search(betaur_searchby_t by, size_t arg_len, char* arg);
     41 betaur_searchby_t betaur_str_to_searchby(size_t searchby_len, const char* searchby);
     42 
     43 #endif