Re: [Freedos-user] djgpp snprintf?

2007-06-28 Thread Gordon . Schumacher
Robert Riebisch [EMAIL PROTECTED] wrote on Tue, 26 Jun 2007 22:23:33
+0200:

# DJGPP 2.04 beta supports snprintf().

I'd pretty strongly recommend using v2.04 anyway; as soon as the guy in
Legal gets back, I expect that I'll get the paperwork in order to be the
release maintainer for this version and it'll become an actual release
soon.

There's quite a lot of stuff supported in v2.04 that's not in v2.03.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] djgpp snprintf?

2007-06-28 Thread Dietmar Segbert
Hello Robert,

thanks for your tips.

There are some other problems. google says that the getopt function is in
unistd.h. But i can't not compile espeak. I have downloades kpseaxxxs.zip.
In this package is an getopt.c and a getopt.h.. thats was better, but in
an if phrase with access and r_ok. If i comment this lines out, speak.cpp
compiles.
and in dictionary.cpp are functions iswalpha ... and must i put another
lib on the libflag -l...?

Quoestions over quoestions.

Regards.

Dietmar

 [EMAIL PROTECTED] schrieb am 28.06.07:

 Robert Riebisch wrote:

 Another solution is linking against GNU GLib, which has
 g_snprintf(). I could tell you more tomorrow.

 1) Grab `current/v2tk/glib126b.zip' from a DJGPP repository.
 2) Expand `glib126b.zip' to your DJGPP installation.
 3) Add the following to `src/speech.h'.

 #ifdef __DJGPP__
 #include glib.h
 #define snprintfg_snprintf
 #endif

 4) Add `-lglib' to `LIBSx =' lines in `src/Makefile'.
 5) Add `-I/dev/env/DJDIR/lib/glib/include' to `CXXFLAGS=' line in
 `src/Makefile'.

 Robert Riebisch
 --
 BTTR Software
 http://www.bttr-software.de/

 ---
 -- This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Freedos-user mailing list
 Freedos-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/freedos-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] djgpp snprintf?

2007-06-28 Thread Eric Auer

Hi Dietmar,

indeed, it is possible that djgpp does not include a getopt,
but you can add your own copy of getopt.c and getopt.h ...

 In this package is an getopt.c and a getopt.h.. thats was better, but
 in an if phrase with access and r_ok. If i comment this lines out

Maybe you forgot to cut and paste a bit of text here?

 and in dictionary.cpp are functions iswalpha

The iswalpha( wint_t value ) tests whether a wide character
is alphabetic. In other words, it is the Unicode equivalent
of isalpha( int value ). Just replace iswalpha by isalpha or
set I want no Unicode / UTF-8. But there is also another
method: It might be possible to copy parts of the two files
./riscos/cpp/speak_riscos and ./riscos/h/wctype into for
example wctype.cpp and wctype.h, they seem to contain their
own implementation of the wide character functions.
You could also ask the author of those files, as mentioned
at the beginning of those files, to help you.

It seems that espeak supports both utf16 and utf8 internally,
so it can handle much of utf8 without Unicode aware C libs.

Another method is limit yourself to ASCII: For that, you
may be interested in the following:

#define wchar_t int
#define iswalpha isalpha
#define iswdigit isdigit
#define iswalnum isalnum
#define towlower tolower
#define towupper toupper
#define iswupper isupper
#define iswlower islower
#define iswspace isspace
#define iswpunct ispunct

Put the above into a fakewide.h file and add, at the start of
each of the .c files for which you get errors about iswsomething,

#include fakewide.h

That should give you ASCII support and make it easy to compile
things. Real implementations of the issomething and tosomething
functions are in ./riscos/cpp/speak_riscos which you can copy
into a wctype.cpp file as mentioned above. You may also have to
add wctype.cpp to the 2 lists of some_SOURCES in the Makefile.

I hope you can figure it out. Good luck!

Eric



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] djgpp snprintf?

2007-06-27 Thread Robert Riebisch
Robert Riebisch wrote:

 Another solution is linking against GNU GLib, which has g_snprintf(). I could
 tell you more tomorrow.

1) Grab `current/v2tk/glib126b.zip' from a DJGPP repository.
2) Expand `glib126b.zip' to your DJGPP installation.
3) Add the following to `src/speech.h'.

#ifdef __DJGPP__
#include glib.h
#define snprintfg_snprintf
#endif

4) Add `-lglib' to `LIBSx =' lines in `src/Makefile'.
5) Add `-I/dev/env/DJDIR/lib/glib/include' to `CXXFLAGS=' line in
`src/Makefile'.

Robert Riebisch
-- 
BTTR Software
http://www.bttr-software.de/

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] djgpp snprintf?

2007-06-26 Thread Eric Auer

Hi Dietmar,

 i try to compile the espeak synthesizer.
 If i start make, it produces an error snprintf not declared.
 In which lib is this function in djgpp (#include xxx?

It is possible that the C library of DJGPP does not support
snprintf, but espeak only uses snprintf in one context in
only 3 places. Replace the 3 lines as explained below and
you can compile without snprintf.

./src/speak_lib.cpp line 304
old: snprintf(path_home,sizeof(path_home),%s/espeak-data,path);
replace by new: sprintf(path_home,%s/espeak-data,path);

./src/speak_lib.cpp line 308 and also
./src/speak.cpp line 241 (both) have
old: snprintf(path_home,sizeof(path_home),%s/espeak-data,getenv(HOME));
replace by new: sprintf(path_home,%s/espeak-data,getenv(HOME));

The version with sprintf instead of snprintf will crash if
it tries to calculate a directory name longer than 120 chars
(length of path_home). The original version with snprintf
will not crash, but will instead use a truncated name. You
can also simulate snprintf with careful choice of the % args
of sprintf, but I think this is not worth the effort here.

Eric



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] djgpp snprintf?

2007-06-26 Thread Robert Riebisch
Eric Auer wrote:

 It is possible that the C library of DJGPP does not support

DJGPP 2.04 beta supports snprintf().

 snprintf, but espeak only uses snprintf in one context in
 only 3 places. Replace the 3 lines as explained below and
 you can compile without snprintf.

Another solution is linking against GNU GLib, which has g_snprintf(). I could
tell you more tomorrow.

Robert Riebisch
-- 
BTTR Software
http://www.bttr-software.de/

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user