Skip to content

Commit

Permalink
Fix up headers
Browse files Browse the repository at this point in the history
The additions to owl.h and some of the removals were done by
Alejandro Sedeño <asedeno@mit.edu> in commit
77a0258.

Notes:

* I think owl.c lost the need for sys/time.h when we punted select() in
  favor of glib's main loop.
* We don't actually need to include things like stdarg.h, stdio.h,
  glib/gstdio.h, glib-object.h.  I think they get indirectly included
  via owl.h and/or glib.h.  They're left in (or added in to) the files
  that use functions/types from them.
* I'm not entirely sure what sys/socket.h is doing in message.c.  It
  is there from the initial commit.  I suspect it might have had
  something to do with the call to getnameinfo.  message.c compiles
  without it, but
  http://pubs.opengroup.org/onlinepubs/009695399/functions/getnameinfo.html
  suggests that we're supposed to include it?  *shrugs*  I'm leaving it
  in, for now.  (Rather, I'll leave one copy of the #include in.)
  • Loading branch information
JasonGross committed Jul 25, 2011
1 parent 30428a9 commit f271129
Show file tree
Hide file tree
Showing 34 changed files with 23 additions and 130 deletions.
3 changes: 0 additions & 3 deletions aim.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#include <stdio.h>
#include <stdio.h>
#include <sys/stat.h>
#include "owl.h"

/**********************************************************************/
Expand Down
4 changes: 0 additions & 4 deletions cmd.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "owl.h"

/**************************************************************************/
Expand Down
6 changes: 1 addition & 5 deletions commands.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "owl.h"
#include <getopt.h>

/* fn is "char *foo(int argc, const char *const *argv, const char *buff)" */
#define OWLCMD_ARGS(name, fn, ctx, summary, usage, description) \
Expand Down
1 change: 0 additions & 1 deletion context.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <string.h>
#include "owl.h"

#define SET_ACTIVE(ctx, new) ctx->mode = ((ctx->mode)&~OWL_CTX_ACTIVE_BITS)|new
Expand Down
4 changes: 0 additions & 4 deletions dict.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
* O(log n) on searches
*/

#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "owl.h"


#define INITSIZE 30
#define GROWBY 3 / 2

Expand Down
1 change: 0 additions & 1 deletion editcontext.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "owl.h"

#include <assert.h>

bool owl_is_editcontext(const owl_context *ctx)
Expand Down
4 changes: 0 additions & 4 deletions editwin.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#include "owl.h"
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>

#define VALID_EXCURSION (0x9a2b4729)

Expand Down
1 change: 0 additions & 1 deletion filter.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <string.h>
#include "owl.h"

owl_filter *owl_filter_new_fromstring(const char *name, const char *string)
Expand Down
9 changes: 1 addition & 8 deletions filterproc.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
#include <signal.h>
#include <unistd.h>
#include <sys/select.h>
#include <sys/types.h>
#include "owl.h"
#include <sys/wait.h>
#include <poll.h>
#include <fcntl.h>
#include <string.h>

#include <glib.h>

int send_receive(int rfd, int wfd, const char *out, char **in)
{
Expand Down
2 changes: 0 additions & 2 deletions fmtext.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#include "owl.h"
#include <stdlib.h>
#include <string.h>

/* initialize an fmtext with no data */
void owl_fmtext_init_null(owl_fmtext *f)
Expand Down
13 changes: 2 additions & 11 deletions functions.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
#include "owl.h"
#include "filterproc.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <netinet/in.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <errno.h>
#include <signal.h>
#include "owl.h"
#include "filterproc.h"

CALLER_OWN char *owl_function_command(const char *cmdbuff)
{
Expand Down
8 changes: 1 addition & 7 deletions global.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#include "owl.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <netdb.h>
#include <termios.h>
#include <sys/ioctl.h>
#include <time.h>
#include "owl.h"

static void _owl_global_init_windows(owl_global *g);

Expand Down
1 change: 0 additions & 1 deletion help.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "owl.h"
#include <string.h>

void owl_help(void)
{
Expand Down
2 changes: 0 additions & 2 deletions keybinding.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <ctype.h>
#include <string.h>
#include "owl.h"

/*
Expand Down
1 change: 0 additions & 1 deletion keymap.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <string.h>
#include "owl.h"

static void _owl_keymap_format_bindings(const owl_keymap *km, owl_fmtext *fm);
Expand Down
2 changes: 0 additions & 2 deletions keypress.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <ctype.h>
#include <string.h>
#include "owl.h"

static const struct _owl_keypress_specialmap {
Expand Down
5 changes: 1 addition & 4 deletions logging.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#include "owl.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <sys/param.h>
#include <stdio.h>

typedef struct _owl_log_entry { /* noproto */
char *filename;
Expand Down
12 changes: 2 additions & 10 deletions message.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/socket.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <time.h>
#include "owl.h"
#include "filterproc.h"
#include <sys/socket.h>
#include <arpa/inet.h>

static owl_fmtext_cache fmtext_cache[OWL_FMTEXT_CACHE_SIZE];
static owl_fmtext_cache * fmtext_cache_next = fmtext_cache;
Expand Down
2 changes: 0 additions & 2 deletions messagelist.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#include "owl.h"
#include <stdlib.h>
#include <string.h>

void owl_messagelist_create(owl_messagelist *ml)
{
Expand Down
12 changes: 1 addition & 11 deletions owl.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,11 @@
* file included with the distribution for more information.
*/

#include "owl.h"
#include <stdio.h>
#include <unistd.h>
#include <getopt.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <time.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/time.h>
#include <termios.h>
#include <sys/stat.h>
#include <locale.h>
#include "owl.h"


#if OWL_STDERR_REDIR
#ifdef HAVE_SYS_IOCTL_H
Expand Down
9 changes: 8 additions & 1 deletion owl.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,22 @@
#include <ncursesw/panel.h>
#endif
#include <sys/param.h>
#include <sys/types.h>
#include <ctype.h>
#include <errno.h>
#include <EXTERN.h>
#include <fcntl.h>
#include <netdb.h>
#include <regex.h>
#include <time.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include "libfaim/aim.h"
#include <wchar.h>
#include "glib.h"
#include <glib.h>
#ifdef HAVE_LIBZEPHYR
#include <zephyr/zephyr.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions owl_perl.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef INC_BARNOWL_OWL_PERL_H
#define INC_BARNOWL_OWL_PERL_H

#include <stdio.h>

#define OWL_PERL_VOID_CALL (void)POPs;

/*
Expand Down
7 changes: 1 addition & 6 deletions perlconfig.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#define OWL_PERL
#include "owl.h"
#include <stdio.h>

extern XS(boot_BarnOwl);
extern XS(boot_DynaLoader);
Expand Down
5 changes: 0 additions & 5 deletions perlglue.xs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/* -*- mode: c; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifdef HAVE_LIBZEPHYR
#include <zephyr/zephyr.h>
#endif
#include <EXTERN.h>

#define OWL_PERL
#include "owl.h"

Expand Down
1 change: 0 additions & 1 deletion regex.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <string.h>
#include "owl.h"

void owl_regex_init(owl_regex *re)
Expand Down
3 changes: 0 additions & 3 deletions tester.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
#include "owl.h"
#undef WINDOW

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#undef instr
#include <ncursesw/curses.h>
Expand Down
4 changes: 0 additions & 4 deletions text.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "owl.h"

/* Returns a copy of 'in' with each line indented 'n'
Expand Down
7 changes: 0 additions & 7 deletions util.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
#include "owl.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <pwd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <assert.h>
#include <stdarg.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <glib-object.h>

Expand Down
6 changes: 1 addition & 5 deletions variable.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include "owl.h"
#include <stdio.h>

#define OWLVAR_BOOL(name,default,summary,description) \
{ g_strdup(name), OWL_VARIABLE_BOOL, NULL, default, "on,off", g_strdup(summary), g_strdup(description), NULL, \
Expand Down
1 change: 0 additions & 1 deletion view.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <stdlib.h>
#include "owl.h"

void owl_view_create(owl_view *v, const char *name, owl_filter *f, const owl_style *s)
Expand Down
1 change: 0 additions & 1 deletion viewwin.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <string.h>
#include "owl.h"

#define BOTTOM_OFFSET 1
Expand Down
2 changes: 0 additions & 2 deletions window.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "owl.h"

#include <assert.h>

struct _owl_window { /*noproto*/
GObject object;
/* hierarchy information */
Expand Down
8 changes: 2 additions & 6 deletions zephyr.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <string.h>
#include "owl.h"
#include <stdio.h>
#include <sys/stat.h>

#ifdef HAVE_LIBZEPHYR
static GSource *owl_zephyr_event_source_new(int fd);
Expand Down
4 changes: 0 additions & 4 deletions zwrite.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#include <string.h>
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
#include "owl.h"

CALLER_OWN owl_zwrite *owl_zwrite_new(const char *line)
Expand Down

0 comments on commit f271129

Please sign in to comment.