add coding style stuff

This commit is contained in:
Julien Danjou 2007-10-15 13:40:52 +02:00
parent b3995c6152
commit 4e0acfa99a
30 changed files with 37 additions and 0 deletions

7
STYLE Normal file
View File

@ -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.

View File

@ -436,3 +436,4 @@ main(int argc, char *argv[])
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -28,3 +28,4 @@ int xerror(Display *, XErrorEvent *); /* awesome's X error handler */
UICB_PROTO(uicb_quit); UICB_PROTO(uicb_quit);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -808,3 +808,4 @@ uicb_killclient(awesome_config *awesomeconf,
else else
XKillClient(awesomeconf->display, (*awesomeconf->client_sel)->win); XKillClient(awesomeconf->display, (*awesomeconf->client_sel)->win);
} }
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -50,3 +50,4 @@ UICB_PROTO(uicb_swapnext);
UICB_PROTO(uicb_swapprev); UICB_PROTO(uicb_swapprev);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -31,3 +31,4 @@
#define LAYOUT_PROTO(name) void name(awesome_config *) #define LAYOUT_PROTO(name) void name(awesome_config *)
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -429,3 +429,4 @@ initxcolor(Display *disp, int scr, const char *colstr)
die("awesome: error, cannot allocate color '%s'\n", colstr); die("awesome: error, cannot allocate color '%s'\n", colstr);
return color; return color;
} }
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -203,3 +203,4 @@ struct awesome_config
void parse_config(Display *, int, const char *, awesome_config *); /* parse configuration file */ void parse_config(Display *, int, const char *, awesome_config *); /* parse configuration file */
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

2
draw.c
View File

@ -126,3 +126,5 @@ textwidth(Display *disp, XftFont *font, char *text, ssize_t len)
XftTextExtentsUtf8(disp, font, (FcChar8 *) text, len, &gi); XftTextExtentsUtf8(disp, font, (FcChar8 *) text, len, &gi);
return gi.width; return gi.width;
} }
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

1
draw.h
View File

@ -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); void drawcircle(Display *, int, int, int, int, Drawable, int, int, Bool, XColor);
inline unsigned short textwidth(Display *, XftFont *, char *, ssize_t); inline unsigned short textwidth(Display *, XftFont *, char *, ssize_t);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -538,3 +538,4 @@ grabkeys(Display *disp, int screen, awesome_config *awesomeconf)
GrabModeAsync, GrabModeAsync); GrabModeAsync, GrabModeAsync);
} }
} }
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -42,3 +42,4 @@ void handle_event_shape(XEvent *, awesome_config *);
void handle_event_randr_screen_change_notify(XEvent *, awesome_config *); void handle_event_randr_screen_change_notify(XEvent *, awesome_config *);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -288,3 +288,4 @@ uicb_zoom(awesome_config *awesomeconf,
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf->display, awesomeconf);
} }
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -43,3 +43,4 @@ UICB_PROTO(uicb_togglehorizontalmax);
UICB_PROTO(uicb_zoom); UICB_PROTO(uicb_zoom);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -39,3 +39,4 @@ layout_floating(awesome_config *awesomeconf)
resize(c, c->x, c->y, c->w, c->h, awesomeconf, True); 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

View File

@ -26,3 +26,4 @@
LAYOUT_PROTO(layout_floating); LAYOUT_PROTO(layout_floating);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -36,3 +36,4 @@ layout_max(awesome_config *awesomeconf)
si[awesomeconf->screen].height - 2 * c->border, awesomeconf, awesomeconf->resize_hints); si[awesomeconf->screen].height - 2 * c->border, awesomeconf, awesomeconf->resize_hints);
XFree(si); XFree(si);
} }
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -27,3 +27,4 @@
LAYOUT_PROTO(layout_max); LAYOUT_PROTO(layout_max);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -178,3 +178,4 @@ layout_tileleft(awesome_config *awesomeconf)
{ {
_tile(awesomeconf, False); _tile(awesomeconf, False);
} }
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -33,3 +33,4 @@ UICB_PROTO(uicb_setncol);
UICB_PROTO(uicb_setmwfact); UICB_PROTO(uicb_setmwfact);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -249,3 +249,4 @@ uicb_movetoscreen(awesome_config * awesomeconf,
arrange(awesomeconf->display, &awesomeconf[prev_screen - awesomeconf->screen]); arrange(awesomeconf->display, &awesomeconf[prev_screen - awesomeconf->screen]);
arrange(awesomeconf->display, &awesomeconf[new_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

View File

@ -39,3 +39,4 @@ UICB_PROTO(uicb_focusprevscreen);
UICB_PROTO(uicb_movetoscreen); UICB_PROTO(uicb_movetoscreen);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -260,3 +260,4 @@ uicb_setstatustext(awesome_config *awesomeconf, const char *arg)
drawstatusbar(awesomeconf->display, awesomeconf); drawstatusbar(awesomeconf->display, awesomeconf);
} }
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -32,3 +32,4 @@ UICB_PROTO(uicb_togglebar);
UICB_PROTO(uicb_setstatustext); UICB_PROTO(uicb_setstatustext);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

1
tag.c
View File

@ -329,3 +329,4 @@ uicb_tag_viewprev(awesome_config *awesomeconf,
saveawesomeprops(awesomeconf->display, awesomeconf); saveawesomeprops(awesomeconf->display, awesomeconf);
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf->display, awesomeconf);
} }
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

1
tag.h
View File

@ -41,3 +41,4 @@ UICB_PROTO(uicb_tag_viewnext);
UICB_PROTO(uicb_tag_viewprev); UICB_PROTO(uicb_tag_viewprev);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

1
uicb.c
View File

@ -84,3 +84,4 @@ run_uicb(char *cmd, awesome_config *awesomeconf)
return 0; return 0;
} }
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

1
uicb.h
View File

@ -28,3 +28,4 @@ int parse_control(char *, awesome_config *);
int run_uicb(char *, awesome_config *); int run_uicb(char *, awesome_config *);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

1
util.c
View File

@ -225,3 +225,4 @@ ssize_t a_strcpy(char *dst, ssize_t n, const char *src)
return len; return len;
} }
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

1
util.h
View File

@ -207,3 +207,4 @@ void *name_func_lookup(const char *, const NameFuncLink *);
UICB_PROTO(uicb_spawn); UICB_PROTO(uicb_spawn);
UICB_PROTO(uicb_exec); UICB_PROTO(uicb_exec);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=6:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99