2022-11-05 16:45:03 -04:00
|
|
|
/*
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify it under the terms of the GNU 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 General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
|
|
|
|
|
|
|
|
© 2022 dogeystamp <dogeystamp@disroot.org>
|
|
|
|
*/
|
|
|
|
|
2022-10-27 21:17:24 -04:00
|
|
|
enum feedFormat {
|
|
|
|
NONE,
|
|
|
|
RSS,
|
|
|
|
ATOM,
|
|
|
|
};
|
|
|
|
|
2022-10-29 17:48:36 -04:00
|
|
|
enum fields {
|
|
|
|
FIELD_TITLE,
|
|
|
|
FIELD_LINK,
|
|
|
|
FIELD_DESCRIPTION,
|
|
|
|
FIELD_ENCLOSURE_URL,
|
2023-03-22 20:14:27 -04:00
|
|
|
FIELD_ENCLOSURE_TYPE,
|
2022-10-29 17:48:36 -04:00
|
|
|
|
|
|
|
FIELD_END
|
|
|
|
};
|
|
|
|
enum numFields {
|
2022-10-29 20:17:39 -04:00
|
|
|
// currently unimplemented
|
2022-10-29 17:48:36 -04:00
|
|
|
NUM_ENCLOSURE_SIZE,
|
|
|
|
|
|
|
|
NUM_END
|
|
|
|
};
|
2022-10-27 21:17:24 -04:00
|
|
|
typedef struct itemStruct itemStruct;
|
|
|
|
struct itemStruct {
|
2022-10-29 17:48:36 -04:00
|
|
|
char *fields[FIELD_END];
|
|
|
|
int numFields[NUM_END];
|
2022-10-27 21:17:24 -04:00
|
|
|
itemStruct *next;
|
|
|
|
};
|
|
|
|
|
2022-10-29 17:48:36 -04:00
|
|
|
void copyField(itemStruct *item, enum fields field, char *str);
|
|
|
|
|
2022-10-27 21:17:24 -04:00
|
|
|
void freeItem(itemStruct *item);
|
|
|
|
void itemAction(itemStruct *item, const char *folder);
|
|
|
|
void finish(char *url, long responseCode);
|
2022-10-29 17:48:36 -04:00
|
|
|
|
|
|
|
int rssEnclosure(itemStruct *item, xmlNodePtr node);
|
|
|
|
|
|
|
|
int atomLink(itemStruct *item, xmlNodePtr node);
|