Permalink
Browse files

Rejiggered many #includes and the Makefile

  • Loading branch information...
1 parent 8b42a53 commit d6da95d9bd7a59bb7f04536749a73a2e5fdb6130 @ec429 committed Jun 5, 2013
Showing with 39 additions and 36 deletions.
  1. +3 −0 bits.c
  2. +0 −3 bits.h
  3. +6 −0 buffer.c
  4. +0 −5 buffer.h
  5. +7 −0 config.c
  6. +0 −5 config.h
  7. +1 −0 ctcp.c
  8. +5 −11 distMakefile
  9. +7 −0 input.c
  10. +0 −6 input.h
  11. +4 −0 irc.c
  12. +0 −4 irc.h
  13. +2 −0 logging.c
  14. +1 −0 names.c
  15. +1 −1 plans
  16. +2 −0 ttyesc.c
  17. +0 −1 ttyesc.h
View
3 bits.c
@@ -7,6 +7,9 @@
*/
#include "bits.h"
+#include "strbuf.h"
+#include "ttyesc.h"
+#include "config.h"
int wordline(const char *msg, unsigned int x, char **out, size_t *l, size_t *i, colour lc)
{
View
3 bits.h
@@ -11,10 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "strbuf.h"
-#include "ttyesc.h"
#include "colour.h"
-#include "config.h"
// helper fn macros
#define max(a,b) ((a)>(b)?(a):(b))
View
@@ -10,6 +10,12 @@
#include "logging.h"
#include "osconf.h"
#include "ctbuf.h"
+#include "strbuf.h"
+#include "ttyesc.h"
+#include "bits.h"
+#include "names.h"
+#include "text.h"
+#include "version.h"
ctchar *highlight(const char *src, size_t *len); // use colours to highlight \escapes. Returns a malloc-like pointer
View
@@ -17,16 +17,11 @@
#include <time.h>
#include <ctype.h>
#include <math.h>
-#include "ttyesc.h"
#include "colour.h"
#include "config.h"
-#include "bits.h"
#include "input.h"
#include "irc.h"
-#include "names.h"
-#include "text.h"
#include "types.h"
-#include "version.h"
#define SERVER(buf) (bufs[bufs[buf].server]) // server of a buf
#define LIVE(buf) (bufs[buf].live && SERVER(buf).live) // Check liveness
View
@@ -7,6 +7,13 @@
*/
#include "config.h"
+#include "bits.h"
+#include "colour.h"
+#include "text.h"
+#include "version.h"
+#include "buffer.h"
+#include "strbuf.h"
+#include "ttyesc.h"
#include "keymap.c"
View
@@ -41,11 +41,6 @@ typedef struct _servlist
servlist;
#include "names.h"
-#include "bits.h"
-#include "colour.h"
-#include "text.h"
-#include "version.h"
-#include "buffer.h"
#include "keymod.h"
// global settings & state
View
1 ctcp.c
@@ -13,6 +13,7 @@
#include "types.h"
#include "buffer.h"
#include "config.h"
+#include "version.h"
int ctcp_strip(char *msg, const char *src, int b2, bool ha, bool notice, bool priv, bool tx)
{
View
@@ -41,7 +41,7 @@ clean:
-rm -f *.o quirc genconfig genkeymap
realclean: clean
- -rm -f c_init.c README version.h config_* keymap.c keymod.h quirc.1
+ -rm -f c_init.c README version.h config_* keymap.c keymod.h quirc.1 numeric.h numeric_text.c
doc: README config_ref.htm quirc.1
@@ -58,31 +58,25 @@ quirc.1: man.in
%.o: %.c %.h
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ $(DEFINES)
-ttyesc.o: ttyesc.c ttyesc.h bits.h
+ttyesc.o: ttyesc.c ttyesc.h bits.h config.h
irc.o: irc.c irc.h bits.h buffer.h colour.h names.h numeric.h numeric_text.h osconf.h ctcp.h
-irc.h: config.h
- touch irc.h
-
bits.o: bits.c bits.h ttyesc.h colour.h
-bits.h: config.h strbuf.h
- touch bits.h
-
ctbuf.h: colour.h
touch ctbuf.h
-ctcp.c: types.h buffer.h
+ctcp.c: types.h buffer.h config.h version.h
colour.o: colour.c colour.h c_init.c ttyesc.h
buffer.o: buffer.c buffer.h ttyesc.h colour.h bits.h names.h text.h irc.h version.h input.h logging.h osconf.h ctbuf.h
-buffer.h: config.h version.h logging.h
+buffer.h: colour.h config.h input.h irc.h types.h
touch buffer.h
-config.o: config.c config.h names.h bits.h colour.h text.h version.h
+config.o: config.c config.h names.h bits.h colour.h text.h ttyesc.h version.h
config.c: config_check.c config_def.c config_need.c config_rcread.c config_pargs.c config_help.c keymap.c
touch config.c
View
@@ -8,6 +8,13 @@
#include "input.h"
#include "logging.h"
+#include "strbuf.h"
+#include "ttyesc.h"
+#include "buffer.h"
+#include "irc.h"
+#include "bits.h"
+#include "config.h"
+#include "keymod.h"
size_t i_firstlen(ichar src);
size_t i_lastlen(ichar src);
View
@@ -40,13 +40,7 @@ typedef struct
}
ibuffer;
-#include "ttyesc.h"
#include "names.h"
-#include "buffer.h"
-#include "irc.h"
-#include "bits.h"
-#include "config.h"
-#include "keymod.h"
bool ttab;
View
4 irc.c
@@ -7,7 +7,11 @@
*/
#include "irc.h"
+#include "bits.h"
+#include "buffer.h"
+#include "config.h"
#include "ctcp.h"
+#include "numeric.h"
#include "numeric_text.h"
void handle_signals(int sig)
View
4 irc.h
@@ -41,11 +41,7 @@ typedef struct
}
message;
-#include "bits.h"
-#include "buffer.h"
#include "colour.h"
-#include "config.h"
-#include "numeric.h"
#include "names.h"
#include "osconf.h"
View
@@ -8,9 +8,11 @@
#include "logging.h"
#include <stdlib.h>
+#include <stdint.h>
#include <string.h>
#include <ctype.h>
#include "bits.h"
+#include "osconf.h"
int log_add_plain(FILE *logf, mtype lm, prio lq, char lp, bool ls, const char *lt, const char *ltag, time_t ts);
int log_add_symbolic(FILE *logf, mtype lm, prio lq, char lp, bool ls, const char *lt, const char *ltag, time_t ts);
View
@@ -7,6 +7,7 @@
*/
#include "names.h"
+#include "strbuf.h"
name *n_dup(const name *list)
{
View
2 plans
@@ -22,7 +22,7 @@ Use unicode-charmap (somewhere in system i18n) to find out character widths, for
Command tab-completion: /blah<tab>. Also, command matching and handling should really be refactored; input.c is far too big!
-#inclusion and Makefile audit. Lots of stuff is #included from .h files when it should only be #included from the .c files, some #inclusions may not be reflected in the Makefile, and type definition #include loops should be resolved with types.h instead of relying on placing #includes after typedefs.
+#inclusion and Makefile audit. Lots of stuff is #included from .h files when it should only be #included from the .c files, some #inclusions may not be reflected in the Makefile, and type definition #include loops should be resolved with types.h instead of relying on placing #includes after typedefs. Some progress has now been made on this, but more types need to go in types.h, and the Makefile's dependencies need updating (perhaps generating with makedepend?)
Persistent backscroll.
View
@@ -7,6 +7,8 @@
*/
#include "ttyesc.h"
+#include "config.h"
+#include "strbuf.h"
int termsgr0(void)
{
View
@@ -12,7 +12,6 @@
#include <sys/ioctl.h>
#include <term.h>
#undef tab
-#include "bits.h"
int setcol(int fore, int back, bool hi, bool ul); // sets the text colour
int s_setcol(int fore, int back, bool hi, bool ul, char **rv, size_t *l, size_t *i); // writes a setcol-like string with append_char (see bits.h)

0 comments on commit d6da95d

Please sign in to comment.