Bonjour,
- Voici quelques règles à respecter pour que chacun puisse lire le codes des autres sans avoir à ré-indenter à chaque mise à jour. Avant de mettre à jour utilisez la commande astyle :
Code : Sélectionner tout - Visualiser dans une fenêtre à part astyle --indent=spaces=2 --brackets=break --indent-switches --indent-preprocessor --pad=paren-out --pad=oper --convert-tabs gtksdl.c- Voici le modèle des fichier .c :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 /* * Copyright (C) <Année> <Auteur> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* macros =================================================================== */ /* constants ================================================================ */ /* types ==================================================================== */ /* structures =============================================================== */ /* private variables ======================================================== */ /* private functions ======================================================== */ /* internal public functions ================================================ */ /* entry points ============================================================= */ /* public variables ========================================================= */- Pour les fichier .h :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 /* * Copyright (C) <Année> <Auteur> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef H_<initials>_<file>_<date> #define H_<initials>_<file>_<date> /* macros =================================================================== */ /* constants ================================================================ */ /* types ==================================================================== */ /* structures =============================================================== */ /* internal public functions ================================================ */ /* entry points ============================================================= */ /* public variables ========================================================= */ /* inline public functions ================================================= */ #endif /* not H_<initials>_<file>_<date> */- Mis à part pour le fichier contenant la fonction main, à chaque fichier source (.c) correspond un fichier d'entête (.h). Ce dernier doit être inclue dans le fichier source en premier : cela permet de vérifier qu'il ne manque pas de d'include dans le fichier d'entête.
- Au minimum commenter le prototype de vos fonctions en respectant les standard de gtk-doc.
Partager