cvsuser     05/01/09 06:51:01

  Modified:    .        MANIFEST
               src      nci_test.c
               config/gen/makefiles root.in
               config/init data.pl
               config/init/hints mswin32.pl
               docs/pmc struct.pod
               dynoplibs test.pasm
               io       io_buf.c
               t/library parrotlib.t
               t/pmc    nci.t
  Added:       src      libnci_test.def
  Log:
  [perl #33662] [PATCH] Rename libnci.so to libnci_test.so
  
  I've just noticed that ticket 27305 proposes to move libnci.def into
  'src/'. This makes sense to me, so I have changed the patch accordingly.
  
  Courtesy of Bernhard Schmalhofer <[EMAIL PROTECTED]>
  
  --
  Fixed #33716: segfault w readline if newline is missing
  
  Revision  Changes    Path
  1.818     +1 -1      parrot/MANIFEST
  
  Index: MANIFEST
  ===================================================================
  RCS file: /cvs/public/parrot/MANIFEST,v
  retrieving revision 1.817
  retrieving revision 1.818
  diff -u -r1.817 -r1.818
  --- MANIFEST  4 Jan 2005 20:46:05 -0000       1.817
  +++ MANIFEST  9 Jan 2005 14:50:52 -0000       1.818
  @@ -2651,7 +2651,6 @@
   lib/Test/More.pm                                  [devel]
   lib/Test/Simple.pm                                [devel]
   lib/Text/Balanced.pm                              [devel]
  -libnci.def                                        []
   runtime/parrot/library/Data/Sort.imc              [library]
   runtime/parrot/library/Data/Escape.imc            [library]
   runtime/parrot/library/Data/Replace.imc           [library]
  @@ -2761,6 +2760,7 @@
   src/list.c                                        []
   src/library.c                                     []
   src/longopt.c                                     []
  +src/libnci_test.def                               []
   src/malloc-trace.c                                []
   src/malloc.c                                      []
   src/memory.c                                      []
  
  
  
  1.37      +5 -5      parrot/src/nci_test.c
  
  Index: nci_test.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/nci_test.c,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- nci_test.c        14 Oct 2004 09:40:16 -0000      1.36
  +++ nci_test.c        9 Jan 2005 14:50:54 -0000       1.37
  @@ -1,6 +1,6 @@
   /*
  -Copyright: 2001-2004 The Perl Foundation.  All Rights Reserved.
  -$Id: nci_test.c,v 1.36 2004/10/14 09:40:16 leo Exp $
  +Copyright: 2001-2005 The Perl Foundation.  All Rights Reserved.
  +$Id: nci_test.c,v 1.37 2005/01/09 14:50:54 leo Exp $
   
   =head1 NAME
   
  @@ -10,13 +10,13 @@
   
   From this code a shared library can be compiled and linked with a command 
like:
   
  -   cc -shared -fpic nci_test.c -o libnci.so -g
  +   cc -shared -fpic nci_test.c -o libnci_test.so -g
   
   For non-Unix platforms the above command has to be modified appropriately.
   
   The resulting shared library should be copied to a location like:
   
  -   parrot/runtime/parrot/dynext/libnci.so
  +   parrot/runtime/parrot/dynext/libnci_test.so
   
   At that location the shared library is loadable with the opcode 'loadlib'.
   The functions in the library are available with the opcode 'dlfunc'.
  @@ -38,7 +38,7 @@
   
   Declarations.
   
  -*** If you add a new test function here, please update libnci.def too. ***
  +*** If you add a new test function here, please update libnci_test.def too. 
***
   
   */
   
  
  
  
  1.1                  parrot/src/libnci_test.def
  
  Index: libnci_test.def
  ===================================================================
  LIBRARY libnci_test
  DESCRIPTION 'Shared lib for testing the Parrot Native Call Interface'
  EXPORTS
      nci_dd
      nci_ssc
      nci_csc
      nci_isc
      nci_fff
      nci_ip
      nci_it
      nci_tt
      nci_tb
      nci_tB
      nci_pp
      nci_iiii
      nci_i4i
      nci_ii3
      nci_pi
      nci_vP
      nci_cb_C1
      nci_cb_C2
      nci_cb_C3
      nci_cb_D1
      nci_cb_D2
      nci_cb_D3
      nci_cb_D4
      nci_pip
      nci_i33
      nci_vpii
      nci_piiii
      nci_dlvar_int
      nci_dlvar_vv
  
  
  
  1.271     +6 -5      parrot/config/gen/makefiles/root.in
  
  Index: root.in
  ===================================================================
  RCS file: /cvs/public/parrot/config/gen/makefiles/root.in,v
  retrieving revision 1.270
  retrieving revision 1.271
  diff -u -r1.270 -r1.271
  --- root.in   28 Dec 2004 12:19:45 -0000      1.270
  +++ root.in   9 Jan 2005 14:50:55 -0000       1.271
  @@ -1,4 +1,5 @@
  -# $Id: root.in,v 1.270 2004/12/28 12:19:45 rubys Exp $
  +# Copyright: 2001-2005 The Perl Foundation.  All Rights Reserved.
  +# $Id: root.in,v 1.271 2005/01/09 14:50:55 leo Exp $
   
   
###############################################################################
   #
  @@ -27,7 +28,7 @@
   
   # imcc, ast dir
   IMCC_DIR = imcc
  -AST_DIR = ast
  +AST_DIR  = ast
   
   # source dir
   SRC = src
  @@ -442,7 +443,7 @@
   
   # dynamic extensions
   DYNEXT_DIR      = runtime/parrot/dynext
  -LIBNCI_SO       = $(DYNEXT_DIR)/libnci$(LOAD_EXT)
  +LIBNCI_SO       = $(DYNEXT_DIR)/libnci_test$(LOAD_EXT)
   
   
###############################################################################
   #
  @@ -1172,7 +1173,7 @@
        $(RM_F) $(STR_FILES) $(INC)/string_private_cstring.h
        $(RM_F) classes/*.c classes/*.h classes/*.dump vtable.dump
   # win32 import library (shared object is deleted by LIBNCI_SO above)
  -     $(RM_F) $(DYNEXT_DIR)/libnci.lib
  +     $(RM_F) $(DYNEXT_DIR)/libnci_test.lib
   # win32 program data base - contains debugging info
        $(RM_F) *.pdb $(DYNEXT_DIR)/*.pdb
   # win32 incremental link status files
  @@ -1306,8 +1307,8 @@
        $(LINK) ${ld_out}$(EXEC) $(LINKFLAGS) $(EXEC)$(O) $(SRC)/exec_start$(O) 
-lparrot $(C_LIBS)
   
   ###### OS depend targets ##########
  -# libnci.so used by t/pmc/nci.t
   
  +# for use by t/pmc/nci.t
   $(LIBNCI_SO): $(SRC)/nci_test$(O)
        $(LD) $(LD_LOAD_FLAGS) ${ncilib_link_extra} $(LDFLAGS) \
            $(LD_OUT)$@ $(SRC)/nci_test$(O)
  
  
  
  1.38      +5 -3      parrot/config/init/data.pl
  
  Index: data.pl
  ===================================================================
  RCS file: /cvs/public/parrot/config/init/data.pl,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- data.pl   28 Nov 2004 04:14:21 -0000      1.37
  +++ data.pl   9 Jan 2005 14:50:56 -0000       1.38
  @@ -1,6 +1,7 @@
   #! perl -w
  -# Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -# $Id: data.pl,v 1.37 2004/11/28 04:14:21 coke Exp $
  +
  +# Copyright: 2001-2005 The Perl Foundation.  All Rights Reserved.
  +# $Id: data.pl,v 1.38 2005/01/09 14:50:56 leo Exp $
   
   =head1 NAME
   
  @@ -149,7 +150,8 @@
       icu_make      => '# Building of ICU disabled',
       buildicu      => 0,
   
  -    ncilib_link_extra => '',              # Extra flags needed for libnci.so
  +    # Extra flags needed for libnci_test.so
  +    ncilib_link_extra => '',           
   
     );
   
  
  
  
  1.24      +1 -1      parrot/config/init/hints/mswin32.pl
  
  Index: mswin32.pl
  ===================================================================
  RCS file: /cvs/public/parrot/config/init/hints/mswin32.pl,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- mswin32.pl        8 Oct 2004 15:01:11 -0000       1.23
  +++ mswin32.pl        9 Jan 2005 14:50:57 -0000       1.24
  @@ -19,7 +19,7 @@
                rm_rf => '$(PERL) -MExtUtils::Command -e rm_rf',
                   PQ    => '"',
                   make_c=> '$(PERL) -e "chdir shift @ARGV; system \'$(MAKE)\', 
@ARGV; exit $$? >> 8;"',
  -             ncilib_link_extra => '-def:libnci.def',
  +             ncilib_link_extra => '-def:src/libnci_test.def',
        );
   
        if( $is_msvc ) {
  
  
  
  1.5       +8 -5      parrot/docs/pmc/struct.pod
  
  Index: struct.pod
  ===================================================================
  RCS file: /cvs/public/parrot/docs/pmc/struct.pod,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- struct.pod        6 Feb 2004 11:49:45 -0000       1.4
  +++ struct.pod        9 Jan 2005 14:50:58 -0000       1.5
  @@ -1,3 +1,6 @@
  +# Copyright: 2001-2005 The Perl Foundation.  All Rights Reserved.
  +# $Id: struct.pod,v 1.5 2005/01/09 14:50:58 leo Exp $
  +
   =head1 NAME
   
   Structures - Accessing C Structs from Parrot
  @@ -5,7 +8,7 @@
   =head1 DESCRIPTION
   
   Parrot provides two PMC classes to deal with C structures. These
  -are UnManagedStruct and ManagedStruct. The former hasn't any allocated
  +are UnManagedStruct and ManagedStruct. The former has no allocated
   memory and is typically used to access structures returned by NCI calls,
   while the latter can be used to define a structure and pass it over
   to a C function - pointers to structures in both cases of course.
  @@ -19,7 +22,7 @@
   
   =item Datatype
   
  -The datatype is defined by constants declared in B<datatypes.pasm>.
  +The datatype is defined by constants declared in F<datatypes.pasm>.
   
   =item Array Size
   
  @@ -46,7 +49,7 @@
       int  i;
     }
   
  -The B<i> above is aligned at 4 (for i386 or such).
  +The C<i> above is aligned at 4 (for i386 or such).
   
   =head2 Example
   
  @@ -242,7 +245,7 @@
   
   =head1 Passing A Structure to a C function
   
  -For a shared library B<libnci.so> (or whatever) and a C function
  +For a shared library B<libnci_test.so> (or whatever) and a C function
   
     typedef struct _dfi_t {
       double d;
  @@ -254,7 +257,7 @@
   
   a pointer to the structure is passed with the B<p> signature char:
   
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_ip", "ip"
     # P5 is ManagedStruct from above
     invoke
  
  
  
  1.4       +2 -2      parrot/dynoplibs/test.pasm
  
  Index: test.pasm
  ===================================================================
  RCS file: /cvs/public/parrot/dynoplibs/test.pasm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- test.pasm 14 Oct 2003 15:47:09 -0000      1.3
  +++ test.pasm 9 Jan 2005 14:50:58 -0000       1.4
  @@ -13,12 +13,12 @@
       print "not "
   ok2:
       print "loaded foo\n"
  -    loadlib P11, "libnci"
  +    loadlib P11, "libnci_test"
       defined I0, P11
       if I0, ok3
       print "not "
   ok3:
  -    print "loaded libnci\n"
  +    print "loaded libnci_test\n"
       getinterp P2
       set P3, P2[.IGLOBALS_DYN_LIBS]
       print "found "
  
  
  
  1.32      +2 -2      parrot/io/io_buf.c
  
  Index: io_buf.c
  ===================================================================
  RCS file: /cvs/public/parrot/io/io_buf.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- io_buf.c  22 Sep 2004 08:46:56 -0000      1.31
  +++ io_buf.c  9 Jan 2005 14:50:59 -0000       1.32
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: io_buf.c,v 1.31 2004/09/22 08:46:56 leo Exp $
  +$Id: io_buf.c,v 1.32 2005/01/09 14:50:59 leo Exp $
   
   =head1 NAME
   
  @@ -589,7 +589,7 @@
               }
               out_buf = (unsigned char*)s->strstart + s->strlen;
               memcpy(out_buf, buf_start, len);
  -            s->strlen = l;
  +            s->strlen = s->bufused = l;
               if (PIO_buf_fill_readbuf(interpreter, layer, io, b) == 0)
                   return l;
               buf_start = b->startb;
  
  
  
  1.7       +4 -4      parrot/t/library/parrotlib.t
  
  Index: parrotlib.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/library/parrotlib.t,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- parrotlib.t       12 Oct 2004 09:00:24 -0000      1.6
  +++ parrotlib.t       9 Jan 2005 14:51:00 -0000       1.7
  @@ -1,5 +1,5 @@
  -# Copyright (C) 2001-2004 The Perl Foundation.  All rights reserved.
  -# $Id: parrotlib.t,v 1.6 2004/10/12 09:00:24 leo Exp $
  +# Copyright (C) 2001-2005 The Perl Foundation.  All rights reserved.
  +# $Id: parrotlib.t,v 1.7 2005/01/09 14:51:00 leo Exp $
   
   =head1 NAME
   
  @@ -89,10 +89,10 @@
   output_is( << "END_CODE", << "END_OUT", 'dynext_location' );
   $template_top
     location_sub = find_global "_parrotlib", "dynext_location"
  -  location     = location_sub( 'libnci', '$PConfig{load_ext}' )
  +  location     = location_sub( 'libnci_test', '$PConfig{load_ext}' )
   $template_bottom
   END_CODE
  -runtime/parrot/dynext/libnci$PConfig{load_ext}
  +runtime/parrot/dynext/libnci_test$PConfig{load_ext}
   END_OUT
   
   output_is( << "END_CODE", << 'END_OUT', 'dynext_location, non-existent' );
  
  
  
  1.62      +112 -112  parrot/t/pmc/nci.t
  
  Index: nci.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/pmc/nci.t,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- nci.t     7 Jan 2005 00:39:24 -0000       1.61
  +++ nci.t     9 Jan 2005 14:51:01 -0000       1.62
  @@ -1,7 +1,7 @@
   #! perl -w
   
  -# Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -# $Id: nci.t,v 1.61 2005/01/07 00:39:24 scog Exp $
  +# Copyright: 2001-2005 The Perl Foundation.  All Rights Reserved.
  +# $Id: nci.t,v 1.62 2005/01/09 14:51:01 leo Exp $
   
   =head1 NAME
   
  @@ -14,7 +14,7 @@
   =head1 DESCRIPTION
   
   This tests the Native Call Interface, that is the ParrotLibrary PMC.
  -Most tests are skipped when the F<libnci.so> library is not found.
  +Most tests are skipped when the F<libnci_test.so> shared library is not 
found.
   
   =head1 SEE ALSO
   
  @@ -28,13 +28,13 @@
   use Parrot::Config;
   
   SKIP: {
  -unless ( -e "runtime/parrot/dynext/libnci" . $PConfig{load_ext} ) {
  -    skip( "Please make libnci$PConfig{load_ext}",
  +unless ( -e "runtime/parrot/dynext/libnci_test$PConfig{load_ext}" ) {
  +    skip( "Please make libnci_test$PConfig{load_ext}",
             Test::Builder->expected_tests() );
   }
   
   output_is(<<'CODE', <<'OUTPUT', "nci_dd - PASM");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     print "loaded\n"
     dlfunc P0, P1, "nci_dd", "dd"
     print "dlfunced\n"
  @@ -68,14 +68,14 @@
   ##PIR##
   .sub _test @MAIN
       .local string library_name
  -    library_name = 'libnci'
  -    .local pmc libnci
  -    libnci = loadlib  library_name
  -    unless libnci goto NOT_LOADED
  +    library_name = 'libnci_test'
  +    .local pmc libnci_test
  +    libnci_test = loadlib  library_name
  +    unless libnci_test goto NOT_LOADED
       print library_name
       print " was successfully loaded\n"
       .local pmc twice
  -    twice = dlfunc libnci, "nci_dd", "dd"
  +    twice = dlfunc libnci_test, "nci_dd", "dd"
       .local float r
       r = twice( -4.128 )
       print r
  @@ -83,7 +83,7 @@
       print "\n"
   .end
   CODE
  -libnci was successfully loaded
  +libnci_test was successfully loaded
   -8.256000
   OUTPUT
   
  @@ -92,15 +92,15 @@
   ##PIR##
   .sub _test @MAIN
       .local string library_name
  -    library_name = 'libnci'
  -    .local pmc libnci
  -    libnci = loadlib  library_name
  -    unless libnci goto NOT_LOADED
  +    library_name = 'libnci_test'
  +    .local pmc libnci_test
  +    libnci_test = loadlib  library_name
  +    unless libnci_test goto NOT_LOADED
           .local string filename_with_path
  -        filename_with_path = libnci
  +        filename_with_path = libnci_test
           # depending on the platform, 'filename' has path info or not
           .local int start_of_filename
  -        start_of_filename = index filename_with_path, 'libnci'
  +        start_of_filename = index filename_with_path, 'libnci_test'
           if start_of_filename == -1 goto NOT_LOADED
               .local string filename
               filename = substr filename_with_path, start_of_filename
  @@ -110,12 +110,12 @@
       print "\n"
   .end
   CODE
  -libnci$PConfig{load_ext} was successfully loaded
  +libnci_test$PConfig{load_ext} was successfully loaded
   OUTPUT
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_fff");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     print "loaded\n"
     dlfunc P0, P1, "nci_fff", "fff"
     print "dlfunced\n"
  @@ -147,7 +147,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_isc");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     print "loaded\n"
     dlfunc P0, P1, "nci_isc", "isc"
     print "dlfunced\n"
  @@ -179,7 +179,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_ssc");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     print "loaded\n"
     dlfunc P0, P1, "nci_ssc", "ssc"
     print "dlfunced\n"
  @@ -211,7 +211,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_csc");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     print "loaded\n"
     dlfunc P0, P1, "nci_csc", "csc"
     print "dlfunced\n"
  @@ -253,7 +253,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_it");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     printerr "loaded\n"
     dlfunc P0, P1, "nci_it", "it"
     printerr "dlfunced\n"
  @@ -283,7 +283,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_tt");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     print "loaded\n"
     dlfunc P0, P1, "nci_tt", "tt"
     print "dlfunced\n"
  @@ -313,7 +313,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_dd - stress test");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     print "loaded\n"
     set I10, 10000
     print "dlfunced\n"
  @@ -348,7 +348,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_dd - clone");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     print "loaded\n"
     dlfunc P0, P1, "nci_dd", "dd"
     print "dlfunced\n"
  @@ -390,7 +390,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_iiii");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_iiii", "iiii"
     set I0, 1  # prototype used - unchecked
     set I5, 10
  @@ -407,7 +407,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_i4i");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_i4i", "i4i"
     new P5, .PerlInt
     set P5, -6
  @@ -423,7 +423,7 @@
   
   output_is(<<'CODE', <<'OUTPUT', "nci_ii3");
   .include "datatypes.pasm"
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_ii3", "ii3"
     set I5, -6
   
  @@ -447,7 +447,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_tb");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_tb", "tb"
     set S5, "ko\n"
     invoke
  @@ -459,7 +459,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_tB");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_tB", "tB"
     set S5, "ko\n"
     invoke
  @@ -471,7 +471,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_pi - struct with ints");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_pi", "pi"
     # this test function returns a struct { int[2]; char }
     set I5, 0
  @@ -503,7 +503,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_pi - struct with floats");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_pi", "pi"
     # this test function returns a struct { float[2]; double }
     set I5, 1
  @@ -535,7 +535,7 @@
   
   
   output_like(<<'CODE', <<'OUTPUT', "nci_pi - align");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_pi", "pi"
     # this test function returns a struct { char; int }
     set I5, 2
  @@ -569,7 +569,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_pi - char*");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_pi", "pi"
     # this test function returns a struct { char*; int }
     set I5, 3
  @@ -597,7 +597,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_pi - nested struct *");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_pi", "pi"
     # this test function returns a struct { char; x->{int, double} }
     set I5, 4
  @@ -652,7 +652,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_pi - nested struct * w named access");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_pi", "pi"
     set I5, 8  # test fun number
     invoke
  @@ -722,7 +722,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_pi - func_ptr* with signature");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_pi", "pi"
     # this test function returns a struct { int (*f)(char *) }
     set I5, 5
  @@ -752,7 +752,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_pi - nested struct aligned");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_pi", "pi"
     # this test function returns a struct { int; {int; int} int }
     set I5, 6
  @@ -807,7 +807,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_pi - nested struct unaligned");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_pi", "pi"
     # this test function returns a struct { char; {char; int} char }
     set I5, 7
  @@ -862,7 +862,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_pi - nested, unaligned, named");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_pi", "pi"
     # this test function returns a struct { char; {char; int} char }
     set I5, 7
  @@ -923,14 +923,14 @@
   .sub _test @MAIN
   
     # load library
  -  .local pmc libnci
  -  libnci = loadlib "libnci"
  -  unless libnci goto NOT_LOADED
  -  print "libnci was successfully loaded\n"
  +  .local pmc libnci_test
  +  libnci_test = loadlib "libnci_test"
  +  unless libnci_test goto NOT_LOADED
  +  print "libnci_test was successfully loaded\n"
   
  -  # calling a function in libnci
  +  # calling a function in libnci_test
     .local pmc nci_pi
  -  dlfunc nci_pi, libnci, "nci_pi", "pi"
  +  dlfunc nci_pi, libnci_test, "nci_pi", "pi"
     .local pmc nci_pi_out
     ( nci_pi_out ) = nci_pi( 9 )
   
  @@ -950,13 +950,13 @@
     end
   .end
   CODE
  -libnci was successfully loaded
  +libnci_test was successfully loaded
   55555
   OUTPUT
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_ip");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_ip", "ip"
     # this test function wants a struct
     # { double d; float f; int i; char*}
  @@ -1002,7 +1002,7 @@
   
   
   output_is(<<'CODE', <<'OUTPUT', "nci_vP");
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_vP", "vP"
     new P5, .PerlString
     set P5, "ok\n"
  @@ -1031,7 +1031,7 @@
     new_callback P5, P6, P7, "tU"      # Z in pdd16
     print "ok 1\n"
     # now call the external sub, that takes a call_back and user_data
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_cb_C1", "vpP"
     print "ok 2\n"
     # P5 is the cb
  @@ -1101,10 +1101,10 @@
       print "created a callback sub\n"
   
       # now call the external sub, that takes a callback and user data
  -    .local pmc libnci
  -    libnci = loadlib "libnci"
  +    .local pmc libnci_test
  +    libnci_test = loadlib "libnci_test"
       .local pmc nci_cb_C1
  -    nci_cb_C1 = dlfunc libnci, "nci_cb_C1", "vpP"
  +    nci_cb_C1 = dlfunc libnci_test, "nci_cb_C1", "vpP"
       print "loaded a function that takes a callback\n"
       nci_cb_C1( cb_wrapped, user_data )
   
  @@ -1163,7 +1163,7 @@
     new_callback P5, P6, P7, "iU"      # Z in pdd16
     print "ok 1\n"
     # now call the external sub, that takes a call_back and user_data
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_cb_C2", "vpP"
     print "ok 2\n"
     # P5 is the cb
  @@ -1237,10 +1237,10 @@
       print "created a callback sub\n"
   
       # now call the external sub, that takes a callback and user data
  -    .local pmc libnci
  -    libnci = loadlib "libnci"
  +    .local pmc libnci_test
  +    libnci_test = loadlib "libnci_test"
       .local pmc nci_cb_C3
  -    nci_cb_C3 = dlfunc libnci, "nci_cb_C3", "vpP"
  +    nci_cb_C3 = dlfunc libnci_test, "nci_cb_C3", "vpP"
       print "loaded a function that takes a callback\n"
       nci_cb_C3( cb_wrapped, user_data )
   
  @@ -1277,7 +1277,7 @@
     push P2, 0
     assign P6, P2
   
  -  # print referenced integer in libnci.so
  +  # print referenced integer in libnci_test.so
     I17 = P6[0]
     print "external data: "
     print I17
  @@ -1310,7 +1310,7 @@
     new_callback P5, P6, P7, "Ut"      # Z in pdd16
     print "ok 1\n"
     # now call the external sub, that takes a call_back and user_data
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_cb_D1", "vpP"
     print "ok 2\n"
     # P5 is the cb
  @@ -1368,7 +1368,7 @@
     new_callback P5, P6, P7, "Ui"      # Z in pdd16
     print "ok 1\n"
     # now call the external sub, that takes a call_back and user_data
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_cb_D2", "vpP"
     print "ok 2\n"
     # P5 is the cb
  @@ -1438,10 +1438,10 @@
       print "created a callback sub\n"
   
       # now call the external sub, that takes a callback and user data
  -    .local pmc libnci
  -    libnci = loadlib "libnci"
  +    .local pmc libnci_test
  +    libnci_test = loadlib "libnci_test"
       .local pmc nci_cb_D2
  -    nci_cb_D2 = dlfunc libnci, "nci_cb_D2", "vpP"
  +    nci_cb_D2 = dlfunc libnci_test, "nci_cb_D2", "vpP"
       print "loaded a function that takes a callback\n"
       nci_cb_D2( cb_wrapped, user_data )
   
  @@ -1515,10 +1515,10 @@
       print "created a callback sub\n"
   
       # now call the external sub, that takes a callback and user data
  -    .local pmc libnci
  -    libnci = loadlib "libnci"
  +    .local pmc libnci_test
  +    libnci_test = loadlib "libnci_test"
       .local pmc nci_cb_D3
  -    nci_cb_D3 = dlfunc libnci, "nci_cb_D3", "vpP"
  +    nci_cb_D3 = dlfunc libnci_test, "nci_cb_D3", "vpP"
       print "loaded a function that takes a callback\n"
       nci_cb_D3( cb_wrapped, user_data )
   
  @@ -1555,7 +1555,7 @@
     push P2, 0
     assign P6, P2
   
  -  # print referenced integer in libnci.so
  +  # print referenced integer in libnci_test.so
     I17 = P6[0]
     print "external data: "
     print I17
  @@ -1590,13 +1590,13 @@
       user_data = new Integer
       user_data = 42
   
  -    # load libnci
  -    .local pmc libnci
  -    libnci = loadlib "libnci"
  +    # load libnci_test
  +    .local pmc libnci_test
  +    libnci_test = loadlib "libnci_test"
   
       # reset int_cb_D4 to 1
       .local pmc int_cb_D4
  -    int_cb_D4 = dlvar libnci, "int_cb_D4"
  +    int_cb_D4 = dlvar libnci_test, "int_cb_D4"
       .local pmc int_cb_D4_decl
       int_cb_D4_decl = new PerlArray
       push int_cb_D4_decl, .DATATYPE_INT
  @@ -1615,7 +1615,7 @@
   
       # now call the external sub, that takes a callback and user data
       .local pmc nci_cb_D4
  -    nci_cb_D4 = dlfunc libnci, "nci_cb_D4", "vpP"
  +    nci_cb_D4 = dlfunc libnci_test, "nci_cb_D4", "vpP"
       print "loaded a function that takes a callback\n"
       nci_cb_D4( cb_wrapped, user_data )
   
  @@ -1726,7 +1726,7 @@
     set I1, 1
     set I3, 4
   
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_pip", "pip"
     invoke
     end
  @@ -1767,7 +1767,7 @@
     set I2, 0
     set I3, 2
     set I4, 0
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_i33", "i33"
     invoke
   
  @@ -1829,7 +1829,7 @@
     set I3, 1
     set I4, 0
   
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_vpii", "vpii"
     invoke
   
  @@ -1868,7 +1868,7 @@
     set I7, 400
     set I8, 800
   
  -  loadlib P1, "libnci"
  +  loadlib P1, "libnci_test"
     dlfunc P0, P1, "nci_piiii", "piiii"
     invoke
   
  @@ -1925,21 +1925,21 @@
   OUTPUT
   
   
  -output_is( << 'CODE', << "OUTPUT", "nci_pii - writing back to libnci.so" );
  +output_is( << 'CODE', << "OUTPUT", "nci_pii - writing back to 
libnci_test.so" );
   ##PIR##
   .include "datatypes.pasm"
   
   .sub _test @MAIN
   
     # load library
  -  .local pmc libnci
  -  libnci = loadlib "libnci"
  -  unless libnci goto NOT_LOADED
  -  print "libnci was successfully loaded\n"
  +  .local pmc libnci_test
  +  libnci_test = loadlib "libnci_test"
  +  unless libnci_test goto NOT_LOADED
  +  print "libnci_test was successfully loaded\n"
   
  -  # calling a function in libnci
  +  # calling a function in libnci_test
     .local pmc multiply
  -  multiply = dlfunc libnci, "nci_pii", "pii"
  +  multiply = dlfunc libnci_test, "nci_pii", "pii"
     .local pmc product_pointer
     ( product_pointer ) = multiply( -5, 11111 )
   
  @@ -1957,13 +1957,13 @@
     print product
     print "\n"
   
  -  # Write back into libnci and check it
  +  # Write back into libnci_test and check it
     product_pointer[0] = 333
     product = 4444
     print product
     print "\n"
     .local pmc get_product
  -  dlfunc get_product, libnci, "nci_i", "i"
  +  dlfunc get_product, libnci_test, "nci_i", "i"
     ( product ) = get_product()
     print product
     print "\n"
  @@ -1972,7 +1972,7 @@
     end
   .end
   CODE
  -libnci was successfully loaded
  +libnci_test was successfully loaded
   -55555
   4444
   333
  @@ -1985,18 +1985,18 @@
   
   .sub _test @MAIN
   
  -    # load libnci.so
  +    # load libnci_test.so
       .local string library_name
  -    library_name = 'libnci'
  -    .local pmc libnci
  -    libnci = loadlib library_name
  -    unless libnci goto NOT_LOADED
  +    library_name = 'libnci_test'
  +    .local pmc libnci_test
  +    libnci_test = loadlib library_name
  +    unless libnci_test goto NOT_LOADED
       print library_name
       print " was successfully loaded\n"
   
       # address of nci_dlvar_int
       .local pmc nci_dlvar_int
  -    nci_dlvar_int = dlvar libnci, "nci_dlvar_int"
  +    nci_dlvar_int = dlvar libnci_test, "nci_dlvar_int"
   
       # the contained structure pointer
       .local pmc nci_dlvar_int_decl
  @@ -2011,7 +2011,7 @@
       print "\n"
   
       .local pmc thrice
  -    thrice = dlfunc libnci, "nci_dlvar_vv", "vv"
  +    thrice = dlfunc libnci_test, "nci_dlvar_vv", "vv"
       thrice()
       I1 = nci_dlvar_int[0]
       print I1
  @@ -2031,7 +2031,7 @@
   NOT_LOADED:
   .end
   CODE
  -libnci was successfully loaded
  +libnci_test was successfully loaded
   -4444
   -13332
   -39996
  @@ -2046,18 +2046,18 @@
   
   .sub _test @MAIN
   
  -    # load libnci.so
  +    # load libnci_test.so
       .local string library_name
  -    library_name = 'libnci'
  -    .local pmc libnci
  -    libnci = loadlib library_name
  -    unless libnci goto NOT_LOADED
  +    library_name = 'libnci_test'
  +    .local pmc libnci_test
  +    libnci_test = loadlib library_name
  +    unless libnci_test goto NOT_LOADED
       print library_name
       print " was successfully loaded\n"
   
       # address of nci_dlvar_int
       .local pmc non_existing
  -    non_existing = dlvar libnci, "non_existing"
  +    non_existing = dlvar libnci_test, "non_existing"
       .local int is_defined
       is_defined = defined non_existing
       if is_defined goto IS_DEFINED
  @@ -2066,7 +2066,7 @@
   NOT_LOADED:
   .end
   CODE
  -libnci was successfully loaded
  +libnci_test was successfully loaded
   'non_existing' is not defined
   OUTPUT
   
  @@ -2077,18 +2077,18 @@
   
   .sub _test @MAIN
   
  -    # load libnci.so
  +    # load libnci_test.so
       .local string library_name
  -    library_name = 'libnci'
  -    .local pmc libnci
  -    libnci = loadlib library_name
  -    unless libnci goto NOT_LOADED
  +    library_name = 'libnci_test'
  +    .local pmc libnci_test
  +    libnci_test = loadlib library_name
  +    unless libnci_test goto NOT_LOADED
       print library_name
       print " was successfully loaded\n"
   
       # address of nci_dlvar_int
       .local pmc non_existing
  -    non_existing = dlfunc libnci, "non_existing", "iiii"
  +    non_existing = dlfunc libnci_test, "non_existing", "iiii"
       .local int is_defined
       is_defined = defined non_existing
       if is_defined goto IS_DEFINED
  @@ -2097,16 +2097,16 @@
   NOT_LOADED:
   .end
   CODE
  -libnci was successfully loaded
  +libnci_test was successfully loaded
   'non_existing' is not defined
   OUTPUT
   
   output_is( << 'CODE', << 'OUTPUT', "loading same library twice" );
  -      loadlib P1, "libnci"
  +      loadlib P1, "libnci_test"
         if P1, OK1
         print "not "
   OK1:  print "ok 1\n"
  -      loadlib P2, "libnci"
  +      loadlib P2, "libnci_test"
         if P2, OK2
         print "not "
   OK2:  print "ok 2\n"
  
  
  

Reply via email to