Skip to content

Commit

Permalink
Moved browser & opesys structures to their corresponding header files.
Browse files Browse the repository at this point in the history
  • Loading branch information
allinurl committed Jul 30, 2014
1 parent 538db5f commit 78f4f78
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
8 changes: 8 additions & 0 deletions browsers.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
#ifndef BROWSERS_H_INCLUDED
#define BROWSERS_H_INCLUDED

#define BROWSER_TYPE_LEN 13

typedef struct GBrowser_
{
char browser_type[BROWSER_TYPE_LEN];
int hits;
} GBrowser;

char *verify_browser (char *str, char *browser_type);
int is_crawler (const char *agent);

Expand Down
13 changes: 0 additions & 13 deletions commons.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ extern size_t term_w;
#define REQ_PROTO_LEN 9
#define REQ_METHOD_LEN 8

#define BROWSER_TYPE_LEN 10
#define OPESYS_TYPE_LEN 10

typedef enum
{
REQUEST,
Expand Down Expand Up @@ -135,17 +132,7 @@ typedef struct GHolder_
int sub_items_size; /* total number of sub items */
} GHolder;

typedef struct GOpeSys_
{
char os_type[OPESYS_TYPE_LEN];
int hits;
} GOpeSys;

typedef struct GBrowser_
{
char browser_type[BROWSER_TYPE_LEN];
int hits;
} GBrowser;

float get_percentage (unsigned long long total, unsigned long long hit);
void display_storage (void);
Expand Down
2 changes: 2 additions & 0 deletions gdashboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@
#include "geolocation.h"
#endif

#include "browsers.h"
#include "error.h"
#include "gdns.h"
#include "opesys.h"
#include "parser.h"
#include "settings.h"
#include "util.h"
Expand Down
2 changes: 2 additions & 0 deletions glibht.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
#include "geolocation.h"
#endif

#include "browsers.h"
#include "error.h"
#include "opesys.h"
#include "parser.h"
#include "settings.h"
#include "util.h"
Expand Down
8 changes: 8 additions & 0 deletions opesys.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
#ifndef OPESYS_H_INCLUDED
#define OPESYS_H_INCLUDED

#define OPESYS_TYPE_LEN 10

typedef struct GOpeSys_
{
char os_type[OPESYS_TYPE_LEN];
int hits;
} GOpeSys;

char *verify_os (const char *str, char *os_type);

#endif
2 changes: 2 additions & 0 deletions tcabinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
#include "geolocation.h"
#endif

#include "browsers.h"
#include "commons.h"
#include "error.h"
#include "opesys.h"
#include "parser.h"
#include "settings.h"
#include "util.h"
Expand Down

0 comments on commit 78f4f78

Please sign in to comment.