From DoBi-tyndur at gmx.net Tue Mar 1 22:02:08 2011 From: DoBi-tyndur at gmx.net (DoBi-tyndur at gmx.net) Date: Tue, 01 Mar 2011 22:02:08 +0100 Subject: [tyndur-devel] Hangman kommentiert Message-ID: <20110301210208.13380@gmx.net> -- GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit gratis Handy-Flat! http://portal.gmx.net/de/go/dsl -------------- nächster Teil -------------- Ein Dateianhang mit Binärdaten wurde abgetrennt... Dateiname : 0001-Hangman-kommentiert.patch Dateityp : application/octet-stream Dateigröße : 7018 bytes Beschreibung: nicht verfügbar URL : From stefan0stefan26 at googlemail.com Fri Mar 4 21:39:36 2011 From: stefan0stefan26 at googlemail.com (Stefan A) Date: Fri, 4 Mar 2011 21:39:36 +0100 Subject: [tyndur-devel] Tyndur-Installer Message-ID: -------------- nächster Teil -------------- Ein Dateianhang mit HTML-Daten wurde abgetrennt... URL: -------------- nächster Teil -------------- Ein Dateianhang mit Binärdaten wurde abgetrennt... Dateiname : 0001-Installer-um-Tyndur-zu-installieren.patch Dateityp : text/x-patch Dateigröße : 134672 bytes Beschreibung: nicht verfügbar URL : From kevin at tyndur.org Sun Mar 6 17:29:42 2011 From: kevin at tyndur.org (Kevin Wolf) Date: Sun, 6 Mar 2011 17:29:42 +0100 Subject: [tyndur-devel] =?utf-8?q?=5BPATCH=5D_LostIOv2=3A_Syscallnummern_h?= =?utf-8?q?inzuf=C3=BCgen?= Message-ID: <1299428982-14719-1-git-send-email-kevin@tyndur.org> + LostIOv2: Alle benötigten Syscallnummern in den Header einfügen. Dauert zwar sicher noch eine Weile, bis LIOv2 soweit ist, aber das in master zu haben hilft schon mal eine ganze Menge gegen Konflikte. Signed-off-by: Kevin Wolf --- src/include/syscallno.h | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-) diff --git a/src/include/syscallno.h b/src/include/syscallno.h index 1e156ca..ec43668 100644 --- a/src/include/syscallno.h +++ b/src/include/syscallno.h @@ -84,7 +84,34 @@ #define SYSCALL_ADD_TIMER 70 #define SYSCALL_DEBUG_STACKTRACE 80 + +#define SYSCALL_LIO_RESOURCE 85 +#define SYSCALL_LIO_OPEN 86 +#define SYSCALL_LIO_CLOSE 87 +#define SYSCALL_LIO_READ 88 +#define SYSCALL_LIO_WRITE 89 +#define SYSCALL_LIO_SEEK 90 +#define SYSCALL_LIO_MKFILE 91 +#define SYSCALL_LIO_MKDIR 92 +#define SYSCALL_LIO_READ_DIR 93 +#define SYSCALL_LIO_SYNC 94 +#define SYSCALL_LIO_MKSYMLINK 95 +#define SYSCALL_LIO_STAT 96 +#define SYSCALL_LIO_TRUNCATE 97 +#define SYSCALL_LIO_UNLINK 98 +#define SYSCALL_LIO_SYNC_ALL 99 + +#define SYSCALL_LIO_SRV_SERVICE_REGISTER 110 +#define SYSCALL_LIO_SRV_RES_UPLOAD 111 +#define SYSCALL_LIO_SRV_NODE_ADD 112 +#define SYSCALL_LIO_SRV_OP_DONE 113 +#define SYSCALL_LIO_SRV_WAIT 114 +#define SYSCALL_LIO_SRV_REQUEST_CACHE_BLOCKS 115 +#define SYSCALL_LIO_SRV_REQUEST_TRANSLATED_BLOCKS 116 +#define SYSCALL_LIO_SRV_UNBLOCK_CACHE_BLOCKS 117 +#define SYSCALL_LIO_SRV_NODE_REMOVE 118 + //ACHTUNG: Muss eine Zahl groesser als die Groesste Syscall-Nummer sein -#define SYSCALL_MAX 85 +#define SYSCALL_MAX 119 #endif -- 1.6.0.2 From kevin at tyndur.org Sun Mar 6 17:55:47 2011 From: kevin at tyndur.org (Kevin Wolf) Date: Sun, 6 Mar 2011 17:55:47 +0100 Subject: [tyndur-devel] (kein Betreff) In-Reply-To: <20110227124343.31240@gmx.net> References: <20110227124343.31240@gmx.net> Message-ID: <20110306165546.GA24073@silvanus> On Sun, Feb 27, 2011 at 01:43:43PM +0100, DoBi-tyndur at gmx.net wrote: > > -- > Schon gehört? GMX hat einen genialen Phishing-Filter in die > Toolbar eingebaut! http://www.gmx.net/de/go/toolbar > From 9f41dfc617f6e5acf69fa62cce0e556b12584e18 Mon Sep 17 00:00:00 2001 > From: DoBi > Date: Thu, 24 Feb 2011 19:07:38 +0100 > Subject: [PATCH] Neues Programm: Hangman > MIME-Version: 1.0 > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: 8bit > > +Ein neues Programm für Tyndur: Hangman! Es erklärt sich von selbst. Am besten zu 2. Spielen. > Signed-off-by: DoBi Bitte im Signed-off-by deinen echten Namen verwenden. Es wäre auch besser, neue Versionen vom Patch zu schicken anstatt immer neue Patches, die oben drauf angewendet werden müssen. Wenn du Hilfe brauchst, wie du git-Commits zusammenfasst, meld dich mal im IRC. > --- > src/modules/c/hangman/Makefile.all | 8 ++ > src/modules/c/hangman/main.c | 244 ++++++++++++++++++++++++++++++++++++ > 2 files changed, 252 insertions(+), 0 deletions(-) > create mode 100644 src/modules/c/hangman/Makefile.all > create mode 100644 src/modules/c/hangman/main.c > > diff --git a/src/modules/c/hangman/Makefile.all b/src/modules/c/hangman/Makefile.all > new file mode 100644 > index 0000000..0ae2b38 > --- /dev/null > +++ b/src/modules/c/hangman/Makefile.all > @@ -0,0 +1,8 @@ > +shopt -s extglob > +source $LOST_BUILDMK_ROOT/config.sh > + > +echo "LD $1/apps/hangman" > + > +$LOST_TOOLS_LD -ohangman $LDSCRIPT --start-group *.o $2 --end-group > + > +$LOST_TOOLS_STRIP -s hangman -o $1/apps/hangman > diff --git a/src/modules/c/hangman/main.c b/src/modules/c/hangman/main.c > new file mode 100644 > index 0000000..5e4a115 > --- /dev/null > +++ b/src/modules/c/hangman/main.c > @@ -0,0 +1,244 @@ > +// Created by DoBi Hier fehlt der Lizenzheader. > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define bool int > +#define TRUE (1) > +#define FALSE (0) Du willst stdbool.h benutzen. > + > +void ausgabe (int,bool); > + > +char* loesung; > + > +int main(int argc, char** argv) > +{ > + char striche[21]; Einrückungstiefe sind vier Leerzeichen (die Details zu den Anmerkungen zum Codestil kannst du in doc/codestil.txt nachlesen) > + char* eing; > + int versuch = 11; > + int i = 0; > + int z; > + int k; > + int c = 0; > + int l; > + bool treffer; > + > + printf("Hangman!\n"); > + printf("Regeln:\n- keine Zeichen z.B. Ausrufezeichen\n- nicht mehr als 20 Buchstaben\n- Beim raten immer nur einen Buchstaben eingeben\n"); Maximal 80 Zeichen pro Zeile > + > + loesung = readline("Bitte ein Wort eingeben: "); > + > + while(c < 20) > + { Geschweifte Klammer gehört auf die while-Zeile und hinter das while ein Leerzeichen. > + loesung[c]=tolower(loesung[c]); > + c++; > + } > + > + l = strlen(loesung); > + > + if(l > 20) > + { > + printf("Das Wort ist zu lang!\n\n"); > + return 1; > + } > + > + puts("\33[2J\33[H"); Willst du nach diesem String wirklich einen Zeilenumbruch? > + > + while (i<=strlen(loesung)) > + { > + striche[i]=45; > + i++; > + } > + Die letzten paar Zeilen haben einen Haufen Leerzeichen am Zeilenende, die da nicht hingehören. > + striche[strlen(loesung)]='\0'; > + > + printf("Du hast 11 Versuche!\n"); > + printf("Auf das Raten fertig los!\n\n"); > + printf(striche); > + printf("\n"); > + > + for(z=1; z < 12;) > + { > + ausgabe(versuch,0); > + > + eing = readline("Dein Versuch: "); > + > + treffer = FALSE; > + > + k = strlen(eing); > + > + if ((k>1 && strcmp(loesung,eing)!=0) || k>20) Leerzeichen um die Operatoren > + { > + printf("Ungueltige Eingabe\n\n"); > + return 1; > + } > + else > + { > + printf("\n"); > + > + for(i=0; i<=l; i++) > + { > + for(k=0; k + { > + if (loesung[i]==eing[k]) > + { > + striche[i]=loesung[i]; > + treffer=TRUE; > + } > + } > + } > + } > + > + if (treffer==FALSE) > + { > + z++; > + versuch--; > + } > + > + printf("\n"); > + printf(striche); > + printf("\n\n"); > + > + if (strcmp (loesung,striche)==0 || strcmp(loesung,eing)==0 ) > + { > + printf("Glueckwunsch\n\n"); > + printf(striche); > + printf(" war die Loesung\n\n"); > + break; > + } > + > + > + } > + > + ausgabe(versuch,1); > + > + return 0; > +} > + > +void ausgabe(int versuch1, bool a) > +{ > + // Anzahl der Versuche ?berpr?fen + Hangman ausgeben > + if (versuch1 == 11) > + { > + printf(" \n"); > + printf(" \n"); > + printf(" \n"); > + printf(" \n"); > + printf(" \n"); > + printf(" \n"); > + } > + if(versuch1 == 10) > + { > + printf(" \n"); > + printf(" \n"); > + printf(" \n"); > + printf(" \n"); > + printf(" \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 9) > + { > + printf(" \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 8) > + { > + printf(" _______ \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 7) > + { > + printf(" _______ \n"); > + printf(" |/ \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + else if(versuch1 == 6) > + { > + printf(" _______ \n"); > + printf(" |/ | \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 5) > + { > + printf(" _______ \n"); > + printf(" |/ | \n"); > + printf(" | O \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 4) > + { > + printf(" _______ \n"); > + printf(" |/ | \n"); > + printf(" | O \n"); > + printf(" | | \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 3) > + { > + printf(" _______ \n"); > + printf(" |/ | \n"); > + printf(" | O/ \n"); > + printf(" | | \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 2) > + { > + printf(" _______ \n"); > + printf(" |/ | \n"); > + printf(" | O/ \n"); > + printf(" | /| \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 1) > + { > + printf(" _______ \n"); > + printf(" |/ | \n"); > + printf(" | O/ \n"); > + printf(" | /| \n"); > + printf(" | J \n"); > + printf(" _|_ \n"); > + } > + > + if(versuch1 == 0) > + { > + printf(" _______ \n"); > + printf(" |/ | \n"); > + printf(" | O/ \n"); > + printf(" | /| \n"); > + printf(" | J L \n"); > + printf(" _|_ \n"); > + } Ich glaube, ein switch wäre toller. Oder gleich ein Array, das alle "Bilder" enthält. From DoBi-tyndur at gmx.net Mon Mar 7 19:04:48 2011 From: DoBi-tyndur at gmx.net (Dominik Bittner) Date: Mon, 7 Mar 2011 19:04:48 +0100 Subject: [tyndur-devel] Hangman: Kevins Verbesserungen umgesetzt In-Reply-To: <20110306165546.GA24073@silvanus> References: <20110227124343.31240@gmx.net> <20110306165546.GA24073@silvanus> Message-ID: <000801cbdcf2$2701b210$75051630$@net> -----Ursprüngliche Nachricht----- Von: tyndur-devel-bounces at tyndur.org [mailto:tyndur-devel-bounces at tyndur.org] Im Auftrag von Kevin Wolf Gesendet: Sonntag, 6. März 2011 17:56 An: tyndur-Patches Betreff: Re: [tyndur-devel] (kein Betreff) On Sun, Feb 27, 2011 at 01:43:43PM +0100, DoBi-tyndur at gmx.net wrote: > > -- > Schon gehört? GMX hat einen genialen Phishing-Filter in die > Toolbar eingebaut! http://www.gmx.net/de/go/toolbar > From 9f41dfc617f6e5acf69fa62cce0e556b12584e18 Mon Sep 17 00:00:00 2001 > From: DoBi > Date: Thu, 24 Feb 2011 19:07:38 +0100 > Subject: [PATCH] Neues Programm: Hangman > MIME-Version: 1.0 > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: 8bit > > +Ein neues Programm für Tyndur: Hangman! Es erklärt sich von selbst. Am besten zu 2. Spielen. > Signed-off-by: DoBi Bitte im Signed-off-by deinen echten Namen verwenden. Es wäre auch besser, neue Versionen vom Patch zu schicken anstatt immer neue Patches, die oben drauf angewendet werden müssen. Wenn du Hilfe brauchst, wie du git-Commits zusammenfasst, meld dich mal im IRC. > --- > src/modules/c/hangman/Makefile.all | 8 ++ > src/modules/c/hangman/main.c | 244 ++++++++++++++++++++++++++++++++++++ > 2 files changed, 252 insertions(+), 0 deletions(-) > create mode 100644 src/modules/c/hangman/Makefile.all > create mode 100644 src/modules/c/hangman/main.c > > diff --git a/src/modules/c/hangman/Makefile.all b/src/modules/c/hangman/Makefile.all > new file mode 100644 > index 0000000..0ae2b38 > --- /dev/null > +++ b/src/modules/c/hangman/Makefile.all > @@ -0,0 +1,8 @@ > +shopt -s extglob > +source $LOST_BUILDMK_ROOT/config.sh > + > +echo "LD $1/apps/hangman" > + > +$LOST_TOOLS_LD -ohangman $LDSCRIPT --start-group *.o $2 --end-group > + > +$LOST_TOOLS_STRIP -s hangman -o $1/apps/hangman > diff --git a/src/modules/c/hangman/main.c b/src/modules/c/hangman/main.c > new file mode 100644 > index 0000000..5e4a115 > --- /dev/null > +++ b/src/modules/c/hangman/main.c > @@ -0,0 +1,244 @@ > +// Created by DoBi Hier fehlt der Lizenzheader. > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define bool int > +#define TRUE (1) > +#define FALSE (0) Du willst stdbool.h benutzen. > + > +void ausgabe (int,bool); > + > +char* loesung; > + > +int main(int argc, char** argv) > +{ > + char striche[21]; Einrückungstiefe sind vier Leerzeichen (die Details zu den Anmerkungen zum Codestil kannst du in doc/codestil.txt nachlesen) > + char* eing; > + int versuch = 11; > + int i = 0; > + int z; > + int k; > + int c = 0; > + int l; > + bool treffer; > + > + printf("Hangman!\n"); > + printf("Regeln:\n- keine Zeichen z.B. Ausrufezeichen\n- nicht mehr als 20 Buchstaben\n- Beim raten immer nur einen Buchstaben eingeben\n"); Maximal 80 Zeichen pro Zeile > + > + loesung = readline("Bitte ein Wort eingeben: "); > + > + while(c < 20) > + { Geschweifte Klammer gehört auf die while-Zeile und hinter das while ein Leerzeichen. > + loesung[c]=tolower(loesung[c]); > + c++; > + } > + > + l = strlen(loesung); > + > + if(l > 20) > + { > + printf("Das Wort ist zu lang!\n\n"); > + return 1; > + } > + > + puts("\33[2J\33[H"); Willst du nach diesem String wirklich einen Zeilenumbruch? > + > + while (i<=strlen(loesung)) > + { > + striche[i]=45; > + i++; > + } > + Die letzten paar Zeilen haben einen Haufen Leerzeichen am Zeilenende, die da nicht hingehören. > + striche[strlen(loesung)]='\0'; > + > + printf("Du hast 11 Versuche!\n"); > + printf("Auf das Raten fertig los!\n\n"); > + printf(striche); > + printf("\n"); > + > + for(z=1; z < 12;) > + { > + ausgabe(versuch,0); > + > + eing = readline("Dein Versuch: "); > + > + treffer = FALSE; > + > + k = strlen(eing); > + > + if ((k>1 && strcmp(loesung,eing)!=0) || k>20) Leerzeichen um die Operatoren > + { > + printf("Ungueltige Eingabe\n\n"); > + return 1; > + } > + else > + { > + printf("\n"); > + > + for(i=0; i<=l; i++) > + { > + for(k=0; k + { > + if (loesung[i]==eing[k]) > + { > + striche[i]=loesung[i]; > + treffer=TRUE; > + } > + } > + } > + } > + > + if (treffer==FALSE) > + { > + z++; > + versuch--; > + } > + > + printf("\n"); > + printf(striche); > + printf("\n\n"); > + > + if (strcmp (loesung,striche)==0 || strcmp(loesung,eing)==0 ) > + { > + printf("Glueckwunsch\n\n"); > + printf(striche); > + printf(" war die Loesung\n\n"); > + break; > + } > + > + > + } > + > + ausgabe(versuch,1); > + > + return 0; > +} > + > +void ausgabe(int versuch1, bool a) > +{ > + // Anzahl der Versuche ?berpr?fen + Hangman ausgeben > + if (versuch1 == 11) > + { > + printf(" \n"); > + printf(" \n"); > + printf(" \n"); > + printf(" \n"); > + printf(" \n"); > + printf(" \n"); > + } > + if(versuch1 == 10) > + { > + printf(" \n"); > + printf(" \n"); > + printf(" \n"); > + printf(" \n"); > + printf(" \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 9) > + { > + printf(" \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 8) > + { > + printf(" _______ \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 7) > + { > + printf(" _______ \n"); > + printf(" |/ \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + else if(versuch1 == 6) > + { > + printf(" _______ \n"); > + printf(" |/ | \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 5) > + { > + printf(" _______ \n"); > + printf(" |/ | \n"); > + printf(" | O \n"); > + printf(" | \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 4) > + { > + printf(" _______ \n"); > + printf(" |/ | \n"); > + printf(" | O \n"); > + printf(" | | \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 3) > + { > + printf(" _______ \n"); > + printf(" |/ | \n"); > + printf(" | O/ \n"); > + printf(" | | \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 2) > + { > + printf(" _______ \n"); > + printf(" |/ | \n"); > + printf(" | O/ \n"); > + printf(" | /| \n"); > + printf(" | \n"); > + printf(" _|_ \n"); > + } > + if(versuch1 == 1) > + { > + printf(" _______ \n"); > + printf(" |/ | \n"); > + printf(" | O/ \n"); > + printf(" | /| \n"); > + printf(" | J \n"); > + printf(" _|_ \n"); > + } > + > + if(versuch1 == 0) > + { > + printf(" _______ \n"); > + printf(" |/ | \n"); > + printf(" | O/ \n"); > + printf(" | /| \n"); > + printf(" | J L \n"); > + printf(" _|_ \n"); > + } Ich glaube, ein switch wäre toller. Oder gleich ein Array, das alle "Bilder" enthält. _______________________________________________ tyndur-devel mailing list tyndur-devel at tyndur.org http://list.tyndur.org/mailman/listinfo/tyndur-devel From DoBi-tyndur at gmx.net Mon Mar 7 18:59:41 2011 From: DoBi-tyndur at gmx.net (DoBi) Date: Mon, 7 Mar 2011 18:59:41 +0100=0A= Subject: [PATCH] Hangman: Kevins Verbesserungen umgesetzt=0A= Message-ID: =0A= + Lizenz=0A= + stdbool.h benutzt.=0A= + Codestil=0A= ! Max 80 Zeichen pro Zeile.=0A= ! switch anstatt mehrere if-Abfragen.=0A= Signed-off-by: Dominik Bittner =0A= ---=0A= src/modules/c/hangman/Makefile.all | 8 +=0A= src/modules/c/hangman/main.c | 315 = ++++++++++++++++++++++++++++++++++++=0A= 2 files changed, 323 insertions(+), 0 deletions(-)=0A= create mode 100755 src/modules/c/hangman/Makefile.all=0A= create mode 100755 src/modules/c/hangman/main.c=0A= =0A= diff --git a/src/modules/c/hangman/Makefile.all = b/src/modules/c/hangman/Makefile.all=0A= new file mode 100755=0A= index 0000000..0ae2b38=0A= --- /dev/null=0A= +++ b/src/modules/c/hangman/Makefile.all=0A= @@ -0,0 +1,8 @@=0A= +shopt -s extglob=0A= +source $LOST_BUILDMK_ROOT/config.sh=0A= +=0A= +echo "LD $1/apps/hangman"=0A= +=0A= +$LOST_TOOLS_LD -ohangman $LDSCRIPT --start-group *.o $2 --end-group=0A= +=0A= +$LOST_TOOLS_STRIP -s hangman -o $1/apps/hangman=0A= diff --git a/src/modules/c/hangman/main.c b/src/modules/c/hangman/main.c=0A= new file mode 100755=0A= index 0000000..e45f342=0A= --- /dev/null=0A= +++ b/src/modules/c/hangman/main.c=0A= @@ -0,0 +1,315 @@=0A= +/*=0A= + * Copyright (c) 2011 The tyndur Project. All rights reserved.=0A= + *=0A= + * This code is derived from software contributed to the tyndur Project=0A= + * by Dominik Bittner.=0A= + *=0A= + * Redistribution and use in source and binary forms, with or without=0A= + * modification, are permitted provided that the following conditions=0A= + * are met:=0A= + * 1. Redistributions of source code must retain the above copyright=0A= + * notice, this list of conditions and the following disclaimer.=0A= + * 2. Redistributions in binary form must reproduce the above copyright=0A= + * notice, this list of conditions and the following disclaimer in = the=0A= + * documentation and/or other materials provided with the = distribution.=0A= + * 3. All advertising materials mentioning features or use of this = software=0A= + * must display the following acknowledgement:=0A= + * This product includes software developed by the tyndur Project=0A= + * and its contributors.=0A= + * 4. Neither the name of the tyndur Project nor the names of its=0A= + * contributors may be used to endorse or promote products derived=0A= + * from this software without specific prior written permission.=0A= + *=0A= + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=0A= + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT = LIMITED=0A= + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A = PARTICULAR=0A= + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR=0A= + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,=0A= + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,=0A= + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR = PROFITS;=0A= + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF = LIABILITY,=0A= + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE = OR=0A= + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN = IF=0A= + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.=0A= + */=0A= +=0A= +#include =0A= +#include =0A= +#include =0A= +#include =0A= +#include =0A= +#include =0A= +#include =0A= +#include =0A= +=0A= +void ausgabe (int,bool);=0A= +=0A= +char* loesung;=0A= +=0A= +int main(int argc, char** argv)=0A= +{=0A= + /*=0A= + * Variabeln=0A= + */=0A= + char striche[100];=0A= + char* eing;=0A= + int versuch =3D 11;=0A= + int i =3D 0;=0A= + int z;=0A= + int k;=0A= + int c =3D 0;=0A= + int l;=0A= + bool treffer;=0A= + ////////////////////=0A= +=0A= + /*=0A= + * Regeln ausgeben=0A= + */=0A= + printf("Hangman!\n");=0A= + printf("Regeln:\n- keine Zeichen z.B. Ausrufezeichen\n");=0A= + printf("- nicht mehr als 20 Buchstaben\n");=0A= + printf("- Beim raten immer nur einen Buchstaben eingeben\n");=0A= + printf("- Keine Umlaute!\n");=0A= +=0A= + /*=0A= + * Wort einlesen, ueberpruefen ob ueberhaupt ein Wort eingegeben = wurde=0A= + * gegebenenfalls das Programm beenden (kann noch verbessert werden = :-))=0A= + * Wort in Kleinbuchstaben umwandeln=0A= + */=0A= + loesung =3D readline("Bitte ein Wort eingeben: ");=0A= +=0A= + l =3D strlen(loesung);=0A= +=0A= + if(loesung =3D=3D NULL || l < 1) {=0A= + printf("Sie muessen ein Wort eingeben!\n");=0A= + return 1;=0A= + }=0A= +=0A= + while(c < l + 1) {=0A= + loesung[c]=3Dtolower(loesung[c]);=0A= + c++;=0A= + }=0A= + //////////////////////////////////=0A= +=0A= + /*=0A= + * Bildschirm leeren.=0A= + */=0A= +=0A= + puts("\33[2J\33[H");=0A= +=0A= + /*=0A= + * Das Wort 'verschluesseln'=0A= + */=0A= +=0A= + while (i<=3Dstrlen(loesung)) { =0A= + striche[i]=3D45;=0A= + i++;=0A= + }=0A= +=0A= + striche[strlen(loesung)]=3D'\0';=0A= +=0A= + /////////////////////////////////=0A= +=0A= + printf("Du hast 11 Versuche!\n");=0A= + printf("Auf das Raten fertig los!\n\n");=0A= + printf(striche);=0A= + printf("\n");=0A= +=0A= + /*=0A= + * Schleife, die 11 mal durchlaufen wird --> 11 Versuche=0A= + */=0A= +=0A= + for(z=3D1; z < 12;) {=0A= + /*=0A= + * Methode 'ausgabe(int versuch1, bool a)' ausf=FChren=0A= + */=0A= + ausgabe(versuch,0);=0A= +=0A= + treffer =3D false;=0A= +=0A= + /*=0A= + * Versuch einlesen und ueberpruefen ob etwas eingegeben wurde=0A= + * und ob die Eingabe =3D der Loesung ist.=0A= + * Sonst wird der eingegebene Buchstabe 'entschluesselt'=0A= + * und spaeter auch angezeigt.=0A= + */=0A= + eing =3D readline("Dein Versuch: ");=0A= +=0A= + k =3D strlen(eing);=0A= +=0A= + if ((k > 1 && strcmp(loesung,eing) !=3D 0) || eing =3D=3D NULL) = {=0A= + printf("Ungueltige Eingabe\n\n");=0A= + return 1;=0A= + }=0A= + else {=0A= + printf("\n");=0A= +=0A= + for(i=3D0; i<=3Dl; i++) {=0A= + for(k=3D0; k 0 && a =3D=3D 1) {=0A= + printf("Glueckwunsch!\n");=0A= + }=0A= + if(versuch1 <=3D 0) {=0A= + printf("Du Idiot das waere die Loesung gewesen: ");=0A= + printf(loesung);=0A= + printf("\n");=0A= + }=0A= +}=0A= \ No newline at end of file=0A= -- =0A= 1.7.1=0A= =0A= ------=_NextPart_000_0009_01CBDCFA.88C61A10-- From shyxormz at asxsoft.de Wed Mar 9 16:37:04 2011 From: shyxormz at asxsoft.de (Patrick Pokatilo) Date: Wed, 9 Mar 2011 16:37:04 +0100 Subject: [tyndur-devel] =?utf-8?q?=5BPATCH=5D_sinh=2C_cosh=2C_tanh_und_Var?= =?utf-8?q?iationen_hinzugef=C3=BCgt?= Message-ID: <1299685024-28322-1-git-send-email-shyxormz@asxsoft.de> + sinh, cosh, tanh, sinhf, coshf, tanhf, sinhl, coshl, tanhl Signed-off-by: Patrick Pokatilo --- src/modules/include/math.h | 12 +++++++- src/modules/lib/stdlibc/math/fcos.c | 40 +++++++++++++++++++++++++++ src/modules/lib/stdlibc/math/fsin.c | 52 +++++++++++++++++++++++++++++++++++ src/modules/lib/stdlibc/math/ftan.c | 32 +++++++++++++++++++++ 4 files changed, 135 insertions(+), 1 deletions(-) diff --git a/src/modules/include/math.h b/src/modules/include/math.h index 968411b..8aa389c 100644 --- a/src/modules/include/math.h +++ b/src/modules/include/math.h @@ -32,6 +32,8 @@ #define NAN (__builtin_nanf ("")) #define INFINITY (__builtin_inff ()) #define HUGE_VAL (__builtin_huge_val()) +#define HUGE_VALF (__builtin_huge_valf()) +#define HUGE_VALL (__builtin_huge_vall()) #define MAXFLOAT 3.4028234663852886e+38 @@ -96,7 +98,15 @@ long double asinl(long double); double acos(double); float acosf(float); long double acosl(long double); - +double sinh(double); +float sinhf(float); +long double sinhl(long double); +double cosh(double); +float coshf(float); +long double coshl(long double); +double tanh(double); +float tanhf(float); +long double tanhl(long double); double floor(double x); float floorf(float x); diff --git a/src/modules/lib/stdlibc/math/fcos.c b/src/modules/lib/stdlibc/math/fcos.c index ff69b2c..5797908 100644 --- a/src/modules/lib/stdlibc/math/fcos.c +++ b/src/modules/lib/stdlibc/math/fcos.c @@ -82,4 +82,44 @@ long double acosl(long double x) { return res; } +double cosh(double x) { + if (x == NAN) { + return NAN; + } + double res = (exp(x) + exp(-x)) / 2.0; + if (((res == INFINITY) || (res == -INFINITY)) + && (x != INFINITY) && (x != - INFINITY)) + { + errno = ERANGE; + return HUGE_VAL; + } + return res; +} + +float coshf(float x) { + if (x == NAN) { + return NAN; + } + float res = (expf(x) + expf(-x)) / 2.0f; + if (((res == INFINITY) || (res == -INFINITY)) + && (x != INFINITY) && (x != - INFINITY)) + { + errno = ERANGE; + return HUGE_VALF; + } + return res; +} +long double coshl(long double x) { + if (x == NAN) { + return NAN; + } + long double res = (expl(x) + expl(-x)) / 2.0L; + if (((res == INFINITY) || (res == -INFINITY)) + && (x != INFINITY) && (x != - INFINITY)) + { + errno = ERANGE; + return HUGE_VALL; + } + return res; +} diff --git a/src/modules/lib/stdlibc/math/fsin.c b/src/modules/lib/stdlibc/math/fsin.c index e274d5a..cbb2ee8 100644 --- a/src/modules/lib/stdlibc/math/fsin.c +++ b/src/modules/lib/stdlibc/math/fsin.c @@ -80,4 +80,56 @@ long double asinl(long double x) { return res; } +double sinh(double x) { + if (x == NAN) { + return NAN; + } + double res = (exp(x) - exp(-x)) / 2.0; + if (((res == INFINITY) || (res == -INFINITY)) + && (x != INFINITY) && (x != - INFINITY)) + { + errno = ERANGE; + if (x > 0.0) { + return HUGE_VAL; + } else { + return -HUGE_VAL; + } + } + return res; +} + +float sinhf(float x) { + if (x == NAN) { + return NAN; + } + float res = (expf(x) - expf(-x)) / 2.0f; + if (((res == INFINITY) || (res == -INFINITY)) + && (x != INFINITY) && (x != - INFINITY)) + { + errno = ERANGE; + if (x > 0.0f) { + return HUGE_VALF; + } else { + return -HUGE_VALF; + } + } + return res; +} +long double sinhl(long double x) { + if (x == NAN) { + return NAN; + } + long double res = (expl(x) - expl(-x)) / 2.0L; + if (((res == INFINITY) || (res == -INFINITY)) + && (x != INFINITY) && (x != - INFINITY)) + { + errno = ERANGE; + if (x > 0.0L) { + return HUGE_VALL; + } else { + return -HUGE_VALL; + } + } + return res; +} diff --git a/src/modules/lib/stdlibc/math/ftan.c b/src/modules/lib/stdlibc/math/ftan.c index 3919ee7..4990c41 100644 --- a/src/modules/lib/stdlibc/math/ftan.c +++ b/src/modules/lib/stdlibc/math/ftan.c @@ -98,3 +98,35 @@ long double atan2l(long double x, long double y) { return res; } +double tanh(double x) { + if (x == NAN) { + return NAN; + } else if (x == INFINITY) { + return 1.0; + } else if (x == -INFINITY) { + return -1.0; + } + return sinh(x) / cosh(x); +} + +float tanhf(float x) { + if (x == NAN) { + return NAN; + } else if (x == INFINITY) { + return 1.0f; + } else if (x == -INFINITY) { + return -1.0f; + } + return sinhf(x) / coshf(x); +} + +long double tanhl(long double x) { + if (x == NAN) { + return NAN; + } else if (x == INFINITY) { + return 1.0L; + } else if (x == -INFINITY) { + return -1.0L; + } + return sinhl(x) / coshl(x); +} -- 1.7.0.4 From kevin at tyndur.org Sat Mar 26 00:36:28 2011 From: kevin at tyndur.org (Kevin Wolf) Date: Sat, 26 Mar 2011 00:36:28 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=5BPATCH=5D_sinh=2C_cosh=2C_tanh_un?= =?iso-8859-1?q?d_Variationen_hinzugef=FCgt?= In-Reply-To: <1299685024-28322-1-git-send-email-shyxormz@asxsoft.de> References: <1299685024-28322-1-git-send-email-shyxormz@asxsoft.de> Message-ID: <20110325233628.GB17596@silvanus> On Wed, Mar 09, 2011 at 04:37:04PM +0100, Patrick Pokatilo wrote: > + sinh, cosh, tanh, sinhf, coshf, tanhf, sinhl, coshl, tanhl > > Signed-off-by: Patrick Pokatilo > --- > src/modules/include/math.h | 12 +++++++- > src/modules/lib/stdlibc/math/fcos.c | 40 +++++++++++++++++++++++++++ > src/modules/lib/stdlibc/math/fsin.c | 52 +++++++++++++++++++++++++++++++++++ > src/modules/lib/stdlibc/math/ftan.c | 32 +++++++++++++++++++++ > 4 files changed, 135 insertions(+), 1 deletions(-) Danke, ist drin. From arne.hasselbring at googlemail.com Sat Mar 26 18:24:54 2011 From: arne.hasselbring at googlemail.com (Arne Hasselbring) Date: Sat, 26 Mar 2011 18:24:54 +0100 Subject: [tyndur-devel] [PATCH] Mehrsprachige Shell Message-ID: <1301160294-31968-1-git-send-email-arne.hasselbring@googlemail.com> + Alle Befehle sind nun auch auf Englisch verfügbar. Date hat immer noch teilweise deutsche Ausgabe. Außerdem habe ich versucht, die Hilfeausgaben einheitlicher zu gestalten. Signed-off-by: Arne Hasselbring --- src/modules/c/shell/cmds/bench.c | 19 ++- src/modules/c/shell/cmds/bincat.c | 42 ++++-- src/modules/c/shell/cmds/cat.c | 9 +- src/modules/c/shell/cmds/cp.c | 51 ++++--- src/modules/c/shell/cmds/date.c | 31 +++- src/modules/c/shell/cmds/dbg_st.c | 3 +- src/modules/c/shell/cmds/echo.c | 6 + src/modules/c/shell/cmds/free.c | 15 ++- src/modules/c/shell/cmds/kill.c | 9 +- src/modules/c/shell/cmds/ln.c | 11 +- src/modules/c/shell/cmds/ls.c | 16 ++- src/modules/c/shell/cmds/mkdir.c | 6 +- src/modules/c/shell/cmds/pipe.c | 8 +- src/modules/c/shell/cmds/ps.c | 8 +- src/modules/c/shell/cmds/pstree.c | 3 +- src/modules/c/shell/cmds/pwd.c | 3 +- src/modules/c/shell/cmds/read.c | 6 +- src/modules/c/shell/cmds/readlink.c | 6 +- src/modules/c/shell/cmds/rm.c | 48 ++++--- src/modules/c/shell/cmds/sleep.c | 3 +- src/modules/c/shell/cmds/stat.c | 18 ++- src/modules/c/shell/cmds/symlink.c | 8 +- src/modules/c/shell/commmands.c | 13 +- src/modules/c/shell/lang/lang_en.c | 286 ++++++++++++++++++++++++++++++++++- src/modules/c/shell/lang/resstr.h | 91 +++++++++++ src/modules/c/shell/sh | Bin 0 -> 333612 bytes 26 files changed, 592 insertions(+), 127 deletions(-) create mode 100755 src/modules/c/shell/sh diff --git a/src/modules/c/shell/cmds/bench.c b/src/modules/c/shell/cmds/bench.c index 6f134ed..6d8e447 100644 --- a/src/modules/c/shell/cmds/bench.c +++ b/src/modules/c/shell/cmds/bench.c @@ -38,6 +38,7 @@ #include #include #include +#include #define MAX_BLOCK_SIZE 524288 @@ -55,7 +56,7 @@ uint64_t tick_start, tick_end, diff; if (argc != 3) { - printf("bench \n"); + printf(TMS(bench_usage, "\nAufruf: bench \n")); return -1; } @@ -72,7 +73,8 @@ file = fopen(path, "r"); if (file == NULL) { - printf("Konnte '%s' nicht zum lesen oeffnen!\n", path); + printf(TMS(bench_opening_error, + "Konnte '%s' nicht zum lesen öffnen!\n"), path); return EXIT_FAILURE; } @@ -81,7 +83,8 @@ size = bs[i] > n ? n : bs[i]; rsize = fread(buffer, 1, size, file); if (size != rsize) { - printf("Lesefehler.\n"); + printf(TMS(bench_reading_error, + "Beim Lesen ist ein Fehler aufgetreten!\n")); break; } n -= rsize; @@ -90,13 +93,15 @@ tick_end = get_tick_count(); diff = (tick_end - tick_start); if (diff == 0) { - printf("\rBlockgroesse: %6d; %5d/%5d kB uebrig;" - " Rate: -- Byte/s [%lld s] ", + printf(TMS(bench_message_no1, + "\rBlockgroesse: %6d; %5d/%5d kB uebrig;" + " Rate: -- Byte/s [%lld s] "), bs[i], n / 1024, count, diff / 1000000); } else { - printf("\rBlockgroesse: %6d; %5d/%5d kB uebrig;" - " Rate: %10lld Byte/s [%lld s] ", + printf(TMS(bench_message_no2, + "\rBlockgroesse: %6d; %5d/%5d kB uebrig;" + " Rate: %10lld Byte/s [%lld s] "), bs[i], n / 1024, count, ((uint64_t) count * 1024 - n) * 1000000 / diff, diff / 1000000); diff --git a/src/modules/c/shell/cmds/bincat.c b/src/modules/c/shell/cmds/bincat.c index 71b4ad5..2496de6 100644 --- a/src/modules/c/shell/cmds/bincat.c +++ b/src/modules/c/shell/cmds/bincat.c @@ -41,6 +41,7 @@ #include #include #include +#include #define BLOCK_SIZE 1024 @@ -82,21 +83,24 @@ void bincat_display_usage(void); start = strtoull(optarg, NULL, 0); start -= start % 8; if (errno) { - printf("Ihre Startangabe war ungültig!\n"); + printf(TMS(bincat_invalid_start, + "Ihre Startangabe war ungültig!\n")); start = 0; } break; case 'l': length = strtoull(optarg, NULL, 0); if (errno) { - printf("Ihre Längenangabe war ungültig!\n"); + printf(TMS(bincat_invalid_length, + "Ihre Längenangabe war ungültig!\n")); length = 0; } break; case 'e': end = strtoull(optarg, NULL, 0); if (errno) { - printf("Ihre Endangabe war ungültig!\n"); + printf(TMS(bincat_invalid_end, + "Ihre Endangabe war ungültig!\n")); end = 0; } break; @@ -109,7 +113,9 @@ void bincat_display_usage(void); } if (length && end) { - printf("--length und --end schließen sich aus. Verwende --length\n"); + printf(TMS(bincat_length_end, + "--length und --end schließen sich aus." + " Verwende --length.\n")); } else if (end) { length = end - start; } @@ -122,7 +128,9 @@ void bincat_display_usage(void); if (optind + 1 == argc) { path = argv[optind]; } else { - printf("Fehler: bincat kann nur eine Datei auf einmal verarbeiten!\n"); + fprintf(stderr, TMS(bincat_files_error, + "Fehler: bincat kann nur eine Datei auf einmal" + " verarbeiten!\n")); return -1; } @@ -132,7 +140,8 @@ void bincat_display_usage(void); m = start - 8; if (file == NULL) { - printf("Konnte '%s' nicht zum lesen oeffnen!\n", path); + printf(TMS(bincat_opening_error, + "Konnte '%s' nicht zum lesen öffnen!\n"), path); return -1; } else { char buffer[BLOCK_SIZE]; @@ -169,14 +178,17 @@ void bincat_display_usage(void); void bincat_display_usage() { - puts("\nAufruf: bincat [Optionen] \n"); - puts(" -s, --start Gibt die Startposition an"); - puts(" -l, --length Gibt die Ausgabelänge an"); - puts(" -e, --end Gibt die Endposition an\n"); - puts("Falls --length und --end angegeben sind, erhält --length den " - "Vorrang.\n"); - printf("Position und Längen können optional via vorangestelltem 0x auch " - "Hexadezimal\n angegeben werden, müssen aber in jedem Fall ganzzahlige " - "Vielfache der\n Blockgröße (%d Bytes) sein.\n", BLOCK_SIZE); + printf(TMS(bincat_usage, + "\nAufruf: bincat [Optionen] \n\n" + "Optionen:\n" + " -s, --start Gibt die Startposition an\n" + " -l, --length Gibt die Ausgabelänge an\n" + " -e, --end Gibt die Endposition an\n\n" + "Falls --length und --end angegeben sind, erhält" + " --length den Vorrang.\n\n" + "Position und Länge können optional via vorangestelltem '0x'" + " auch hexadezimal\nangegeben werden, müssen aber in jedem Fall" + " ganzzahlige Vielfache der\nBlockgröße (%d Bytes) sein.\n"), + BLOCK_SIZE); } diff --git a/src/modules/c/shell/cmds/cat.c b/src/modules/c/shell/cmds/cat.c index a8320b4..ab80a02 100644 --- a/src/modules/c/shell/cmds/cat.c +++ b/src/modules/c/shell/cmds/cat.c @@ -38,6 +38,7 @@ #include "stdio.h" #include "unistd.h" #include +#include #define BLOCK_SIZE 1024 @@ -60,7 +61,8 @@ void cat_display_usage(void); FILE* file = fopen(path, "r"); if (file == NULL) { - printf("Konnte '%s' nicht zum lesen oeffnen!\n", path); + printf(TMS(cat_opening_error, + "Konnte '%s' nicht zum lesen öffnen!\n"), path); result = EXIT_FAILURE; } else { char buffer[BLOCK_SIZE + 1]; @@ -74,7 +76,8 @@ void cat_display_usage(void); } if (ferror(file)) { - puts("Beim Lesen ist ein Fehler aufgetreten!\n"); + printf(TMS(cat_reading_error, + "Beim Lesen ist ein Fehler aufgetreten!\n")); result = EXIT_FAILURE; } @@ -87,6 +90,6 @@ void cat_display_usage(void); void cat_display_usage() { - puts("\nAufruf: cat "); + printf(TMS(cat_usage, "\nAufruf: cat \n")); } diff --git a/src/modules/c/shell/cmds/cp.c b/src/modules/c/shell/cmds/cp.c index cd817f4..77ae6ec 100644 --- a/src/modules/c/shell/cmds/cp.c +++ b/src/modules/c/shell/cmds/cp.c @@ -44,6 +44,7 @@ #include #include #include +#include #define BUFFER_SIZE 4096 @@ -117,8 +118,9 @@ int cp_recursive(char* src_path, char* dst_path); } if ( (list_size(sources) > 1) && (!is_directory(targetpath)) ) { - fprintf(stderr, - "Fehler: Mehrere Quellen, aber Ziel ist kein Verzeichnis!\n"); + fprintf(stderr, TMS(cp_error_dst_no_dir, + "Fehler: Mehrere Quellen, aber Ziel ist kein" + " Verzeichnis!\n")); goto bad_exit; } @@ -128,18 +130,24 @@ int cp_recursive(char* src_path, char* dst_path); if (recursive) { cp_recursive(src_path, targetpath); } else { - fprintf(stderr, "%s übersprungen (suchen Sie 'cp -r' ?)\n", src_path); + printf(TMS(cp_skip, + "'%s' übersprungen (Meinten Sie 'cp -r'?)\n"), + src_path); goto bad_exit; } } else { result = cp_file(src_path, targetpath); if (result == -1) { - fprintf(stderr, "Konnte die Quelldatei nicht öffnen\n Pfad: %s\n", - src_path); + printf(TMS(cp_src_opening_error, + "Konnte die Quelldatei nicht öffnen!\n" + "Pfad: '%s'\n"), + src_path); goto bad_exit; } else if (result == -2) { - fprintf(stderr, "Konnte die Zieldatei nicht öffnen\n Pfad: %s\n", - targetpath); + printf(TMS(cp_dst_opening_error, + "Konnte die Zieldatei nicht öffnen!\n" + "Pfad: '%s'\n"), + targetpath); goto bad_exit; } } @@ -155,14 +163,14 @@ int cp_recursive(char* src_path, char* dst_path); void cp_display_usage() { - printf("Aufruf: cp [OPTIONEN] \n" - " oder: cp [OPTIONEN] ... \n" - " oder: cp [OPTIONEN] -t ...\n" - "\n" - "Optionen:\n" - " -v --verbose durchgeführte Tätigkeiten erklären\n" - " -r --recursive Verzeichnisse rekursiv kopieren\n" - " -h --help diese Hilfe anzeigen\n"); + printf(TMS(cp_usage, + "\nAufruf: cp [Optionen] \n" + " oder: cp [Optionen] ... \n" + " oder: cp [Optionen] -t ...\n\n" + "Optionen:\n" + " -v, --verbose durchgeführte Tätigkeiten erklären\n" + " -r, --recursive Verzeichnisse rekursiv kopieren\n" + " -h, --help diese Hilfe anzeigen\n")); } int cp_recursive(char* src_path, char* dst_path) @@ -174,13 +182,16 @@ int cp_recursive(char* src_path, char* dst_path) // src_path hilft hier nicht, dst_path ist per asprintf undefiniert, // sollte also nicht verwendet werden. Wahrscheinlichste Fehlerursache // bleibt aber OOM, ergo sind beide Pfade nicht hilfreich. - printf("Fehler beim Setzen des Zielpfades!\n"); + printf(TMS(cp_error_dst_path, + "Fehler beim Setzen des Zielpfades!\n")); return -1; } } if (!directory_create(dst_path)) { - fprintf(stderr, "Fehler: Pfad %s konnte nicht angelegt werden!\n", dst_path); - fprintf(stderr, " %s übersprungen.\n", src_path); + fprintf(stderr, TMS(cp_error_create_dst, + "Fehler: Pfad '%s' konnte nicht angelegt werden!\n" + " '%s' übersprungen.\n"), + dst_path, src_path); if (length >= 0) { free(dst_path); } @@ -253,7 +264,9 @@ int cp_file(char* src_path, char* dst_path) { while (!feof(src)) { size_t length = fread(buffer, 1, BUFFER_SIZE, src); if (ferror(src)) { - fprintf(stderr, "Fehler beim Lesen der Quelldatei\n"); + printf(TMS(cp_error_src_read, + "Beim Lesen der Quelldatei ist ein Fehler" + " aufgetreten!\n")); fclose(src); fclose(dst); return -3; diff --git a/src/modules/c/shell/cmds/date.c b/src/modules/c/shell/cmds/date.c index c8f3486..de55fcb 100644 --- a/src/modules/c/shell/cmds/date.c +++ b/src/modules/c/shell/cmds/date.c @@ -38,6 +38,7 @@ #include "stdlib.h" #include "stdio.h" #include +#include void date_display_usage(void); @@ -66,37 +67,51 @@ void date_display_usage(void); bool error = false; if (weekday_file == NULL) { - puts("Konnte 'cmos:/date/weekday' nicht zum lesen oeffnen!"); + printf(TMS(date_opening_error, + "Konnte '%s' nicht zum lesen öffnen!"), + "cmos:/date/weekday"); error = true; } if (day_file == NULL) { - puts("Konnte 'cmos:/date/day' nicht zum lesen oeffnen!"); + printf(TMS(date_opening_error, + "Konnte '%s' nicht zum lesen öffnen!"), + "cmos:/date/day"); error = true; } if (month_file == NULL) { - puts("Konnte 'cmos:/date/month' nicht zum lesen oeffnen!"); + printf(TMS(date_opening_error, + "Konnte '%s' nicht zum lesen öffnen!"), + "cmos:/date/month"); error = true; } if (year_file == NULL) { - puts("Konnte 'cmos:/date/year' nicht zum lesen oeffnen!"); + printf(TMS(date_opening_error, + "Konnte '%s' nicht zum lesen öffnen!"), + "cmos:/date/year"); error = true; } if (seconds_file == NULL) { - puts("Konnte 'cmos:/time/seconds' nicht zum lesen oeffnen!\n"); + printf(TMS(date_opening_error, + "Konnte '%s' nicht zum lesen öffnen!"), + "cmos:/date/seconds"); error = true; } if (minutes_file == NULL) { - puts("Konnte 'cmos:/time/minutes' nicht zum lesen oeffnen!\n"); + printf(TMS(date_opening_error, + "Konnte '%s' nicht zum lesen öffnen!"), + "cmos:/date/minutes"); error = true; } if (hours_file == NULL) { - puts("Konnte 'cmos:/time/hours' nicht zum lesen oeffnen!\n"); + printf(TMS(date_opening_error, + "Konnte '%s' nicht zum lesen öffnen!"), + "cmos:/date/hour"); error = true; } @@ -140,6 +155,6 @@ void date_display_usage(void); void date_display_usage() { - puts("\nAufruf: date"); + printf(TMS(date_usage, "\nAufruf: date\n")); } diff --git a/src/modules/c/shell/cmds/dbg_st.c b/src/modules/c/shell/cmds/dbg_st.c index d5ea7ba..1089759 100644 --- a/src/modules/c/shell/cmds/dbg_st.c +++ b/src/modules/c/shell/cmds/dbg_st.c @@ -41,6 +41,7 @@ #include #include #include +#include void dbg_st_display_usage(void); @@ -63,6 +64,6 @@ void dbg_st_display_usage(void); void dbg_st_display_usage() { - puts("\nAufruf: dbg_st "); + printf(TMS(dbg_st_usage, "\nAufruf: dbg_st \n")); } diff --git a/src/modules/c/shell/cmds/echo.c b/src/modules/c/shell/cmds/echo.c index fdb42b7..12f4094 100644 --- a/src/modules/c/shell/cmds/echo.c +++ b/src/modules/c/shell/cmds/echo.c @@ -37,6 +37,7 @@ #include "stdio.h" #include "stdlib.h" #include +#include #ifdef CONFIG_SHELL_BUILTIN_ONLY int shell_command_echo(int argc, char* argv[], const char* args) @@ -45,6 +46,11 @@ #endif { int i; + + if (argc < 2) { + printf(TMS(echo_usage, "\nAufruf: echo \n")); + return EXIT_FAILURE; + } for (i = 1; i < argc; i++) { printf("%s ", argv[i]); diff --git a/src/modules/c/shell/cmds/free.c b/src/modules/c/shell/cmds/free.c index 20bdf28..a4b4fa4 100644 --- a/src/modules/c/shell/cmds/free.c +++ b/src/modules/c/shell/cmds/free.c @@ -37,6 +37,7 @@ #include "syscall.h" #include "stdio.h" #include +#include #ifdef CONFIG_SHELL_BUILTIN_ONLY int shell_command_free(int argc, char* argv[], const char* args) @@ -44,12 +45,20 @@ int main(int argc, char* argv[]) #endif { + if (argc != 1) { + printf(TMS(free_usage, "\nAufruf: free\n")); + return 1; + } + memory_info_t meminfo = memory_info(); - printf("\n%10d Bytes belegt\n", meminfo.total - meminfo.free); - printf("%10d Bytes frei\n", meminfo.free); + printf(TMS(free_used, + "\n%10d Bytes belegt\n"), meminfo.total - meminfo.free); + printf(TMS(free_free, + "%10d Bytes frei\n"), meminfo.free); printf("----------\n"); - printf("%10d Bytes gesamt\n\n", meminfo.total); + printf(TMS(free_all, + "%10d Bytes gesamt\n\n"), meminfo.total); return 0; } diff --git a/src/modules/c/shell/cmds/kill.c b/src/modules/c/shell/cmds/kill.c index 48f60d8..663e664 100644 --- a/src/modules/c/shell/cmds/kill.c +++ b/src/modules/c/shell/cmds/kill.c @@ -40,6 +40,7 @@ #include #include +#include static void kill_display_usage(void); @@ -58,14 +59,14 @@ static void kill_display_usage(void); pid_t pid = atoi(argv[1]); if (!pid) { - printf("Prozess %d nicht gefunden\n", pid); + printf(TMS(kill_not_found, "Prozess %d nicht gefunden!\n"), pid); return EXIT_FAILURE; } ret = kill(pid, SIGTERM); if (ret < 0) { - printf("Konnte Prozess %d nicht beenden: %d (%s)\n", pid, errno, - strerror(errno)); + printf(TMS(kill_error, "Konnte Prozess %d nicht beenden: %d (%s)\n"), + pid, errno, strerror(errno)); return EXIT_FAILURE; } @@ -74,6 +75,6 @@ static void kill_display_usage(void); static void kill_display_usage() { - puts("\nAufruf: kill "); + printf(TMS(kill_usage, "\nAufruf: kill \n")); } diff --git a/src/modules/c/shell/cmds/ln.c b/src/modules/c/shell/cmds/ln.c index 4172a46..75360c8 100644 --- a/src/modules/c/shell/cmds/ln.c +++ b/src/modules/c/shell/cmds/ln.c @@ -39,6 +39,7 @@ #include "unistd.h" #include "dir.h" #include +#include void ln_display_usage(void); @@ -56,7 +57,8 @@ void ln_display_usage(void); int result = io_create_link(argv[1], argv[2], true); if (result != 0) { - puts("Fehler beim Anlegen des Links"); + printf(TMS(ln_error, + "Fehler beim Anlegen des Links!\n")); return EXIT_FAILURE; } @@ -65,8 +67,9 @@ void ln_display_usage(void); void ln_display_usage() { - puts("\nAufruf: ln "); - puts("\nHardlink zur Datei/zum Verzeichnis an " - "erstellen"); + printf(TMS(ln_usage, + "\nAufruf: ln \n\n" + "Hardlink zur Datei/zum Verzeichnis an " + " erstellen.\n")); } diff --git a/src/modules/c/shell/cmds/ls.c b/src/modules/c/shell/cmds/ls.c index 31be746..2e786a4 100644 --- a/src/modules/c/shell/cmds/ls.c +++ b/src/modules/c/shell/cmds/ls.c @@ -41,6 +41,7 @@ #include #include #include +#include void ls_display_usage(void); char* format_size(size_t size, bool human_readable); @@ -128,7 +129,8 @@ char* format_size(size_t size, bool human_readable); directory_close(dir_res); } else { - printf("Konnte '%s' nicht zum lesen öffnen!\n", dir_path); + printf(TMS(ls_opening_error, + "Konnte '%s' nicht zum lesen öffnen!\n"), dir_path); success = false; } if (list_size(dirs) > 0) { @@ -171,10 +173,12 @@ char* format_size(size_t size, bool human_readable) void ls_display_usage() { - puts("\nAufruf: ls [Optionen] [Verzeichnisse]\n"); - puts(" -a, --all zeigt versteckte Dateien an"); - puts(" -h, --human-readable zeigt die Dateigröße menschenlesbar an " - "(z.b. 10M, 1G)"); - puts(" --help zeigt diese Hilfe an"); + printf(TMS(ls_usage, "\nAufruf: ls [Optionen] [Verzeichnisse]\n\n" + "Optionen:\n" + " -a, --all zeige versteckte Dateien" + " an\n" + " -h, --humal-readable zeige Dateigröße" + " menschenlesbar an (z.B. 10M, 1G)\n" + " --help diese Hilfe anzeigen\n")); } diff --git a/src/modules/c/shell/cmds/mkdir.c b/src/modules/c/shell/cmds/mkdir.c index f3c7db3..9483586 100644 --- a/src/modules/c/shell/cmds/mkdir.c +++ b/src/modules/c/shell/cmds/mkdir.c @@ -39,6 +39,7 @@ #include "unistd.h" #include "dir.h" #include +#include void mkdir_display_usage(void); @@ -54,7 +55,8 @@ void mkdir_display_usage(void); } if (directory_create(argv[1]) == false) { - printf("mkdir: kann Verzeichnis '%s' nicht anlegen\n", argv[1]); + printf(TMS(mkdir_error, + "Konnte Verzeichnis '%s' nicht anlegen!\n"), argv[1]); } @@ -63,6 +65,6 @@ void mkdir_display_usage(void); void mkdir_display_usage() { - puts("\nAufruf: mkdir "); + printf(TMS(mkdir_usage, "\nAufruf: mkdir \n")); } diff --git a/src/modules/c/shell/cmds/pipe.c b/src/modules/c/shell/cmds/pipe.c index 2f2dfdd..b31ab34 100644 --- a/src/modules/c/shell/cmds/pipe.c +++ b/src/modules/c/shell/cmds/pipe.c @@ -39,6 +39,7 @@ #include #include #include +#include void pipe_display_usage(void); @@ -125,9 +126,10 @@ void pipe_display_usage(void); } } fclose(f); - printf("\nVerbindung beendet.\n"); + printf(TMS(pipe_close, "\nVerbindung beendet.\n")); } else { - puts("Konnte Datei nicht oeffnen"); + printf(TMS(pipe_opening_error, + "Konnte Datei nicht öffnen!\n")); } return EXIT_SUCCESS; @@ -135,6 +137,6 @@ void pipe_display_usage(void); void pipe_display_usage() { - puts("\nAufruf: pipe [-c|-a] "); + printf(TMS(pipe_usage, "\nAufruf: pipe [-c|-a] \n")); } diff --git a/src/modules/c/shell/cmds/ps.c b/src/modules/c/shell/cmds/ps.c index 94e3843..0ff7bdc 100644 --- a/src/modules/c/shell/cmds/ps.c +++ b/src/modules/c/shell/cmds/ps.c @@ -40,6 +40,7 @@ #include "syscall.h" #include "unistd.h" #include +#include void ps_display_usage(void); @@ -73,9 +74,10 @@ void ps_display_usage(void); uint32_t i; if (with_eip) { - puts(" PID PPID Status eip Speicher CMD"); + printf(TMS(ps_with_eip, + " PID PPID Status EIP Speicher CMD\n")); } else { - puts(" PID PPID Status Speicher CMD"); + printf(TMS(ps_without_eip, " PID PPID Status Speicher CMD\n")); } for (i = 0; i < task_info->task_count; i++) { @@ -112,6 +114,6 @@ void ps_display_usage(void); void ps_display_usage() { - puts("\nAufruf: ps [--with-eip]"); + printf(TMS(ps_usage, "\nAufruf: ps [--with-eip]\n")); } diff --git a/src/modules/c/shell/cmds/pstree.c b/src/modules/c/shell/cmds/pstree.c index 4ff50ff..8420902 100644 --- a/src/modules/c/shell/cmds/pstree.c +++ b/src/modules/c/shell/cmds/pstree.c @@ -40,6 +40,7 @@ #include "syscall.h" #include "unistd.h" #include +#include void pstree_display_usage(void); void pstree_show_children(pid_t pid, uint8_t depth); @@ -65,7 +66,7 @@ task_info_t* task_info; void pstree_display_usage() { - puts("\nAufruf: pstree"); + printf(TMS(pstree_usage, "\nAufruf: pstree\n")); } void pstree_show_children(pid_t pid, uint8_t depth) diff --git a/src/modules/c/shell/cmds/pwd.c b/src/modules/c/shell/cmds/pwd.c index 00315ee..ed5cea8 100644 --- a/src/modules/c/shell/cmds/pwd.c +++ b/src/modules/c/shell/cmds/pwd.c @@ -38,6 +38,7 @@ #include "stdio.h" #include "unistd.h" #include +#include void pwd_display_usage(void); @@ -61,6 +62,6 @@ void pwd_display_usage(void); void pwd_display_usage() { - puts("\nAufruf: pwd"); + printf(TMS(pwd_usage, "\nAufruf: pwd\n")); } diff --git a/src/modules/c/shell/cmds/read.c b/src/modules/c/shell/cmds/read.c index 0b836e7..6806e84 100644 --- a/src/modules/c/shell/cmds/read.c +++ b/src/modules/c/shell/cmds/read.c @@ -42,6 +42,7 @@ #include #include #include +#include static void read_display_usage(void); @@ -68,6 +69,7 @@ static void read_display_usage(void); void read_display_usage(void) { - puts("Aufruf: read \n"); - puts(" Liest die Umgebungsvariable von der Standardeingabe ein"); + printf(TMS(read_usage, "\nAufruf: read \n\n" + "Liest die Umgebungsvariable von der" + " Standardeingabe ein.\n")); } diff --git a/src/modules/c/shell/cmds/readlink.c b/src/modules/c/shell/cmds/readlink.c index 2c31bd3..7936d75 100644 --- a/src/modules/c/shell/cmds/readlink.c +++ b/src/modules/c/shell/cmds/readlink.c @@ -39,6 +39,7 @@ #include "unistd.h" #include "io.h" #include +#include void readlink_display_usage(void); @@ -58,7 +59,8 @@ void readlink_display_usage(void); FILE* file = fopen(argv[1], "lr"); if (file == NULL) { - puts("Fehler: Symlink konnte nicht gelesen werden."); + fprintf(stderr, TMS(readlink_error, + "Fehler: Symlink konnte nicht gelesen werden!\n")); return -1; } @@ -73,6 +75,6 @@ void readlink_display_usage(void); void readlink_display_usage() { - puts("\nAufruf: readlink "); + printf(TMS(readlink_usage, "\nAufruf: readlink \n")); } diff --git a/src/modules/c/shell/cmds/rm.c b/src/modules/c/shell/cmds/rm.c index 83b4a42..d5bef15 100644 --- a/src/modules/c/shell/cmds/rm.c +++ b/src/modules/c/shell/cmds/rm.c @@ -44,6 +44,7 @@ #include #include #include +#include void rm_display_usage(void); int rm_recursive(char* src_path, bool recurse, bool verbose, int interactive); @@ -116,7 +117,8 @@ enum { rm_display_usage(); return EXIT_SUCCESS; case '?': - printf("rm: Unbekannter Parameter: '%c'\n", optopt); + printf(TMS(rm_invalid_param, + "Unbekannter Parameter: '%c'\n"), optopt); return EXIT_FAILURE; default: break; @@ -124,7 +126,7 @@ enum { } if (optind >= argc) { - printf("Probiere \'rm --help\' für mehr Informationen\n"); + printf(TMS(rm_help, "Probiere 'rm --help' für mehr Informationen.\n")); return EXIT_FAILURE; } @@ -142,7 +144,8 @@ enum { directory = is_directory(src_path); if (directory) { if (!recursive) { - printf("rm: \'%s/\' ist ein Verzeichnis: Übersprungen\n", + printf(TMS(rm_isdir, "'%s/' ist ein Verzeichnis:" + " Übersprungen\n"), src_path); result = -1; } else { @@ -163,17 +166,20 @@ enum { void rm_display_usage() { - puts("Aufruf: rm \n"); - puts("Hardlink an loeschen. Falls es sich um den Letzten " - "handelt, wird die\n Datei/das Verzeichnis gelöscht.\n\n" - "Optionen:\n" - " -r --recursive Verzeichnis rekursiv löschen\n" - " -v --verbose Statusmeldungen anzeigen\n" - " -i --interactive " - "Jedesmal fragen ob gelöscht werden soll\n" - " -I --interactive " - "Einmal fragen ob gelöscht werden soll\n" - " -h --help diese Hilfe anzeigen\n"); + printf(TMS(rm_usage, + "\nAufruf: rm [Optionen] \n\n" + "Optionen:\n" + " -r, --recursive Verzeichnis rekursiv löschen\n" + " -v, --verbose Statusmeldungen anzeigen\n" + " -i, --interactive \n" + " once: Einmal fragen, ob " + " gelöscht werden soll\n" + " always: Immer fragen, ob " + " gelöscht werden soll\n" + " never: Nie fragen, ob " + " gelöscht werden soll\n" + " -h, --help diese Hilfe anzeigen\n\n" + "Anstatt -i once kann auch -I verwendet werden.\n")); } int rm_recursive(char* src_path, bool recurse, bool verbose, int interactive) @@ -184,27 +190,27 @@ int rm_recursive(char* src_path, bool recurse, bool verbose, int interactive) char c; struct stat buf; if ((stat(src_path, &buf))) { - printf("rm: \'%s\' ist inexistent\n", src_path); + printf(TMS(rm_doesnt_exist, "'%s' ist inexistent!\n"), src_path); return -1; } switch (interactive) { case INTERACTIVE_ALWAYS: - printf("rm: \'%s\' löschen? \n", src_path); + printf(TMS(rm_question_del, "'%s' löschen?\n"), src_path); fflush(stdout); while ((c = getchar()) == EOF); if (c != 'y') { - printf("rm: \'%s\' übersprungen\n", src_path); + printf(TMS(rm_message_skip, "'%s' übersprungen.\n"), src_path); return -1; // Fehlschlag } break; case INTERACTIVE_ONCE: - printf("rm: \'%s\' löschen? \n", src_path); + printf(TMS(rm_question_del, "'%s' löschen?\n"), src_path); fflush(stdout); while ((c = getchar()) == EOF); if (c != 'y') { - printf("rm: \'%s\' übersprungen\n", src_path); + printf(TMS(rm_message_skip, "'%s' übersprungen.\n"), src_path); return -1; } interactive = INTERACTIVE_NEVER; @@ -213,7 +219,7 @@ int rm_recursive(char* src_path, bool recurse, bool verbose, int interactive) break; } if (verbose) { - printf("Lösche \'%s\'\n", src_path); + printf(TMS(rm_message_del, "Lösche '%s'.\n"), src_path); } if (recurse && (dir_res = directory_open(src_path))) { io_direntry_t* direntry; @@ -235,7 +241,7 @@ int rm_recursive(char* src_path, bool recurse, bool verbose, int interactive) } else { result = io_remove_link(src_path); if (result != 0) { - printf("rm: \'%s/\' konnte nicht gelöscht werden \n", src_path); + printf(TMS(rm_error, "'%s' konnte nicht gelöscht werden!\n"), src_path); } } return result; diff --git a/src/modules/c/shell/cmds/sleep.c b/src/modules/c/shell/cmds/sleep.c index 04087d4..a85dd8b 100644 --- a/src/modules/c/shell/cmds/sleep.c +++ b/src/modules/c/shell/cmds/sleep.c @@ -39,6 +39,7 @@ #include #include #include +#include void sleep_display_usage(void); @@ -63,5 +64,5 @@ void sleep_display_usage(void); void sleep_display_usage() { - puts("\nAufruf: sleep "); + printf(TMS(sleep_usage, "\nAufruf: sleep \n")); } diff --git a/src/modules/c/shell/cmds/stat.c b/src/modules/c/shell/cmds/stat.c index af47c4b..ab6d9e6 100644 --- a/src/modules/c/shell/cmds/stat.c +++ b/src/modules/c/shell/cmds/stat.c @@ -39,6 +39,7 @@ #include #include #include +#include void stat_display_usage(void); void stat_display_results(const char* path, struct stat* stat_buf); @@ -59,7 +60,7 @@ void stat_display_results(const char* path, struct stat* stat_buf); path = argv[1]; if (stat(path, &stat_buf) != 0) { - puts("Fehler: Datei nicht gefunden."); + fprintf(stderr, TMS(stat_error, "Fehler: Datei nicht gefunden!\n")); return EXIT_FAILURE; } stat_display_results(path, &stat_buf); @@ -68,20 +69,21 @@ void stat_display_results(const char* path, struct stat* stat_buf); void stat_display_usage() { - puts("\nAufruf: stat "); + printf(TMS(stat_usage, "\nAufruf: stat \n")); } void stat_display_results(const char* path, struct stat* stat_buf) { - printf(" Datei: '%s'\n", path); - printf(" Groesse: %8d Blocks: %8d Blockgroesse: %8d\n", stat_buf-> - st_size, stat_buf->st_blocks, stat_buf->st_blksize); - printf(" Typ: "); + printf(TMS(stat_message_no1, " Datei: '%s'\n"), path); + printf(TMS(stat_message_no2, " Groesse: %8d Blocks: %8d Blockgroesse:" + " %8d\n"), stat_buf->st_size, + stat_buf->st_blocks, stat_buf->st_blksize); + printf(TMS(stat_message_no3, " Typ: ")); if (S_ISDIR(stat_buf->st_mode)) { - printf("Verzeichnis"); + printf(TMS(stat_message_no4, "Verzeichnis")); } else { - printf("Regulaere Datei"); + printf(TMS(stat_message_no5, "Regulaere Datei")); } printf("\n"); diff --git a/src/modules/c/shell/cmds/symlink.c b/src/modules/c/shell/cmds/symlink.c index c1dcc43..2bf49a3 100644 --- a/src/modules/c/shell/cmds/symlink.c +++ b/src/modules/c/shell/cmds/symlink.c @@ -40,6 +40,7 @@ #include #include #include +#include void symlink_display_usage(void); @@ -57,7 +58,9 @@ void symlink_display_usage(void); FILE* file = fopen(argv[1], "lw"); if (file == NULL) { - puts("Fehler: Symlink konnte nicht erstellt werden."); + fprintf(stderr, TMS(symlink_error, + "Fehler: Symlink konnte nicht erstellt" + " werden!\n")); return -1; } @@ -70,6 +73,7 @@ void symlink_display_usage(void); void symlink_display_usage() { - puts("\nAufruf: symlink "); + printf(TMS(symlink_usage, "\nAufruf: symlink " + " \n")); } diff --git a/src/modules/c/shell/commmands.c b/src/modules/c/shell/commmands.c index a228b75..816aae2 100644 --- a/src/modules/c/shell/commmands.c +++ b/src/modules/c/shell/commmands.c @@ -127,7 +127,7 @@ int shell_command_start(int argc, char* argv[], const char* cmd) DEBUG_MSG("start"); if (argc < 2) { - puts(TMS(start_usage, "Aufruf: start [Argumente ...]")); + printf(TMS(start_usage, "\nAufruf: start [Argumente ...]\n")); return -1; } @@ -255,7 +255,7 @@ int shell_command_cd(int argc, char* argv[], const char* args) dir = opendir(path); if (dir == NULL) { printf(TMS(cd_error, "Wechseln in das Verzeichnis '%s' " - "nicht moeglich\n"), path); + "nicht möglich!\n"), path); } else { chdir(path); closedir(dir); @@ -265,7 +265,7 @@ int shell_command_cd(int argc, char* argv[], const char* args) return 0; usage: - puts(TMS(cd_usage, "Aufruf: cd ")); + puts(TMS(cd_usage, "\nAufruf: cd ")); return -1; } @@ -273,7 +273,7 @@ int shell_command_source(int argc, char* argv[], const char* args) { const char* path; if (argc != 2) { - puts(TMS(source_usage, "Aufruf: source ")); + printf(TMS(source_usage, "\nAufruf: source \n")); return -1; } @@ -281,7 +281,7 @@ int shell_command_source(int argc, char* argv[], const char* args) if (shell_script(path)) { return 0; } else { - printf(TMS(source_error, "Ausfuehren des Skripts '%s' " + printf(TMS(source_error, "Ausführen des Skripts '%s' " "fehlgeschlagen.\n"), path); return -1; } @@ -347,7 +347,8 @@ void set_list_vars() void set_display_usage() { - puts(TMS(set_usage, "\nAufruf: set [-d] [ []]\n" + puts(TMS(set_usage, "\nAufruf: set [-d] [ []]\n\n" + "Optionen:\n" " -d: Defaultwert setzen. Wenn die Variable schon gesetzt ist, wird " "ihr Wert\n nicht geändert.\n")); } diff --git a/src/modules/c/shell/lang/lang_en.c b/src/modules/c/shell/lang/lang_en.c index 97709ab..8b8782a 100644 --- a/src/modules/c/shell/lang/lang_en.c +++ b/src/modules/c/shell/lang/lang_en.c @@ -42,22 +42,23 @@ static const struct tms_strings dict[] = { "Executable not found", &__tms_cmd_start_usage, - "Usage: start [arguments ...]", + "\nUsage: start [arguments ...]\n", &__tms_cmd_cd_error, "Cannot change to directory '%s'\n", &__tms_cmd_cd_usage, - "Usage: cd ", + "\nUsage: cd \n", &__tms_cmd_source_error, "Cannot execute script '%s'\n", &__tms_cmd_source_usage, - "Usage: source ", + "\nUsage: source \n", &__tms_cmd_set_usage, - "\nUsage: set [-d] [] []\n" + "\nUsage: set [-d] [] []\n\n" + "Options:\n" " -d: Set a default value. If the variable is already set, its value is\n" " not changed\n", @@ -100,15 +101,290 @@ static const struct tms_strings dict[] = { " down.\n" "Any other key returns to the current position.\n" "\n", + + &__tms_shell_usage, - "Usage:\n" + "\nUsage:\n" " Interactive: sh\n" " Batch mode: sh