Skip to content

Commit

Permalink
vCard: reorganize #includes
Browse files Browse the repository at this point in the history
  • Loading branch information
ksmurchison committed Jan 4, 2024
1 parent b15159f commit e6ce46a
Show file tree
Hide file tree
Showing 17 changed files with 52 additions and 39 deletions.
4 changes: 2 additions & 2 deletions src/libicalvcard/vcardcomponent.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
#include <config.h>
#endif

#include "icalerror.h"
#include "icalmemory.h"
#include "vcardcomponent.h"
#include "vcardparser.h"
#include "vcardproperty_p.h"
#include "vcardrestriction.h"
#include "icalerror.h"
#include "icalmemory.h"

#include <assert.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion src/libicalvcard/vcardderivedproperty.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#ifndef VCARDDERIVEDPROPERTY_H
#define VCARDDERIVEDPROPERTY_H

#include "vcardparameter.h"
#include "vcardderivedvalue.h"
#include "vcardparameter.h"

typedef struct vcardproperty_impl vcardproperty;

Expand Down
1 change: 0 additions & 1 deletion src/libicalvcard/vcardderivedvalue.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#define VCARDDERIVEDVALUE_H

#include "libical_vcard_export.h"

#include "vcardstrarray.h"
#include "vcardstructured.h"
#include "vcardtime.h"
Expand Down
8 changes: 6 additions & 2 deletions src/libicalvcard/vcardenumarray.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#include <string.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "icalmemory.h"
#include "vcardenumarray.h"
#include "icalmemory.h"

#include <string.h>

ssize_t vcardenumarray_find(vcardenumarray *array,
vcardenumarray_element *needle)
Expand Down
5 changes: 2 additions & 3 deletions src/libicalvcard/vcardenumarray.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#ifndef VCARDENUMARRAY_H
#define VCARDENUMARRAY_H

#include <stdlib.h>

#include "libical_vcard_export.h"

#include "icalarray.h"

#include <stdlib.h>

typedef icalarray vcardenumarray;

typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion src/libicalvcard/vcardparameterimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#ifndef VCARDPARAMETERIMPL_H
#define VCARDPARAMETERIMPL_H

#include "icalarray.h"
#include "vcardproperty.h"
#include "vcardderivedvalue.h"
#include "icalarray.h"

struct vcardparameter_impl
{
Expand Down
18 changes: 11 additions & 7 deletions src/libicalvcard/vcardparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@
* Based mostly on work by Bron Gondwana <[email protected]>
*/

#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "icalmemory.h"
#include "vcardcomponent.h"
#include "vcardparser.h"
#include "vcardcomponent.h"
#include "vcardparameter.h"
#include "vcardproperty.h"
#include "vcardvalue.h"
#include "icalmemory.h"

#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>

#define DEBUG 0

Expand Down
1 change: 0 additions & 1 deletion src/libicalvcard/vcardparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define VCARDPARSER_H

#include "libical_vcard_export.h"

#include "vcardcomponent.h"

LIBICAL_VCARD_EXPORT vcardcomponent *vcardparser_parse_string(const char *str);
Expand Down
8 changes: 4 additions & 4 deletions src/libicalvcard/vcardproperty.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
#include <config.h>
#endif

#include "icalerror.h"
#include "icalmemory.h"
#include "vcardparser.h"
#include "vcardcomponent.h"
#include "vcardproperty_p.h"
#include "vcardcomponent.h"
#include "vcardparser.h"
#include "vcardvalue.h"
#include "icalerror.h"
#include "icalmemory.h"
#include "pvl.h"

#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion src/libicalvcard/vcardproperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define VCARDPROPERTY_H

#include "libical_vcard_export.h"
#include "vcardderivedproperty.h" /* To get vcardproperty_kind enumerations */
#include "vcardderivedproperty.h" /* To get vcardproperty_kind enumerations */

#include <stdarg.h> /* for va_... */

Expand Down
8 changes: 6 additions & 2 deletions src/libicalvcard/vcardstrarray.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#include <string.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "icalmemory.h"
#include "vcardstrarray.h"
#include "icalmemory.h"

#include <string.h>

ssize_t vcardstrarray_find(vcardstrarray *array,
const char *needle)
Expand Down
5 changes: 2 additions & 3 deletions src/libicalvcard/vcardstrarray.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#ifndef VCARDSTRARRAY_H
#define VCARDSTRARRAY_H

#include <stdlib.h>

#include "libical_vcard_export.h"

#include "icalarray.h"

#include <stdlib.h>

typedef icalarray vcardstrarray;

#define vcardstrarray_new(increment_size) \
Expand Down
12 changes: 8 additions & 4 deletions src/libicalvcard/vcardstructured.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "vcardstructured.h"
#include "icalerror.h"
#include "icalmemory.h"
#include "vcardstructured.h"

#include <ctype.h>
#include <stdlib.h>
#include <string.h>

vcardstructuredtype *vcardstructured_new(void)
{
Expand Down
1 change: 0 additions & 1 deletion src/libicalvcard/vcardstructured.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define VCARDSTRUCTURED_H

#include "libical_vcard_export.h"

#include "vcardstrarray.h"

#define VCARD_MAX_STRUCTURED_FIELDS 20 // Extended ADR currently uses 18
Expand Down
10 changes: 7 additions & 3 deletions src/libicalvcard/vcardtime.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "vcardtime.h"
#include "icalmemory.h"

#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include "icalmemory.h"
#include "vcardtime.h"

vcardtimetype vcardtime_null_datetime(void)
{
vcardtimetype t = { -1, -1, -1, -1, -1, -1, -1 };
Expand Down
2 changes: 0 additions & 2 deletions src/libicalvcard/vcardtypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
typedef struct vcardgeotype {
const char *uri;
struct {
// double lat;
// double lon;
const char *lat;
const char *lon;
} coords;
Expand Down
2 changes: 1 addition & 1 deletion src/libicalvcard/vcardvalueimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#ifndef VCARDVALUEIMPL_H
#define VCARDVALUEIMPL_H

#include "vcardproperty.h"
#include "vcardderivedvalue.h"
#include "vcardproperty.h"
#include "vcardtime.h"

struct vcardvalue_impl
Expand Down

0 comments on commit e6ce46a

Please sign in to comment.