~ubuntu-branches/ubuntu/oneiric/libuninum/oneiric

« back to all changes in this revision

Viewing changes to uninum.i

  • Committer: Bazaar Package Importer
  • Author(s): Bartosz Fenski
  • Date: 2007-10-11 11:51:01 UTC
  • Revision ID: james.westby@ubuntu.com-20071011115101-lthr3ez79qz2put5
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%module uninum
 
2
/* Null terminated Unicode strings */
 
3
%typemap(in) wchar_t * %{
 
4
    $1 = Tcl_GetUnicode($input);
 
5
%}
 
6
%typemap(out) UCS2 * %{
 
7
      if($1 == NULL) result = "";
 
8
      Tcl_SetObjResult(interp,Tcl_NewUnicodeObj($1,uninum_utf16len($1)));
 
9
%}
 
10
/* This causes swig to generate code to free the result, preventing a memory leak. */
 
11
%newobject WNStrToUNStr;
 
12
%newobject UNStrToWNStr;
 
13
%newobject Tcl_ListNumberSystems;
 
14
%newobject UninumNumberSystemMaximumValue;
 
15
%{
 
16
/* Includes the header in the wrapper code */
 
17
#include "config.h"
 
18
#include "unicode.h"
 
19
#include "nsdefs.h"
 
20
extern char *UNStrToWNStr(wchar_t *,char *);
 
21
extern UCS2 *WNStrToUNStr(char *,char *);
 
22
extern char *StrGuessNumberSystem(wchar_t *);
 
23
extern char *Tcl_ListNumberSystems (int);
 
24
extern char *UninumNumberSystemMaximumValue(char *);
 
25
extern char *uninum_version(void);
 
26
%}
 
27
%include "nsdefs.h"
 
28
%include "unicode.h"
 
29
extern char *UNStrToWNStr(wchar_t *,char *);
 
30
extern UCS2 *WNStrToUNStr(char *,char *);
 
31
extern char *StrGuessNumberSystem(wchar_t *);
 
32
extern char *Tcl_ListNumberSystems (int);
 
33
extern char *uninum_version(void);
 
34
extern char *UninumNumberSystemMaximumValue(char *);
 
35
%inline %{
 
36
extern int uninum_err;
 
37
extern short uninum_ns_type;
 
38
extern UCS2 tcl_uninum_badchar;
 
39
extern int Uninum_Input_Base;
 
40
extern int Uninum_Output_Base;
 
41
extern int Uninum_Output_General_Group_Size;
 
42
extern int Uninum_Output_First_Group_Size;
 
43
extern int Uninum_Generate_Roman_With_Bar_P;
 
44
extern UCS2 Uninum_Output_Group_Separator;
 
45
%}
 
46