]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
C++ cleanups from sopwith
authorewt <ewt>
Tue, 25 Feb 1997 23:11:57 +0000 (23:11 +0000)
committerewt <ewt>
Tue, 25 Feb 1997 23:11:57 +0000 (23:11 +0000)
button.c
checkbox.c
entry.c
newt.c
newt.h
newt_pr.h
textbox.c

index 110ec4285c839e74df98e28b72296dd7cac0e4d2..c58b3dd49ebb461c41ffca91424264899783372b 100644 (file)
--- a/button.c
+++ b/button.c
@@ -15,7 +15,7 @@ static void buttonDrawText(newtComponent co, int active, int pushed);
 
 static void buttonDraw(newtComponent c);
 static void buttonDestroy(newtComponent co);
-static struct eventResult buttonEvent(struct newtComponent * c, 
+static struct eventResult buttonEvent(newtComponent c,
                                      struct event ev);
 
 static struct componentOps buttonOps = {
@@ -93,7 +93,7 @@ static void buttonDrawText(newtComponent co, int active, int pushed) {
     SLsmg_write_char(' ');
 }
 
-static struct eventResult buttonEvent(struct newtComponent * co, 
+static struct eventResult buttonEvent(newtComponent co,
                                      struct event ev) {
     struct eventResult er;
 
index d5548118f9124340700970b07d1632444a2f4d56..b78778162840f6bdd6b192ede8fa85f10059a1f5 100644 (file)
@@ -23,7 +23,7 @@ static void makeActive(newtComponent co);
 
 static void cbDraw(newtComponent c);
 static void cbDestroy(newtComponent co);
-struct eventResult cbEvent(struct newtComponent * co, struct event ev);
+struct eventResult cbEvent(newtComponent co, struct event ev);
 
 static struct componentOps cbOps = {
     cbDraw,
@@ -187,7 +187,7 @@ static void cbDestroy(newtComponent co) {
     free(co);
 }
 
-struct eventResult cbEvent(struct newtComponent * co, struct event ev) {
+struct eventResult cbEvent(newtComponent co, struct event ev) {
     struct checkbox * cb = co->data;
     struct eventResult er;
     char * cur;
diff --git a/entry.c b/entry.c
index 7aa76d3db525ecf0c28095d3b7fe4eaa5591fef8..d696967807906c863661303f52831ad75e7e46c5 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -18,10 +18,10 @@ struct entry {
 
 static void entryDraw(newtComponent co);
 static void entryDestroy(newtComponent co);
-static struct eventResult entryEvent(struct newtComponent * co, 
+static struct eventResult entryEvent(newtComponent co, 
                                     struct event ev);
 
-static struct eventResult entryHandleKey(struct newtComponent * co, int key);
+static struct eventResult entryHandleKey(newtComponent co, int key);
 
 static struct componentOps entryOps = {
     entryDraw,
@@ -171,7 +171,7 @@ static void entryDestroy(newtComponent co) {
     free(co);
 }
 
-static struct eventResult entryEvent(struct newtComponent * co, 
+static struct eventResult entryEvent(newtComponent co, 
                                     struct event ev) {
     struct entry * en = co->data;
     struct eventResult er;
@@ -205,7 +205,7 @@ static struct eventResult entryEvent(struct newtComponent * co,
     return er;
 }
 
-static struct eventResult entryHandleKey(struct newtComponent * co, int key) {
+static struct eventResult entryHandleKey(newtComponent co, int key) {
     struct entry * en = co->data;
     struct eventResult er;
     char * chptr, * insPoint;
diff --git a/newt.c b/newt.c
index 043b8a71fef56585830ea60229f414934519c7a1..86eeecda0ab6a434e93b5038b4b9cd62792f8d16 100644 (file)
--- a/newt.c
+++ b/newt.c
@@ -454,7 +454,7 @@ void newtDelay(int usecs) {
     select(0, &set, &set, &set, &tv);
 }
 
-struct eventResult newtDefaultEventHandler(struct newtComponent * c, 
+struct eventResult newtDefaultEventHandler(newtComponent c,
                                           struct event ev) {
     struct eventResult er;
 
diff --git a/newt.h b/newt.h
index 927323a4c523385c1ce6aae78d419de7ece915d2..2b5c0bf6aa448a262ee2fe5eb0c1ea695e32cab5 100644 (file)
--- a/newt.h
+++ b/newt.h
@@ -1,6 +1,10 @@
 #ifndef H_NEWT
 #define H_NEWT
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define NEWT_COLORSET_ROOT             2
 #define NEWT_COLORSET_BORDER           3
 #define NEWT_COLORSET_WINDOW           4
@@ -46,7 +50,7 @@ struct newtColors {
     char * disabledEntryFg, * disabledEntryBg;
 };
 
-typedef struct newtComponent * newtComponent;
+typedef struct newtComponent_struct * newtComponent;
 
 extern struct newtColors newtDefaultColorPalette;
 
@@ -186,4 +190,8 @@ void newtFormDestroy(newtComponent form);
 #define NEWT_KEY_F11                   NEWT_KEY_EXTRA_BASE + 111
 #define NEWT_KEY_F12                   NEWT_KEY_EXTRA_BASE + 112
 
+#ifdef __cplusplus
+} /* End of extern "C" { */
+#endif
+
 #endif /* H_NEWT */
index e6eb0a14744973b5e59e47683ffe95c30a4214a3..7efa55b8ce6f112e4cb331715d5ee15e258eb0f7 100644 (file)
--- a/newt_pr.h
+++ b/newt_pr.h
@@ -26,7 +26,7 @@ void newtClearBox(int left, int top, int width, int height);
 
 int newtGetKey(void);
 
-struct newtComponent {
+struct newtComponent_struct {
     /* common data */
     int height, width; 
     int top, left;
@@ -61,12 +61,12 @@ struct event {
 } ;
 
 struct componentOps {
-    void (* draw)(struct newtComponent * c);
-    struct eventResult (* event)(struct newtComponent * c, struct event ev);
-    void (* destroy)(struct newtComponent * c);
+    void (* draw)(newtComponent c);
+    struct eventResult (* event)(newtComponent c, struct event ev);
+    void (* destroy)(newtComponent c);
 } ;
 
-struct eventResult newtDefaultEventHandler(struct newtComponent * c, 
+struct eventResult newtDefaultEventHandler(newtComponent c,
                                           struct event ev);
 
 #endif /* H_NEWT_PR */
index 5f9a6ba51a36abd6da9f0fe20a224c57ff8e001c..1dcacfba5a93a0fc24437348e01daf5ceaffea7a 100644 (file)
--- a/textbox.c
+++ b/textbox.c
@@ -18,7 +18,7 @@ struct textbox {
 static void addLine(newtComponent co, const char * s, int len);
 static void textboxDraw(newtComponent co);
 static void addShortLine(newtComponent co, const char * s, int len);
-static struct eventResult textboxEvent(struct newtComponent * c, 
+static struct eventResult textboxEvent(newtComponent c,
                                      struct event ev);
 static void textboxDestroy(newtComponent co);
 
@@ -151,7 +151,7 @@ static void textboxDraw(newtComponent c) {
     }
 }
 
-static struct eventResult textboxEvent(struct newtComponent * co, 
+static struct eventResult textboxEvent(newtComponent co, 
                                      struct event ev) {
     struct textbox * tb = co->data;
     struct eventResult er;