Skip to content

Commit

Permalink
Header housekeeping: remove unneeded extern "C", add modelines, add i…
Browse files Browse the repository at this point in the history
…nclusion guards

hopefully, this doesn't break anything
  • Loading branch information
labath committed Feb 25, 2010
1 parent cb11cf6 commit 54630eb
Show file tree
Hide file tree
Showing 23 changed files with 13 additions and 193 deletions.
8 changes: 0 additions & 8 deletions src/algebra.h
Expand Up @@ -30,10 +30,6 @@
#ifndef _ALGEBRA_H
#define _ALGEBRA_H

#ifdef __cplusplus
extern "C" {
#endif

enum match_type {
OP_LT = 1, /* < */
OP_GT = 2, /* > */
Expand All @@ -53,8 +49,4 @@ enum arg_type {
int compare(const char *);
int check_if_match(struct text_object *);

#ifdef __cplusplus
}
#endif

#endif /* _ALGEBRA_H */
8 changes: 0 additions & 8 deletions src/apcupsd.h
Expand Up @@ -25,10 +25,6 @@
#ifndef APCUPSD_H_
#define APCUPSD_H_

#ifdef __cplusplus
extern "C" {
#endif

int apcupsd_scan_arg(const char *);

/* Service routine for the conky main thread */
Expand All @@ -48,8 +44,4 @@ void print_apcupsd_timeleft(struct text_object *, char *, int);
void print_apcupsd_temp(struct text_object *, char *, int);
void print_apcupsd_lastxfer(struct text_object *, char *, int);

#ifdef __cplusplus
}
#endif

#endif /*APCUPSD_H_*/
8 changes: 0 additions & 8 deletions src/bmpx.h
Expand Up @@ -26,10 +26,6 @@
#ifndef BMPX_H_
#define BMPX_H_

#ifdef __cplusplus
extern "C" {
#endif

void update_bmpx(void);
struct bmpx_s {
char *title;
Expand All @@ -47,8 +43,4 @@ void print_bmpx_uri(struct text_object *, char *, int);
void print_bmpx_track(struct text_object *, char *, int);
void print_bmpx_bitrate(struct text_object *, char *, int);

#ifdef __cplusplus
}
#endif

#endif /*BMPX_H_*/
10 changes: 0 additions & 10 deletions src/colours.cc
Expand Up @@ -71,12 +71,6 @@ static void set_up_gradient(void)
greenmask = greenmask << (colour_depth / 3);
}

#ifdef __cplusplus
extern "C" {
#endif

/* this function is used in C code, use C calling conventions */

/* adjust colour values depending on colour depth */
unsigned int adjust_colours(unsigned int colour)
{
Expand All @@ -96,10 +90,6 @@ unsigned int adjust_colours(unsigned int colour)
return colour;
}

#ifdef __cplusplus
}
#endif

/* this function returns the next colour between two colours for a gradient */
unsigned long *do_gradient(int width, unsigned long first_colour, unsigned long last_colour)
{
Expand Down
10 changes: 0 additions & 10 deletions src/colours.h
Expand Up @@ -30,17 +30,7 @@
#ifndef _COLOURS_H
#define _COLOURS_H

#ifdef __cplusplus
extern "C" {
#endif

/* this function is used in C code, use C calling conventions */
unsigned int adjust_colours(unsigned int);

#ifdef __cplusplus
}
#endif

unsigned long *do_gradient(int, unsigned long, unsigned long);

long get_x11_color(const char *);
Expand Down
8 changes: 0 additions & 8 deletions src/common.h
Expand Up @@ -32,16 +32,8 @@
#include <sys/socket.h>
#include "text_object.h"

#ifdef __cplusplus
extern "C" {
#endif

void print_to_bytes(struct text_object *, char *, int);

#ifdef __cplusplus
}
#endif

void add_update_callback(void (*func)(void));
void free_update_callbacks(void);
void start_update_threading(void);
Expand Down
18 changes: 0 additions & 18 deletions src/conky.h
Expand Up @@ -86,10 +86,6 @@ struct text_object;
#include "mpd.h"
#endif /* BUILD_MPD */

#ifdef __cplusplus
/* this hack exists only to get around a compilation issue with some files
* being converted to C++, will need a better solution */

/* C++ headers */
#ifdef BUILD_CURL
#include "ccurl_thread.h"
Expand All @@ -99,8 +95,6 @@ struct text_object;
#include "audacious.h"
#endif /* BUILD_AUDACIOUS */

#endif /* __cplusplus */

#ifdef BUILD_RSS
#include "rss.h"
#endif /* BUILD_RSS */
Expand Down Expand Up @@ -196,9 +190,6 @@ enum {
BATTERY_TIME
};

#ifdef __cplusplus
/* this hack exists only to get around a compilation issue with some files
* being converted to C++, will need a better solution */
struct information {
unsigned int mask;

Expand Down Expand Up @@ -255,7 +246,6 @@ struct information {

short kflags; /* kernel settings, see enum KFLAG */
};
#endif /* __cplusplus */

/* needed by linux.c and top.c -> outsource somewhere */
enum {
Expand Down Expand Up @@ -289,10 +279,6 @@ extern struct information info;
/* defined in conky.c */
extern double current_update_time, last_update_time, update_interval;

#ifdef __cplusplus
extern "C" {
#endif

/* if_up strictness selector
* needed by conky.c and linux.c (and potentially others) */
enum _ifup_strictness {
Expand Down Expand Up @@ -332,10 +318,6 @@ void generate_text_internal(char *, int, struct text_object);
int percent_print(char *, int, unsigned);
void human_readable(long long, char *, int);

#ifdef __cplusplus
}
#endif

/* maximum size of config TEXT buffer, i.e. below TEXT line. */
extern unsigned int max_user_text;

Expand Down
8 changes: 0 additions & 8 deletions src/core.h
Expand Up @@ -38,18 +38,10 @@ struct text_object *construct_text_object(const char *s, const char *arg, long

size_t remove_comments(char *string);

#ifdef __cplusplus
extern "C" {
#endif

int extract_variable_text_internal(struct text_object *retval, const char *const_p);

void free_text_objects(struct text_object *root);

const char *dev_name(const char *);

#ifdef __cplusplus
}
#endif

#endif /* _CONKY_CORE_H_ */
9 changes: 1 addition & 8 deletions src/eve.h
@@ -1,4 +1,5 @@
/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
* vim: ts=4 sw=4 noet ai cindent syntax=cpp
*
* Conky, a system monitor, based on torsmo
*
Expand All @@ -24,10 +25,6 @@
#ifndef _EVE_H
#define _EVE_H

#ifdef __cplusplus
extern "C" {
#endif

#define EVEURL_TRAINING "http://api.eve-online.com/char/SkillInTraining.xml.aspx"
#define EVEURL_SKILLTREE "http://api.eve-online.com/eve/Skilltree.xml.aspx"
#define EVE_OUTPUT_FORMAT "%s %d in %s"
Expand All @@ -36,8 +33,4 @@ void scan_eve(struct text_object *, const char *);
void print_eve(struct text_object *, char *, int);
void free_eve(struct text_object *);

#ifdef __cplusplus
}
#endif

#endif /* _EVE_H */
8 changes: 0 additions & 8 deletions src/fonts.h
Expand Up @@ -32,10 +32,6 @@

#include "x11.h"

#ifdef __cplusplus
extern "C" {
#endif

/* for fonts */
struct font_list {

Expand Down Expand Up @@ -83,9 +79,5 @@ void set_first_font(const char *);
void free_fonts(void);
void load_fonts(void);

#ifdef __cplusplus
}
#endif

#endif /* _FONTS_H */
#endif /* BUILD_X11 */
8 changes: 0 additions & 8 deletions src/freebsd.h
Expand Up @@ -13,15 +13,7 @@
#include <machine/apm_bios.h>
#endif /* i386 || __i386__ */

#ifdef __cplusplus
extern "C" {
#endif

int get_entropy_avail(unsigned int *);
int get_entropy_poolsize(unsigned int *);

#ifdef __cplusplus
}
#endif

#endif /*FREEBSD_H_*/
7 changes: 0 additions & 7 deletions src/ibm.h
Expand Up @@ -26,19 +26,12 @@
#ifndef _IBM_H
#define _IBM_H

#ifdef __cplusplus
extern "C" {
#endif

void get_ibm_acpi_fan(struct text_object *, char *, int);
void get_ibm_acpi_temps(void);
void get_ibm_acpi_volume(struct text_object *, char *, int);
void get_ibm_acpi_brightness(struct text_object *, char *, int);

void parse_ibm_temps_arg(struct text_object *, const char *);
void print_ibm_temps(struct text_object *, char *, int);
#ifdef __cplusplus
}
#endif

#endif /* _IBM_H */
8 changes: 0 additions & 8 deletions src/libmpdclient.h
Expand Up @@ -72,10 +72,6 @@
#define MPD_ACK_ERROR_PLAYER_SYNC 55
#define MPD_ACK_ERROR_EXIST 56

#ifdef __cplusplus
extern "C" {
#endif

typedef enum mpd_TagItems {
MPD_TAG_ITEM_ARTIST,
MPD_TAG_ITEM_ALBUM,
Expand Down Expand Up @@ -632,8 +628,4 @@ void mpd_sendPlaylistMoveCommand(mpd_Connection *connection, char *playlist,
void mpd_sendPlaylistDeleteCommand(mpd_Connection *connection, char *playlist,
int pos);

#ifdef __cplusplus
}
#endif

#endif
8 changes: 0 additions & 8 deletions src/logging.h
Expand Up @@ -32,10 +32,6 @@

#include "mail.h"

#ifdef __cplusplus
extern "C" {
#endif

void clean_up(void *memtofree1, void* memtofree2);

#define NORM_ERR(...) { \
Expand All @@ -59,8 +55,4 @@ extern int global_debug_level;
#define DBGP(...) __DBGP(0, __VA_ARGS__)
#define DBGP2(...) __DBGP(1, __VA_ARGS__)

#ifdef __cplusplus
}
#endif

#endif /* _LOGGING_H */
13 changes: 8 additions & 5 deletions src/nc.h
@@ -1,11 +1,14 @@
/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- */
/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
* vim: ts=4 sw=4 noet ai cindent syntax=cpp
*/

#ifndef CONKY_NC_H
#define CONKY_NC_H

#ifdef __cplusplus
extern "C" {
#endif

void _nc_free_and_exit(int);

#ifdef __cplusplus
}
#endif

#endif /* CONKY_NC_H */
8 changes: 0 additions & 8 deletions src/netbsd.h
Expand Up @@ -30,15 +30,7 @@
#include "conky.h"
#include "common.h"

#ifdef __cplusplus
extern "C" {
#endif

int get_entropy_avail(unsigned int *);
int get_entropy_poolsize(unsigned int *);

#ifdef __cplusplus
}
#endif

#endif /*NETBSD_H_*/
8 changes: 0 additions & 8 deletions src/nvidia.h
Expand Up @@ -32,16 +32,8 @@
#ifndef NVIDIA_CONKY_H
#define NVIDIA_CONKY_H

#ifdef __cplusplus
extern "C" {
#endif

int set_nvidia_type(struct text_object *, const char *);
void print_nvidia_value(struct text_object *, char *, int);
void free_nvidia(struct text_object *);

#ifdef __cplusplus
}
#endif

#endif
8 changes: 0 additions & 8 deletions src/openbsd.h
Expand Up @@ -9,10 +9,6 @@
#include <sys/sensors.h>
#include <machine/apmvar.h>

#ifdef __cplusplus
extern "C" {
#endif

void parse_obsd_sensor(struct text_object *, const char *);
void print_obsd_sensors_temp(struct text_object *, char *, int);
void print_obsd_sensors_fan(struct text_object *, char *, int);
Expand All @@ -27,8 +23,4 @@ typedef struct apm_power_info *apm_info_t;
int get_entropy_avail(unsigned int *);
int get_entropy_poolsize(unsigned int *);

#ifdef __cplusplus
}
#endif

#endif /*OPENBSD_H_*/

0 comments on commit 54630eb

Please sign in to comment.