Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
Loading...
Searching...
No Matches
icalstrarray.h
Go to the documentation of this file.
1/*======================================================================
2 FILE: icalstrarray.h
3 CREATOR: Ken Murchison 24 Aug 2022
4
5 SPDX-FileCopyrightText: 2022, Fastmail Pty. Ltd. (https://fastmail.com)
6 SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
7 ======================================================================*/
8
13
14#ifndef ICALSTRARRAY_H
15#define ICALSTRARRAY_H
16
17#include "libical_ical_export.h"
18#include "icalarray.h"
19
20#include <stdlib.h>
21
23/* An icalstrarray is just an icalarray in disguise. */
24typedef icalarray icalstrarray;
26
47#define icalstrarray_new(increment_size) \
48 (icalarray_new(sizeof(char *), increment_size))
49
69LIBICAL_ICAL_EXPORT const char *icalstrarray_element_at(icalstrarray *array, size_t position);
70
83LIBICAL_ICAL_EXPORT size_t icalstrarray_size(const icalstrarray *array);
84
102LIBICAL_ICAL_EXPORT size_t icalstrarray_find(icalstrarray *array,
103 const char *needle);
104
119LIBICAL_ICAL_EXPORT void icalstrarray_append(icalstrarray *array,
120 const char *elem);
121
135LIBICAL_ICAL_EXPORT void icalstrarray_add(icalstrarray *array,
136 const char *elem);
137
151LIBICAL_ICAL_EXPORT void icalstrarray_remove_element_at(icalstrarray *array,
152 size_t position);
153
166LIBICAL_ICAL_EXPORT void icalstrarray_remove(icalstrarray *array,
167 const char *del);
168
180LIBICAL_ICAL_EXPORT void icalstrarray_free(icalstrarray *array);
181
194LIBICAL_ICAL_EXPORT void icalstrarray_sort(icalstrarray *array);
195
209LIBICAL_ICAL_EXPORT icalstrarray *icalstrarray_clone(icalstrarray *array);
210
211#endif /* ICALSTRARRAY_H */
An array of arbitrarily-sized elements which grows dynamically as elements are added.
const char * icalstrarray_element_at(icalstrarray *array, size_t position)
Accesses a string stored in the array.
size_t icalstrarray_find(icalstrarray *array, const char *needle)
Finds a string in the array.
void icalstrarray_remove(icalstrarray *array, const char *del)
Removes all occurrences of a string.
void icalstrarray_append(icalstrarray *array, const char *elem)
Appends a string to the array.
void icalstrarray_remove_element_at(icalstrarray *array, size_t position)
Removes the string at an array position.
icalstrarray * icalstrarray_clone(icalstrarray *array)
Clones the array and all its elements.
void icalstrarray_add(icalstrarray *array, const char *elem)
Appends a string to the array, omitting duplicates.
void icalstrarray_sort(icalstrarray *array)
Sorts the strings in the array in ascending order.
void icalstrarray_free(icalstrarray *array)
Frees this array's memory and all its elements.
size_t icalstrarray_size(const icalstrarray *array)
Indicates the count of strings stored in the array.