mastodont-c/include/mastodont_args.h
me@ow.nekobit.net 88dcf586f5 Cleanup, update lists code
FossilOrigin-Name: 1751da6b1b8f80b776083a8ea0bc92c787d09deb049a70faff3b860135be6190
2022-03-15 02:31:19 +00:00

81 lines
2.4 KiB
C

/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef MASTODONT_ARGUMENTS_H
#define MASTODONT_ARGUMENTS_H
#include "mastodont_notif_types.h"
/*
* Originally, when the arguments were being designed for each function,
* I found that many REST operations tended to result similar variable names
* under the same types. To reduce the amount of duplicate code, and to even
* allow argument reusing between multiple functions, all the args are put
* into one struct, this makes it quite a large struct, but any machine will
* handle it fine.
*
* It's ugly, I do not care. The other method caused me to write extreme duplicate
* amounts of code. If it's too memory hungry, reusing this struct in a static/global
* is an option.
*/
struct mstdnt_args
{
char* client_name;
char* redirect_uris;
char* scopes;
char* website;
char* grant_type;
char* client_id;
char* client_secret;
char* redirect_uri;
char* scope;
char* code;
char* username;
char* password;
int pinned;
char* tagged;
int with_muted;
int exclude_reblogs;
int exclude_replies;
int offset;
int only_media;
char* max_id;
char* since_id;
char* min_id;
int limit;
char* content_type;
int expires_in;
char* in_reply_to_conversation_id;
char* in_reply_to_id;
char* language;
char** media_ids;
void* poll; /* TODO */
int preview;
char* scheduled_at;
int sensitive;
char* spoiler_text;
char* status;
char* visibility;
int remote;
int local;
char** exclude_types;
size_t exclude_types_len;
char* account_id;
char** exclude_visibilities;
size_t exclude_visibilities_len;
enum mstdnt_notification_type* include_types;
};
#endif /* MASTODONT_ARGUMENTS_H */