Dear GNUsteppers, Hereby, I want to share with you a modification to the StepTalk module.
The SimpleTranscript is the primary way of outputting textual information to the user's console. The converse was missing: no input could have been read from the console. I have added the following method to the class SimpleTranscript: -(NSString*)readLine:(NSString*)prompt; Currently, this now uses libreadline and tools based on StepTalk must therefore be linked with libreadline. But this is open to discussion. ;-) Thanks for inclusion into CVS Alex. Alexander V. Diemand Swiss Institute of Bioinformatics Chemin des Boveresses 155 fon ++41 (0)79 213 05 71 CH-1066 Epalinges s. Lausanne fax ++41 (0)21 692 59 45 Switzerland
Index: GNUmakefile
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/StepTalk/Modules/SimpleTranscript/GNUmakefile,v
retrieving revision 1.7
diff -u -r1.7 GNUmakefile
--- GNUmakefile 6 Aug 2003 18:02:52 -0000 1.7
+++ GNUmakefile 3 Oct 2003 11:22:21 -0000
@@ -40,6 +40,8 @@
ADDITIONAL_OBJCFLAGS = -Wall -Wno-import
+ADDITIONAL_TOOL_LIBS += -lreadline
+
-include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/bundle.make
-include GNUMakefile.postamble
Index: SimpleTranscript.h
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/StepTalk/Modules/SimpleTranscript/SimpleTranscript.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 SimpleTranscript.h
--- SimpleTranscript.h 13 May 2002 22:13:12 -0000 1.1.1.1
+++ SimpleTranscript.h 3 Oct 2003 11:22:21 -0000
@@ -31,4 +31,5 @@
+ sharedTranscript;
- show:(id)anObject;
- showLine:(id)anObject;
+- (NSString*)readLine:(NSString*)prompt;
@end
Index: SimpleTranscript.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/StepTalk/Modules/SimpleTranscript/SimpleTranscript.m,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 SimpleTranscript.m
--- SimpleTranscript.m 13 May 2002 22:13:12 -0000 1.1.1.1
+++ SimpleTranscript.m 3 Oct 2003 11:22:21 -0000
@@ -31,6 +31,7 @@
#import <Foundation/NSString.h>
#include <stdio.h>
+#include <readline/readline.h>
static Class NSString_class;
static Class NSNumber_class;
@@ -81,4 +82,19 @@
return self;
}
+
+
+-(NSString*)readLine:(NSString*)prompt
+{
+ NSString *resret=nil;
+ char *res;
+ res = readline([prompt cString]);
+ if (res)
+ {
+ resret = [NSString stringWithCString: res];
+ }
+ return resret;
+}
+
+
@end
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Bug-gnustep mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-gnustep
