Re: [E-devel] edje_editor / engrave problem

2007-11-26 Thread sebastid
 Dave ha scritto:
 The same problem appear also in the loading of the edc files.
 Here's the second patch (not including the first)

 None seems contrary so I will commit the change to cvs. we can always
 keep back ;)

And a stupid question, why isn't parsing a problem with edje_cc?

Sebastian


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] edje_editor / engrave problem

2007-11-26 Thread Chady Kassouf
On Nov 26, 2007 10:09 AM, [EMAIL PROTECTED] wrote:

  Dave ha scritto:
  The same problem appear also in the loading of the edc files.
  Here's the second patch (not including the first)
 
  None seems contrary so I will commit the change to cvs. we can always
  keep back ;)

 And a stupid question, why isn't parsing a problem with edje_cc?


Which is a very good point indeed.
There are lots of problems that arise from the way edje_cc parses the edc
file.
but I'm not sure if this particular issue is edje_cc's problem, cause you
need your edc files to be portable at least.


-- 
Chady 'Leviathan' Kassouf
http://chady.net/
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] edje_editor / engrave problem

2007-11-26 Thread Peter Wehrfritz
[EMAIL PROTECTED] schrieb:
 Dave ha scritto:
 The same problem appear also in the loading of the edc files.
 Here's the second patch (not including the first)

 None seems contrary so I will commit the change to cvs. we can always
 keep back ;)
 

 And a stupid question, why isn't parsing a problem with edje_cc?

 Sebastian

   
Because edje_cc sets the (numeric) locale explicitly to C (it is the 
default anyway so without this line the results would be the same). And 
in C a point is used for the decimal point.

Peter

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] edje_editor / engrave problem

2007-11-25 Thread Dave
Dave ha scritto:
 Peter Wehrfritz ha scritto:
   
 Gustavo Sverzut Barbieri schrieb:
   
 
 On Nov 23, 2007 3:45 AM, Dave [EMAIL PROTECTED] wrote:
   
 
   
 Hi all,
 I recently have a strange bug in the editor that prevent from saving all
 the file.
 The problem is that engrave write out an edc with all the floating numbers
 having the wrong separator-char ( 0,0 instead of 0.0 ).
 The strange think is that engrave_test seems to work well
 Someone else have this error?
 To try simply create a new group,a new rectangle and save the file.
 I have this error:

 Executing: edje_cc -v   /tmp/edje_editor_tmp.edc-pQu69c /home/dave/as
 edje_cc: Error. parse error :22. , marker before ; marker
 Error in edje_cc, exit code:  25

 and in fact the tmp file have ( , ) instead of ( . ) in numbers


 The tmp file is generated by engrave_edc_output() that write the value
 with this function:

 static void
 engrave_out_data(FILE *out, char *name, char *fmt, ...)
 {
 va_list ap;
 char *fmt_new = (char *)calloc(strlen(fmt) + strlen(name) + level +
 5, sizeof(char));
 char *buf = engrave_output_mk_tabs();

 sprintf(fmt_new, %s%s: %s;\n, buf, name, fmt);
 va_start(ap, fmt);
 vfprintf(out, fmt_new, ap);
 va_end(ap);
 FREE(fmt_new);
 FREE(buf);
 }


 So seems that vfprintf() write the %.2f param wrong. Is this possible?
 is vfprintf()  l18n?
 
   
 
 yes, it is. I'm not sure how to disable it just for some functions
 tough. A quick look at its man page says that every format would use
 the locale to format, but maybe there is some that I missed.
   
 
   
 Don't think there is a really nice way to do this. The only way I know 
 is this:
 char prev[128];

 strncpy(prev, setlocale(LC_NUMERIC, NULL), sizeof(prev));

 setlocale(LC_NUMERIC, C);
 printf(%f\n, 123.3);
 setlocale(LC_NUMERIC, prev);

   
 
 Yes thanks, this works !!
 This is the patch for engrave, can I commit it?(my editor is badly broken
 without) or someone know a better way?

   
The same problem appear also in the loading of the edc files.
Here's the second patch (not including the first)

None seems contrary so I will commit the change to cvs. we can always 
keep back ;)

Dave


Index: src/lib/engrave_parse.c
===
RCS file: /cvs/e/e17/libs/engrave/src/lib/engrave_parse.c,v
retrieving revision 1.24
diff -u -r1.24 engrave_parse.c
--- src/lib/engrave_parse.c 21 Aug 2007 05:42:29 -  1.24
+++ src/lib/engrave_parse.c 26 Nov 2007 02:17:56 -
@@ -1,4 +1,5 @@
 #include engrave_private.h
+#include locale.h
 #include Engrave.h

 static Engrave_File *engrave_file = 0;
@@ -9,14 +10,22 @@
 engrave_parse(const char *file, const char *imdir, const char *fontdir)
 {
   int ret;
+  char locale[128];
   engrave_file = engrave_file_new();
   engrave_file_image_dir_set(engrave_file, imdir);
   engrave_file_font_dir_set(engrave_file, fontdir);

+  /* set locale posix compliant*/
+  strncpy(locale, setlocale(LC_NUMERIC, NULL), sizeof(locale));
+  setlocale(LC_NUMERIC, C);
+  
   yyin = fopen(file, r);
   ret = yyparse();
   fclose(yyin);

+  /* reset locale to system default*/
+  setlocale(LC_NUMERIC, locale);
+  
   if (ret == 0)
  return (engrave_file);



 -
 This SF.net email is sponsored by: Microsoft
 Defy all challenges. Microsoft(R) Visual Studio 2005.
 http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
 ___
 enlightenment-devel mailing list
 enlightenment-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
   

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] edje_editor / engrave problem

2007-11-24 Thread Dave
Peter Wehrfritz ha scritto:
 Gustavo Sverzut Barbieri schrieb:
   
 On Nov 23, 2007 3:45 AM, Dave [EMAIL PROTECTED] wrote:
   
 
 Hi all,
 I recently have a strange bug in the editor that prevent from saving all
 the file.
 The problem is that engrave write out an edc with all the floating numbers
 having the wrong separator-char ( 0,0 instead of 0.0 ).
 The strange think is that engrave_test seems to work well
 Someone else have this error?
 To try simply create a new group,a new rectangle and save the file.
 I have this error:

 Executing: edje_cc -v   /tmp/edje_editor_tmp.edc-pQu69c /home/dave/as
 edje_cc: Error. parse error :22. , marker before ; marker
 Error in edje_cc, exit code:  25

 and in fact the tmp file have ( , ) instead of ( . ) in numbers


 The tmp file is generated by engrave_edc_output() that write the value
 with this function:

 static void
 engrave_out_data(FILE *out, char *name, char *fmt, ...)
 {
 va_list ap;
 char *fmt_new = (char *)calloc(strlen(fmt) + strlen(name) + level +
 5, sizeof(char));
 char *buf = engrave_output_mk_tabs();

 sprintf(fmt_new, %s%s: %s;\n, buf, name, fmt);
 va_start(ap, fmt);
 vfprintf(out, fmt_new, ap);
 va_end(ap);
 FREE(fmt_new);
 FREE(buf);
 }


 So seems that vfprintf() write the %.2f param wrong. Is this possible?
 is vfprintf()  l18n?
 
   
 yes, it is. I'm not sure how to disable it just for some functions
 tough. A quick look at its man page says that every format would use
 the locale to format, but maybe there is some that I missed.
   
 
 Don't think there is a really nice way to do this. The only way I know 
 is this:
 char prev[128];

 strncpy(prev, setlocale(LC_NUMERIC, NULL), sizeof(prev));

 setlocale(LC_NUMERIC, C);
 printf(%f\n, 123.3);
 setlocale(LC_NUMERIC, prev);

   
Yes thanks, this works !!
This is the patch for engrave, can I commit it?(my editor is badly broken
without) or someone know a better way?

Index: src/lib/engrave_out.c
===
RCS file: /cvs/e/e17/libs/engrave/src/lib/engrave_out.c,v
retrieving revision 1.47
diff -u -r1.47 engrave_out.c
--- src/lib/engrave_out.c   9 Nov 2007 09:15:19 -   1.47
+++ src/lib/engrave_out.c   24 Nov 2007 15:27:34 -
@@ -1,6 +1,7 @@
 #include errno.h
 #include unistd.h
 #include stdio.h
+#include locale.h
 #include stdarg.h
 #include stdlib.h
 #include string.h
@@ -191,6 +192,7 @@
 engrave_edc_output(Engrave_File *engrave_file, const char *path)
 {
   FILE *out = NULL;
+  char locale[128];

   if (!engrave_file) return 0;

@@ -201,6 +203,10 @@
 return 0;
   }

+  /* set locale posix compliant*/
+  strncpy(locale, setlocale(LC_NUMERIC, NULL), sizeof(locale));
+  setlocale(LC_NUMERIC, C);
+
   /* fonts */
   engrave_out_start(out, fonts);
   engrave_file_font_foreach(engrave_file, _engrave_output_font, out);
@@ -237,6 +243,10 @@
   engrave_out_end(out);

   fclose(out);
+ 
+  /* reset locale to system default*/
+  setlocale(LC_NUMERIC, locale);
+ 
   return 1;
 }





-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] edje_editor / engrave problem

2007-11-23 Thread Gustavo Sverzut Barbieri
On Nov 23, 2007 3:45 AM, Dave [EMAIL PROTECTED] wrote:
 Hi all,
 I recently have a strange bug in the editor that prevent from saving all
 the file.
 The problem is that engrave write out an edc with all the floating numbers
 having the wrong separator-char ( 0,0 instead of 0.0 ).
 The strange think is that engrave_test seems to work well
 Someone else have this error?
 To try simply create a new group,a new rectangle and save the file.
 I have this error:

 Executing: edje_cc -v   /tmp/edje_editor_tmp.edc-pQu69c /home/dave/as
 edje_cc: Error. parse error :22. , marker before ; marker
 Error in edje_cc, exit code:  25

 and in fact the tmp file have ( , ) instead of ( . ) in numbers


 The tmp file is generated by engrave_edc_output() that write the value
 with this function:

 static void
 engrave_out_data(FILE *out, char *name, char *fmt, ...)
 {
 va_list ap;
 char *fmt_new = (char *)calloc(strlen(fmt) + strlen(name) + level +
 5, sizeof(char));
 char *buf = engrave_output_mk_tabs();

 sprintf(fmt_new, %s%s: %s;\n, buf, name, fmt);
 va_start(ap, fmt);
 vfprintf(out, fmt_new, ap);
 va_end(ap);
 FREE(fmt_new);
 FREE(buf);
 }


 So seems that vfprintf() write the %.2f param wrong. Is this possible?
 is vfprintf()  l18n?

yes, it is. I'm not sure how to disable it just for some functions
tough. A quick look at its man page says that every format would use
the locale to format, but maybe there is some that I missed.

-- 
Gustavo Sverzut Barbieri
--
Jabber: [EMAIL PROTECTED]
   MSN: [EMAIL PROTECTED]
  ICQ#: 17249123
 Skype: gsbarbieri
Mobile: +55 (81) 9927 0010

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] edje_editor / engrave problem

2007-11-23 Thread Peter Wehrfritz
Gustavo Sverzut Barbieri schrieb:
 On Nov 23, 2007 3:45 AM, Dave [EMAIL PROTECTED] wrote:
   
 Hi all,
 I recently have a strange bug in the editor that prevent from saving all
 the file.
 The problem is that engrave write out an edc with all the floating numbers
 having the wrong separator-char ( 0,0 instead of 0.0 ).
 The strange think is that engrave_test seems to work well
 Someone else have this error?
 To try simply create a new group,a new rectangle and save the file.
 I have this error:

 Executing: edje_cc -v   /tmp/edje_editor_tmp.edc-pQu69c /home/dave/as
 edje_cc: Error. parse error :22. , marker before ; marker
 Error in edje_cc, exit code:  25

 and in fact the tmp file have ( , ) instead of ( . ) in numbers


 The tmp file is generated by engrave_edc_output() that write the value
 with this function:

 static void
 engrave_out_data(FILE *out, char *name, char *fmt, ...)
 {
 va_list ap;
 char *fmt_new = (char *)calloc(strlen(fmt) + strlen(name) + level +
 5, sizeof(char));
 char *buf = engrave_output_mk_tabs();

 sprintf(fmt_new, %s%s: %s;\n, buf, name, fmt);
 va_start(ap, fmt);
 vfprintf(out, fmt_new, ap);
 va_end(ap);
 FREE(fmt_new);
 FREE(buf);
 }


 So seems that vfprintf() write the %.2f param wrong. Is this possible?
 is vfprintf()  l18n?
 

 yes, it is. I'm not sure how to disable it just for some functions
 tough. A quick look at its man page says that every format would use
 the locale to format, but maybe there is some that I missed.
   
Don't think there is a really nice way to do this. The only way I know 
is this:
char prev[128];

strncpy(prev, setlocale(LC_NUMERIC, NULL), sizeof(prev));

setlocale(LC_NUMERIC, C);
printf(%f\n, 123.3);
setlocale(LC_NUMERIC, prev);



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[E-devel] edje_editor / engrave problem

2007-11-22 Thread Dave
Hi all,
I recently have a strange bug in the editor that prevent from saving all 
the file.
The problem is that engrave write out an edc with all the floating numbers
having the wrong separator-char ( 0,0 instead of 0.0 ).
The strange think is that engrave_test seems to work well
Someone else have this error?
To try simply create a new group,a new rectangle and save the file.
I have this error:

Executing: edje_cc -v   /tmp/edje_editor_tmp.edc-pQu69c /home/dave/as
edje_cc: Error. parse error :22. , marker before ; marker
Error in edje_cc, exit code:  25

and in fact the tmp file have ( , ) instead of ( . ) in numbers


The tmp file is generated by engrave_edc_output() that write the value 
with this function:

static void
engrave_out_data(FILE *out, char *name, char *fmt, ...)
{
va_list ap;
char *fmt_new = (char *)calloc(strlen(fmt) + strlen(name) + level + 
5, sizeof(char));
char *buf = engrave_output_mk_tabs();

sprintf(fmt_new, %s%s: %s;\n, buf, name, fmt);
va_start(ap, fmt);
vfprintf(out, fmt_new, ap);
va_end(ap);
FREE(fmt_new);
FREE(buf);
}


So seems that vfprintf() write the %.2f param wrong. Is this possible?
is vfprintf()  l18n?

Help please  :)
Dave


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel