Skip to content

Commit 617f2ae

Browse files
committed
Made public header 'ddcci.h' non platform/configure dependent
1 parent 9c51582 commit 617f2ae

File tree

12 files changed

+46
-20
lines changed

12 files changed

+46
-20
lines changed

src/ddccontrol/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include "config.h"
2222
#include "ddcci.h"
23+
#include "internal.h"
2324
#include "monitor_db.h"
2425

2526
#include <stdio.h>

src/gddccontrol/fspatterns.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
***************************************************************************/
2020

2121
#include "notebook.h"
22+
#include "internal.h"
23+
2224
#include <string.h>
2325

2426
static GtkWidget* fs_patterns_window = NULL;

src/gddccontrol/gprofile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include "config.h"
2222
#include "notebook.h"
23+
#include "internal.h"
2324

2425
#include <string.h>
2526

src/gddccontrol/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define IDLE_TIMEOUT 60
2828

2929
#include "notebook.h"
30+
#include "internal.h"
3031

3132
GtkWidget* table;
3233

src/gddccontrol/notebook.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <math.h>
3030

3131
#include "notebook.h"
32+
#include "internal.h"
3233

3334
#define GTK_FILL_EXPAND (GtkAttachOptions)(GTK_FILL|GTK_EXPAND)
3435

src/lib/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $(pkgconfig_DATA): $(srcdir)/ddccontrol.pc.in $(top_builddir)/config.status
1111
lib_LTLIBRARIES = libddccontrol.la
1212

1313
libddccontrol_la_SOURCES = ddcci.c ddcci.h monitor_db.c monitor_db.h \
14-
ddcpci-ipc.h i2c-dev.h conf.c conf.h amd_adl.c amd_adl.h
14+
ddcpci-ipc.h i2c-dev.h conf.c conf.h amd_adl.c amd_adl.h internal.h
1515

1616
libddccontrol_la_LIBADD = $(LIBXML2_LDFLAGS)
1717
AM_CFLAGS = $(LIBXML2_CFLAGS)

src/lib/amd_adl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
#include "amd_adl.h"
4242
#include "ddcci.h"
43+
#include "internal.h"
4344

4445
#if 1
4546
# define D(x)

src/lib/conf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <libxml/xmlwriter.h>
3939

4040
#include "conf.h"
41+
#include "internal.h"
4142

4243
#define RETRYS 3 // number of read retrys
4344

src/lib/ddcci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <sys/stat.h>
3939

4040
#include "ddcci.h"
41+
#include "internal.h"
4142
#include "amd_adl.h"
4243

4344
#include "conf.h"

src/lib/ddcci.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,6 @@
2121
#ifndef DDCCI_H
2222
#define DDCCI_H
2323

24-
#include "config.h"
25-
26-
#ifdef HAVE_GETTEXT
27-
#include <libintl.h>
28-
#include <locale.h>
29-
#define _(String) gettext (String)
30-
#define gettext_noop(String) String
31-
#define N_(String) gettext_noop (String)
32-
#else
33-
#define _(String) String
34-
#define N_(String) String
35-
#endif
36-
3724
#include <time.h>
3825
#include <sys/time.h>
3926

@@ -63,9 +50,7 @@ struct caps {
6350
struct monitor {
6451
int fd;
6552
unsigned int addr;
66-
#ifdef HAVE_AMDADL
6753
int adl_adapter, adl_display;
68-
#endif
6954
char pnpid[8];
7055
unsigned char digital; /* 0 - digital, 1 - analog */
7156
struct timeval last;
@@ -76,12 +61,8 @@ struct monitor {
7661

7762
enum {
7863
dev
79-
#ifdef HAVE_DDCPCI
8064
,pci
81-
#endif
82-
#ifdef HAVE_AMDADL
8365
,type_adl
84-
#endif
8566
} type;
8667
int probing; /* are we probing? */
8768

src/lib/internal.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
ddc/ci interface functions header
3+
Copyright(c) 2004 Oleg I. Vdovikin ([email protected])
4+
Copyright(c) 2004-2005 Nicolas Boichat ([email protected])
5+
6+
This program is free software; you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License as published by
8+
the Free Software Foundation; either version 2 of the License, or
9+
(at your option) any later version.
10+
11+
This program is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License for more details.
15+
16+
You should have received a copy of the GNU General Public License
17+
along with this program; if not, write to the Free Software
18+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+
*/
20+
21+
#ifndef DDCCI_INTERNAL_H
22+
#define DDCCI_INTERNAL_H
23+
24+
#ifdef HAVE_GETTEXT
25+
#include <libintl.h>
26+
#include <locale.h>
27+
#define _(String) gettext (String)
28+
#define gettext_noop(String) String
29+
#define N_(String) gettext_noop (String)
30+
#else
31+
#define _(String) String
32+
#define N_(String) String
33+
#endif
34+
35+
#endif //DDCCI_INTERNAL_H

src/lib/monitor_db.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#include "monitor_db.h"
3232
#include "ddcci.h"
33+
#include "internal.h"
3334

3435
/* Localize, and alloc in libxml */
3536
#ifdef HAVE_GETTEXT

0 commit comments

Comments
 (0)