diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2014-05-27 10:59:52 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2014-05-27 10:59:52 +0200 |
commit | 5160c9212e0e55e0dc518aadca0e6a370cf1420d (patch) | |
tree | b5fb172ab10010321fb383b2aa3b8e0c058a0da7 /geoip.h | |
parent | 2e7e42af61fea74bfbb40abdc8318366638672fb (diff) |
geoip: Pass struct sockaddr_in{,6} as pointer instead of by value
Change the interface to the geoip_* functions to take a pointer to a
struct sockaddr_in{,6} instead of the struct itself.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'geoip.h')
-rw-r--r-- | geoip.h | 48 |
1 files changed, 24 insertions, 24 deletions
@@ -11,18 +11,18 @@ extern void init_geoip(int enforce); extern void update_geoip(void); extern int geoip_working(void); -extern const char *geoip4_city_name(struct sockaddr_in sa); -extern const char *geoip6_city_name(struct sockaddr_in6 sa); -extern const char *geoip4_region_name(struct sockaddr_in sa); -extern const char *geoip6_region_name(struct sockaddr_in6 sa); -extern const char *geoip4_country_name(struct sockaddr_in sa); -extern const char *geoip6_country_name(struct sockaddr_in6 sa); -extern float geoip4_longitude(struct sockaddr_in sa); -extern float geoip4_latitude(struct sockaddr_in sa); -extern float geoip6_longitude(struct sockaddr_in6 sa); -extern float geoip6_latitude(struct sockaddr_in6 sa); -extern const char *geoip4_as_name(struct sockaddr_in sa); -extern const char *geoip6_as_name(struct sockaddr_in6 sa); +extern const char *geoip4_city_name(struct sockaddr_in *sa); +extern const char *geoip6_city_name(struct sockaddr_in6 *sa); +extern const char *geoip4_region_name(struct sockaddr_in *sa); +extern const char *geoip6_region_name(struct sockaddr_in6 *sa); +extern const char *geoip4_country_name(struct sockaddr_in *sa); +extern const char *geoip6_country_name(struct sockaddr_in6 *sa); +extern float geoip4_longitude(struct sockaddr_in *sa); +extern float geoip4_latitude(struct sockaddr_in *sa); +extern float geoip6_longitude(struct sockaddr_in6 *sa); +extern float geoip6_latitude(struct sockaddr_in6 *sa); +extern const char *geoip4_as_name(struct sockaddr_in *sa); +extern const char *geoip6_as_name(struct sockaddr_in6 *sa); extern void destroy_geoip(void); #else static inline void init_geoip(int enforce) @@ -43,62 +43,62 @@ static inline int geoip_working(void) return 0; } -static inline const char *geoip4_city_name(struct sockaddr_in sa) +static inline const char *geoip4_city_name(struct sockaddr_in *sa) { return NULL; } -static inline const char *geoip6_city_name(struct sockaddr_in6 sa) +static inline const char *geoip6_city_name(struct sockaddr_in6 *sa) { return NULL; } -static inline const char *geoip4_region_name(struct sockaddr_in sa) +static inline const char *geoip4_region_name(struct sockaddr_in *sa) { return NULL; } -static inline const char *geoip6_region_name(struct sockaddr_in6 sa) +static inline const char *geoip6_region_name(struct sockaddr_in6 *sa) { return NULL; } -static inline const char *geoip4_country_name(struct sockaddr_in sa) +static inline const char *geoip4_country_name(struct sockaddr_in *sa) { return NULL; } -static inline const char *geoip6_country_name(struct sockaddr_in6 sa) +static inline const char *geoip6_country_name(struct sockaddr_in6 *sa) { return NULL; } -static inline float geoip4_longitude(struct sockaddr_in sa) +static inline float geoip4_longitude(struct sockaddr_in *sa) { return .0f; } -static inline float geoip4_latitude(struct sockaddr_in sa) +static inline float geoip4_latitude(struct sockaddr_in *sa) { return .0f; } -static inline float geoip6_longitude(struct sockaddr_in6 sa) +static inline float geoip6_longitude(struct sockaddr_in6 *sa) { return .0f; } -static inline float geoip6_latitude(struct sockaddr_in6 sa) +static inline float geoip6_latitude(struct sockaddr_in6 *sa) { return .0f; } -static inline const char *geoip4_as_name(struct sockaddr_in sa) +static inline const char *geoip4_as_name(struct sockaddr_in *sa) { return NULL; } -static inline const char *geoip6_as_name(struct sockaddr_in6 sa) +static inline const char *geoip6_as_name(struct sockaddr_in6 *sa) { return NULL; } |