Mercurial > imgup
view image.h @ 4:c534b2b787d0 0.1.0
misc: update before 0.1.0
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 26 Nov 2020 18:43:13 +0100 |
parents | f41e1b48510d |
children | 1cf90affaa33 |
line wrap: on
line source
/* * image.c -- image definition * * Copyright (c) 2020 David Demelier <markand@malikania.fr> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef IMGPASTER_IMAGE_H #define IMGPASTER_IMAGE_H #include <stdbool.h> #include <stddef.h> #include <time.h> #define IMAGE_DURATION_HOUR 3600 /*!< Seconds in one hour. */ #define IMAGE_DURATION_DAY 86400 /*!< Seconds in one day. */ #define IMAGE_DURATION_WEEK 604800 /*!< Seconds in one week. */ #define IMAGE_DURATION_MONTH 2592000 /*!< Rounded to 30 days. */ /** * \brief Paste structure. * * Every string in the paste is assumed to be allocated on the heap. */ struct image { char *id; char *title; char *author; void *data; size_t datasz; char *filename; time_t timestamp; bool visible; long long int duration; }; void image_finish(struct image *); bool image_isvalid(const void *, size_t); #endif /* !IMGPASTER_IMAGE_H */