Nmap Development mailing list archives

Re: Nmap on Android: bitset


From: Vlatko Kosturjak <kost () linux hr>
Date: Fri, 20 Aug 2010 17:53:27 +0200

On 08/20/2010 05:14 PM, Vlatko Kosturjak wrote:
On 08/20/2010 04:33 PM, Kris Katterjohn wrote:
Have you looked in locale.h to see what's in lconv{}?  I think decimal_point
is defined in ISO C (and POSIX), so maybe there is some macro you can define
somewhere to get this member?  Or maybe there is just a weird replacement in
there...
"...Bionic is mainly a port of the BSD C library to our Linux kernel
with the following additions/changes:

  - no support for locales..."

BTW I have also checked android-scripting (SL4A) source repository to
see how they handle it. It is project which brings different languages
to Android and solution is quite similar to my patch:
http://code.google.com/p/android-scripting/source/browse/lua/src/src/llex.c

static void trydecpoint (LexState *ls, SemInfo *seminfo) {
  /* format error: try to update decimal point separator */
  //struct lconv *cv = localeconv();
  char old = ls->decpoint;
  ls->decpoint = '.';//(cv ? cv->decimal_point[0] : '.');
  buffreplace(ls, old, ls->decpoint);  /* try updated decimal separator */
  if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {
    /* format error with correct decimal point: no more options */
    buffreplace(ls, ls->decpoint, '.');  /* undo change (for error
message) */
    luaX_lexerror(ls, "malformed number", TK_NUMBER);
  }
}

Kost
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: