Indent
indent
| Créateur | Jim Kingdon (d) |
|---|---|
| Développé par | Projet GNU |
| Première version | [1] |
| Dernière version | 2.2.13 ()[2],[3] |
| Dépôt | git.savannah.gnu.org/cgit/indent.git |
| Système d'exploitation | GNU/Linux, BSD et macOS |
| Environnement | UNIX, BSD, GNU/Linux |
| Langues | Anglais uniquement |
| Type | Indentation |
| Licence | GNU GPL |
| Site web | www.gnu.org/software/indent |
indent est un logiciel libre de mise en forme de codes sources en langage C. Il modifie l'apparence d'un fichier source en ajoutant ou supprimant des espaces et des retours à la ligne.
indent fait partie du projet GNU, Il est distribué selon les termes de la licence GNU GPL.
Exemple
On souhaite indenter le fichier suivant :
/* exemple à indenter */
#include <stdio.h>
int main(void)
{
char msg[] = "hello world\n";
char * end = msg + sizeof (msg);
char * cur;
for(cur = msg; cur != end; ++cur) { putchar(*cur); }
return 0;
}
Avec les paramètres par défaut, on obtient le style GNU:
#include <stdio.h>
int
main (void)
{
char msg[] = "hello world\n";
char *end = msg + sizeof (msg);
char *cur;
for (cur = msg; cur != end; ++cur)
{
putchar (*cur);
}
return 0;
}
Avec l'option -kr (pour "Kernighan and Ritchie"), on obtient :
#include <stdio.h>
int main(void)
{
char msg[] = "hello world\n";
char *end = msg + sizeof(msg);
char *cur;
for (cur = msg; cur != end; ++cur) {
putchar(*cur);
}
return 0;
}
Voir aussi
Articles connexes
Lien externe
- (en) Page officielle
- Portail des logiciels libres
- Portail de la programmation informatique
- ↑ « https://git.savannah.gnu.org/cgit/indent.git/tree/AUTHORS » (consulté le )
- ↑ « NEWS - indent.git » (consulté le )
- ↑ « Indent - GNU Project - Free Software Foundation » (consulté le )