File: MinimalExample.c

package info (click to toggle)
libuninum 2.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,204 kB
  • sloc: ansic: 9,968; sh: 8,721; tcl: 553; makefile: 27
file content (24 lines) | stat: -rw-r--r-- 575 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
#include <gmp.h>
#include <uninum/unicode.h>
#include <uninum/nsdefs.h>
#include <uninum/uninum.h>

/*
 * If the library headers are  not installed but you have them in the current
 * directory, change <uninum/nsdefs.h> and <uninum/uninum.h> to "nsdefs.h" and "uninum.h".
*/

wchar_t *str=L"\x0ED5\x0ED7\x0ED6";

int main(int ac, char **av) {
  union ns_rval val;
  unsigned long myint;

  StringToInt(&val,str,NS_TYPE_ULONG,NS_ANY);
  if(0 == uninum_err) myint = val.u;
  printf("Myint = %u.\n",myint);
  exit(0);
}