From 4e0acfa99a436689ee7abd0b62fe124204496ebd Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 15 Oct 2007 13:40:52 +0200 Subject: [PATCH] add coding style stuff --- STYLE | 7 +++++++ awesome.c | 1 + awesome.h | 1 + client.c | 1 + client.h | 1 + common.h | 1 + config.c | 1 + config.h | 1 + draw.c | 2 ++ draw.h | 1 + event.c | 1 + event.h | 1 + layout.c | 1 + layout.h | 1 + layouts/floating.c | 1 + layouts/floating.h | 1 + layouts/max.c | 1 + layouts/max.h | 1 + layouts/tile.c | 1 + layouts/tile.h | 1 + screen.c | 1 + screen.h | 1 + statusbar.c | 1 + statusbar.h | 1 + tag.c | 1 + tag.h | 1 + uicb.c | 1 + uicb.h | 1 + util.c | 1 + util.h | 1 + 30 files changed, 37 insertions(+) create mode 100644 STYLE diff --git a/STYLE b/STYLE new file mode 100644 index 00000000..6288b2d8 --- /dev/null +++ b/STYLE @@ -0,0 +1,7 @@ +If you intend to patch and contribute awesome, please respect the following coding style: +- Use 4 space tabs instead of tabs; +- Place braces alone on new lines; +- Do not put very long line, split them; +- Be clear in what you do. + +A vim modeline is set in each file to respect this. diff --git a/awesome.c b/awesome.c index 2ca8d12f..cc48690b 100644 --- a/awesome.c +++ b/awesome.c @@ -436,3 +436,4 @@ main(int argc, char *argv[]) return EXIT_SUCCESS; } +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/awesome.h b/awesome.h index 8d61f137..786e4a63 100644 --- a/awesome.h +++ b/awesome.h @@ -28,3 +28,4 @@ int xerror(Display *, XErrorEvent *); /* awesome's X error handler */ UICB_PROTO(uicb_quit); #endif +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/client.c b/client.c index 651e2310..dca891d0 100644 --- a/client.c +++ b/client.c @@ -808,3 +808,4 @@ uicb_killclient(awesome_config *awesomeconf, else XKillClient(awesomeconf->display, (*awesomeconf->client_sel)->win); } +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/client.h b/client.h index 7a67983d..9709c8c4 100644 --- a/client.h +++ b/client.h @@ -50,3 +50,4 @@ UICB_PROTO(uicb_swapnext); UICB_PROTO(uicb_swapprev); #endif +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/common.h b/common.h index 984b4d2e..7695a40d 100644 --- a/common.h +++ b/common.h @@ -31,3 +31,4 @@ #define LAYOUT_PROTO(name) void name(awesome_config *) #endif +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/config.c b/config.c index 5ff7bee6..b1170650 100644 --- a/config.c +++ b/config.c @@ -429,3 +429,4 @@ initxcolor(Display *disp, int scr, const char *colstr) die("awesome: error, cannot allocate color '%s'\n", colstr); return color; } +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/config.h b/config.h index 755f4f1e..8337ab16 100644 --- a/config.h +++ b/config.h @@ -203,3 +203,4 @@ struct awesome_config void parse_config(Display *, int, const char *, awesome_config *); /* parse configuration file */ #endif +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/draw.c b/draw.c index cbb23020..03e508da 100644 --- a/draw.c +++ b/draw.c @@ -126,3 +126,5 @@ textwidth(Display *disp, XftFont *font, char *text, ssize_t len) XftTextExtentsUtf8(disp, font, (FcChar8 *) text, len, &gi); return gi.width; } + +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/draw.h b/draw.h index 8d8d33dc..4145d87e 100644 --- a/draw.h +++ b/draw.h @@ -29,3 +29,4 @@ void drawrectangle(Display *, int, int, int, int, int, Drawable, int, int, Bool, void drawcircle(Display *, int, int, int, int, Drawable, int, int, Bool, XColor); inline unsigned short textwidth(Display *, XftFont *, char *, ssize_t); #endif +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/event.c b/event.c index 9524c49f..5ef2746d 100644 --- a/event.c +++ b/event.c @@ -538,3 +538,4 @@ grabkeys(Display *disp, int screen, awesome_config *awesomeconf) GrabModeAsync, GrabModeAsync); } } +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/event.h b/event.h index e726af21..8e9796f4 100644 --- a/event.h +++ b/event.h @@ -42,3 +42,4 @@ void handle_event_shape(XEvent *, awesome_config *); void handle_event_randr_screen_change_notify(XEvent *, awesome_config *); #endif +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/layout.c b/layout.c index 7df7a1bf..a8baf5a9 100644 --- a/layout.c +++ b/layout.c @@ -288,3 +288,4 @@ uicb_zoom(awesome_config *awesomeconf, arrange(awesomeconf->display, awesomeconf); } +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/layout.h b/layout.h index d05b8440..ef515d99 100644 --- a/layout.h +++ b/layout.h @@ -43,3 +43,4 @@ UICB_PROTO(uicb_togglehorizontalmax); UICB_PROTO(uicb_zoom); #endif +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/layouts/floating.c b/layouts/floating.c index 652f3b0c..7d4f2f8e 100644 --- a/layouts/floating.c +++ b/layouts/floating.c @@ -39,3 +39,4 @@ layout_floating(awesome_config *awesomeconf) resize(c, c->x, c->y, c->w, c->h, awesomeconf, True); } } +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/layouts/floating.h b/layouts/floating.h index 1512e432..0868ffd4 100644 --- a/layouts/floating.h +++ b/layouts/floating.h @@ -26,3 +26,4 @@ LAYOUT_PROTO(layout_floating); #endif +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/layouts/max.c b/layouts/max.c index 266d5bd5..ef985fd9 100644 --- a/layouts/max.c +++ b/layouts/max.c @@ -36,3 +36,4 @@ layout_max(awesome_config *awesomeconf) si[awesomeconf->screen].height - 2 * c->border, awesomeconf, awesomeconf->resize_hints); XFree(si); } +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/layouts/max.h b/layouts/max.h index 6a3d9539..dcaf568c 100644 --- a/layouts/max.h +++ b/layouts/max.h @@ -27,3 +27,4 @@ LAYOUT_PROTO(layout_max); #endif +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/layouts/tile.c b/layouts/tile.c index 1c1af340..604705a0 100644 --- a/layouts/tile.c +++ b/layouts/tile.c @@ -178,3 +178,4 @@ layout_tileleft(awesome_config *awesomeconf) { _tile(awesomeconf, False); } +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/layouts/tile.h b/layouts/tile.h index 9e245abc..b1ae5000 100644 --- a/layouts/tile.h +++ b/layouts/tile.h @@ -33,3 +33,4 @@ UICB_PROTO(uicb_setncol); UICB_PROTO(uicb_setmwfact); #endif +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/screen.c b/screen.c index da179c8f..573a3dbc 100644 --- a/screen.c +++ b/screen.c @@ -249,3 +249,4 @@ uicb_movetoscreen(awesome_config * awesomeconf, arrange(awesomeconf->display, &awesomeconf[prev_screen - awesomeconf->screen]); arrange(awesomeconf->display, &awesomeconf[new_screen - awesomeconf->screen]); } +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/screen.h b/screen.h index e4700a44..6c952cf3 100644 --- a/screen.h +++ b/screen.h @@ -39,3 +39,4 @@ UICB_PROTO(uicb_focusprevscreen); UICB_PROTO(uicb_movetoscreen); #endif +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/statusbar.c b/statusbar.c index a5c8349a..989bd216 100644 --- a/statusbar.c +++ b/statusbar.c @@ -260,3 +260,4 @@ uicb_setstatustext(awesome_config *awesomeconf, const char *arg) drawstatusbar(awesomeconf->display, awesomeconf); } +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/statusbar.h b/statusbar.h index c2935bd9..9950d078 100644 --- a/statusbar.h +++ b/statusbar.h @@ -32,3 +32,4 @@ UICB_PROTO(uicb_togglebar); UICB_PROTO(uicb_setstatustext); #endif +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/tag.c b/tag.c index df651d1f..0f13a7ee 100644 --- a/tag.c +++ b/tag.c @@ -329,3 +329,4 @@ uicb_tag_viewprev(awesome_config *awesomeconf, saveawesomeprops(awesomeconf->display, awesomeconf); arrange(awesomeconf->display, awesomeconf); } +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/tag.h b/tag.h index f0ff9920..d0b48e84 100644 --- a/tag.h +++ b/tag.h @@ -41,3 +41,4 @@ UICB_PROTO(uicb_tag_viewnext); UICB_PROTO(uicb_tag_viewprev); #endif +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/uicb.c b/uicb.c index 861e8ab1..653d3cec 100644 --- a/uicb.c +++ b/uicb.c @@ -84,3 +84,4 @@ run_uicb(char *cmd, awesome_config *awesomeconf) return 0; } +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/uicb.h b/uicb.h index 22b3b226..c7742bb1 100644 --- a/uicb.h +++ b/uicb.h @@ -28,3 +28,4 @@ int parse_control(char *, awesome_config *); int run_uicb(char *, awesome_config *); #endif +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/util.c b/util.c index 9c504a83..8b903ca6 100644 --- a/util.c +++ b/util.c @@ -225,3 +225,4 @@ ssize_t a_strcpy(char *dst, ssize_t n, const char *src) return len; } +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/util.h b/util.h index cadb8ab8..a221ad06 100644 --- a/util.h +++ b/util.h @@ -207,3 +207,4 @@ void *name_func_lookup(const char *, const NameFuncLink *); UICB_PROTO(uicb_spawn); UICB_PROTO(uicb_exec); #endif +// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99