Repacements for deprecated functions

7 Messages Forum Options Options
Permalink
Iliyan Gochev
Repacements for deprecated functions
Reply Threaded More
Print post
Permalink
Hello,

I'm trying to get Matisse bindings for Eiffel to work with ES6.2, but
I found some missing functions like spsubcopy (MT_ARRAY), exclear,
eraise (MT_EXCEPTIONS).
I saw that spsubcopy used to be part of the ARRAY class, which called
an  external C function, but I couldn't find suitable replacement. No
such luck with the exception functions.

Thanks in advance,
Iliyan Gochev


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@...
    mailto:eiffel_software-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Emmanuel Stapf
RE: Repacements for deprecated functions
Reply Threaded More
Print post
Permalink
> I'm trying to get Matisse bindings for Eiffel to work with ES6.2, but
> I found some missing functions like spsubcopy (MT_ARRAY), exclear,
> eraise (MT_EXCEPTIONS).
> I saw that spsubcopy used to be part of the ARRAY class, which called
> an  external C function, but I couldn't find suitable replacement. No
> such luck with the exception functions.

In 6.2, the feature `exclear'  is not needed anymore. For `eraise', you can simply
create a new MATISSE_EXCEPTION class which inherits from EXCEPTION and call
`raise' on it. For `spsubcopy', I think that if you use `subcopy' from ARRAY that
would do a good replacement.

Regards,
Manu


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@...
    mailto:eiffel_software-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------  
Iliyan Gochev
Re: Repacements for deprecated functions
Reply Threaded More
Print post
Permalink
Thank you,

I think I fixed those issues, but now I got new one: the linking breaks with
the following error message:
wmt_support.lib(wmt_support.obj) : error LNK2019: unresolved external symbol
_References referenced in function _eif_array_area
wmt_support.lib(wmt_support.obj) : error LNK2019: unresolved external symbol
_RTAS_OPT referenced in function _c_get_string_array

I've tried clean compilation but still no luck. I guess I have to add
another external lib, but which one?

Best regards,
Iliyan Gochev

On Mon, Jun 30, 2008 at 6:25 PM, Emmanuel Stapf [ES] <manus@...>
wrote:

>   > I'm trying to get Matisse bindings for Eiffel to work with ES6.2, but
> > I found some missing functions like spsubcopy (MT_ARRAY), exclear,
> > eraise (MT_EXCEPTIONS).
> > I saw that spsubcopy used to be part of the ARRAY class, which called
> > an external C function, but I couldn't find suitable replacement. No
> > such luck with the exception functions.
>
> In 6.2, the feature `exclear' is not needed anymore. For `eraise', you can
> simply
> create a new MATISSE_EXCEPTION class which inherits from EXCEPTION and call
> `raise' on it. For `spsubcopy', I think that if you use `subcopy' from
> ARRAY that
> would do a good replacement.
>
> Regards,
> Manu
>
>  
>


[Non-text portions of this message have been removed]


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@...
    mailto:eiffel_software-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Emmanuel Stapf
RE: Repacements for deprecated functions
Reply Threaded More
Print post
Permalink
> wmt_support.lib(wmt_support.obj) : error LNK2019: unresolved external
> symbol
> _References referenced in function _eif_array_area
> wmt_support.lib(wmt_support.obj) : error LNK2019: unresolved external
> symbol
> _RTAS_OPT referenced in function _c_get_string_array
>
> I've tried clean compilation but still no luck. I guess I have to add
> another external lib, but which one?

Those requires the C code provided by the Matisse binding to be updated to the new
EiffelStudio 6.2 headers. The macro RTAS_OPT can be safely replaced by RTAR, since
RTAR takes one argument less, simply remove the index argument. For
`eif_array_area' using `References', it will need to be rewritten so that it does
not use `References' anymore. Can you show me the code, and I can provide you with
the updated version?

Manu


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@...
    mailto:eiffel_software-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------  
Iliyan Gochev
Re: Repacements for deprecated functions
Reply Threaded More
Print post
Permalink
Hi Manu,

I've replaced the RTAS_OPT macro and now I only have to fix the C codes
using References(). Below are the two C functions that make use of
References():

/*--------------------------------------------*/
EIF_REFERENCE eif_array_area (EIF_OBJ obj)
/*--------------------------------------------*/
/*
 * Starting address of area associated with Eiffel object `obj'.
 * Object `obj' owns a reference to a special object or is a special
 * object.
 * Returns Void if no special object found.
 *
 */
{
    uint32 flags;
  EIF_OBJ object;
  char *o_ptr, *o_ref;
  long refer_count;
    int16 dtype;

  object = obj;
  flags = HEADER(object)->ov_flags;
  dtype = Dtype (object);
  if (flags & EO_SPEC) {
    special:
    if (!(flags & EO_REF) && (flags & EO_COMP))
      return (object + OVERHEAD);
    else return (object);
  }

  refer_count = References(dtype);
  for (
             o_ptr = object; refer_count > 0 ;
             refer_count--, o_ptr = (char *)(((char **) o_ptr) +1)
             ) {
    o_ref = *(char **)o_ptr;
        if (o_ref != (char *) 0) {
      object = o_ref;
      flags = HEADER(object)->ov_flags;
      if (flags & EO_SPEC) {
        dtype = Dtype (object);
        goto special;
      }
    }
  }
  return (NULL);
}

/*--------------------------------------------*/
long eif_array_count (EIF_OBJ obj)
/*--------------------------------------------*/
/*
 * Number of allocated cells for `obj' with obj of type
 * ARRAY or SPECIAL else returns 0.
 *
 */
{
  union overhead *zone;
  uint32 flags;
  char *o_ref, *o_ptr;
  long refer_count;
  EIF_OBJ object;
  int16 dtype;

  object = obj;
   zone = HEADER(object);
  flags = zone->ov_flags;
  dtype = Dtype (object);
  if (flags & EO_SPEC) {
special:
     o_ref = (char *) (object + (zone->ov_size & B_SIZE) - LNGPAD(2));
     return (*(long *) o_ref);
  }
  else {
    refer_count = References(dtype);
    for (
      o_ptr = object; refer_count > 0 ;
      refer_count--, o_ptr = (char *)(((char **) o_ptr) +1)
    ) {
      o_ref = *(char **)o_ptr;
      if (o_ref != (char *) 0) {
        object = o_ref;
        zone = HEADER(object);
        flags = zone->ov_flags;
        if (flags & EO_SPEC) {
          dtype = Dtype(object);
          goto special;
        }
      }
    }
    return ((long) 0);
  }
}

Best regards,
Iliyan Gochev


On Tue, Jul 1, 2008 at 8:13 PM, Emmanuel Stapf [ES] <manus@...>
wrote:

>   > wmt_support.lib(wmt_support.obj) : error LNK2019: unresolved external
> > symbol
> > _References referenced in function _eif_array_area
> > wmt_support.lib(wmt_support.obj) : error LNK2019: unresolved external
> > symbol
> > _RTAS_OPT referenced in function _c_get_string_array
> >
> > I've tried clean compilation but still no luck. I guess I have to add
> > another external lib, but which one?
>
> Those requires the C code provided by the Matisse binding to be updated to
> the new
> EiffelStudio 6.2 headers. The macro RTAS_OPT can be safely replaced by
> RTAR, since
> RTAR takes one argument less, simply remove the index argument. For
> `eif_array_area' using `References', it will need to be rewritten so that
> it does
> not use `References' anymore. Can you show me the code, and I can provide
> you with
> the updated version?
>
> Manu
>
>  
>


[Non-text portions of this message have been removed]


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@...
    mailto:eiffel_software-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Emmanuel Stapf
RE: Repacements for deprecated functions
Reply Threaded More
Print post
Permalink
I would simply do.

#include "eif_internal.h"

EIF_REFERENCE eif_array_area (EIF_OBJECT obj) {
        return (eif_attribute (eif_access (obj), "area", EIF_REFERENCE, NULL));
}

long eif_array_count (EIF_OBJECT obj) {
        EIF_REFERENCE area = eif_array_area (obj);
        if (area) {
                return (long) sp_count(area);
        }
}

Note that unlike its name suggest, `eif_array_count' does not return the
ARRAY.count value, but the capacity of the `area' attribute (at least that's what
the old code you put does).

You can fine more info about `eif_attribute' at
 
http://docs.eiffel.com/eiffelstudio/technologies/cecil/man_pages/eif_attribute.1.h
tml

Regards,
Manu


> -----Original Message-----
> From: eiffel_software@...
> [mailto:eiffel_software@...] On Behalf Of Iliyan Gochev
> Sent: Wednesday, July 02, 2008 2:41 AM
> To: eiffel_software@...
> Subject: Re: [eiffel_software] Repacements for deprecated functions
>
> Hi Manu,
>
> I've replaced the RTAS_OPT macro and now I only have to fix the C codes
> using References(). Below are the two C functions that make use of
> References():
>
> /*--------------------------------------------*/
> EIF_REFERENCE eif_array_area (EIF_OBJ obj)
> /*--------------------------------------------*/
> /*
>  * Starting address of area associated with Eiffel object `obj'.
>  * Object `obj' owns a reference to a special object or is a special
>  * object.
>  * Returns Void if no special object found.
>  *
>  */
> {
>     uint32 flags;
>   EIF_OBJ object;
>   char *o_ptr, *o_ref;
>   long refer_count;
>     int16 dtype;
>
>   object = obj;
>   flags = HEADER(object)->ov_flags;
>   dtype = Dtype (object);
>   if (flags & EO_SPEC) {
>     special:
>     if (!(flags & EO_REF) && (flags & EO_COMP))
>       return (object + OVERHEAD);
>     else return (object);
>   }
>
>   refer_count = References(dtype);
>   for (
>              o_ptr = object; refer_count > 0 ;
>              refer_count--, o_ptr = (char *)(((char **) o_ptr) +1)
>              ) {
>     o_ref = *(char **)o_ptr;
>         if (o_ref != (char *) 0) {
>       object = o_ref;
>       flags = HEADER(object)->ov_flags;
>       if (flags & EO_SPEC) {
>         dtype = Dtype (object);
>         goto special;
>       }
>     }
>   }
>   return (NULL);
> }
>
> /*--------------------------------------------*/
> long eif_array_count (EIF_OBJ obj)
> /*--------------------------------------------*/
> /*
>  * Number of allocated cells for `obj' with obj of type
>  * ARRAY or SPECIAL else returns 0.
>  *
>  */
> {
>   union overhead *zone;
>   uint32 flags;
>   char *o_ref, *o_ptr;
>   long refer_count;
>   EIF_OBJ object;
>   int16 dtype;
>
>   object = obj;
>    zone = HEADER(object);
>   flags = zone->ov_flags;
>   dtype = Dtype (object);
>   if (flags & EO_SPEC) {
> special:
>      o_ref = (char *) (object + (zone->ov_size & B_SIZE) - LNGPAD(2));
>      return (*(long *) o_ref);
>   }
>   else {
>     refer_count = References(dtype);
>     for (
>       o_ptr = object; refer_count > 0 ;
>       refer_count--, o_ptr = (char *)(((char **) o_ptr) +1)
>     ) {
>       o_ref = *(char **)o_ptr;
>       if (o_ref != (char *) 0) {
>         object = o_ref;
>         zone = HEADER(object);
>         flags = zone->ov_flags;
>         if (flags & EO_SPEC) {
>           dtype = Dtype(object);
>           goto special;
>         }
>       }
>     }
>     return ((long) 0);
>   }
> }
>
> Best regards,
> Iliyan Gochev
>
>
> On Tue, Jul 1, 2008 at 8:13 PM, Emmanuel Stapf [ES] <manus@...>
> wrote:
>
> >   > wmt_support.lib(wmt_support.obj) : error LNK2019: unresolved
> external
> > > symbol
> > > _References referenced in function _eif_array_area
> > > wmt_support.lib(wmt_support.obj) : error LNK2019: unresolved external
> > > symbol
> > > _RTAS_OPT referenced in function _c_get_string_array
> > >
> > > I've tried clean compilation but still no luck. I guess I have to add
> > > another external lib, but which one?
> >
> > Those requires the C code provided by the Matisse binding to be updated
> to
> > the new
> > EiffelStudio 6.2 headers. The macro RTAS_OPT can be safely replaced by
> > RTAR, since
> > RTAR takes one argument less, simply remove the index argument. For
> > `eif_array_area' using `References', it will need to be rewritten so
> that
> > it does
> > not use `References' anymore. Can you show me the code, and I can
> provide
> > you with
> > the updated version?
> >
> > Manu
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@...
    mailto:eiffel_software-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------  
Iliyan Gochev
Re: Repacements for deprecated functions
Reply Threaded More
Print post
Permalink
Thank you Manu,

Now everythng seems to be in order.
Now I'll dig deeper into Matisse to see what advantages and disadvantages it
has against RDBMS. That said do you know any article comparing
Object-oriented and relational DBMS. It's not necessary to be for Eiffel
(although it would be good ;-) ).

Thanks again,
Iliyan Gochev

On Thu, Jul 3, 2008 at 9:28 PM, Emmanuel Stapf [ES] <manus@...>
wrote:

>   I would simply do.
>
> #include "eif_internal.h"
>
> EIF_REFERENCE eif_array_area (EIF_OBJECT obj) {
> return (eif_attribute (eif_access (obj), "area", EIF_REFERENCE, NULL));
> }
>
> long eif_array_count (EIF_OBJECT obj) {
> EIF_REFERENCE area = eif_array_area (obj);
> if (area) {
> return (long) sp_count(area);
> }
> }
>
> Note that unlike its name suggest, `eif_array_count' does not return the
> ARRAY.count value, but the capacity of the `area' attribute (at least
> that's what
> the old code you put does).
>
> You can fine more info about `eif_attribute' at
>
>
> http://docs.eiffel.com/eiffelstudio/technologies/cecil/man_pages/eif_attribute.1.h
> tml
>
> Regards,
> Manu
>
>
> > -----Original Message-----
> > From: eiffel_software@...<eiffel_software%40yahoogroups.com>
> > [mailto:eiffel_software@...<eiffel_software%40yahoogroups.com>]
> On Behalf Of Iliyan Gochev
> > Sent: Wednesday, July 02, 2008 2:41 AM
> > To: eiffel_software@... <eiffel_software%40yahoogroups.com>
> > Subject: Re: [eiffel_software] Repacements for deprecated functions
> >
> > Hi Manu,
> >
> > I've replaced the RTAS_OPT macro and now I only have to fix the C codes
> > using References(). Below are the two C functions that make use of
> > References():
> >
> > /*--------------------------------------------*/
> > EIF_REFERENCE eif_array_area (EIF_OBJ obj)
> > /*--------------------------------------------*/
> > /*
> > * Starting address of area associated with Eiffel object `obj'.
> > * Object `obj' owns a reference to a special object or is a special
> > * object.
> > * Returns Void if no special object found.
> > *
> > */
> > {
> > uint32 flags;
> > EIF_OBJ object;
> > char *o_ptr, *o_ref;
> > long refer_count;
> > int16 dtype;
> >
> > object = obj;
> > flags = HEADER(object)->ov_flags;
> > dtype = Dtype (object);
> > if (flags & EO_SPEC) {
> > special:
> > if (!(flags & EO_REF) && (flags & EO_COMP))
> > return (object + OVERHEAD);
> > else return (object);
> > }
> >
> > refer_count = References(dtype);
> > for (
> > o_ptr = object; refer_count > 0 ;
> > refer_count--, o_ptr = (char *)(((char **) o_ptr) +1)
> > ) {
> > o_ref = *(char **)o_ptr;
> > if (o_ref != (char *) 0) {
> > object = o_ref;
> > flags = HEADER(object)->ov_flags;
> > if (flags & EO_SPEC) {
> > dtype = Dtype (object);
> > goto special;
> > }
> > }
> > }
> > return (NULL);
> > }
> >
> > /*--------------------------------------------*/
> > long eif_array_count (EIF_OBJ obj)
> > /*--------------------------------------------*/
> > /*
> > * Number of allocated cells for `obj' with obj of type
> > * ARRAY or SPECIAL else returns 0.
> > *
> > */
> > {
> > union overhead *zone;
> > uint32 flags;
> > char *o_ref, *o_ptr;
> > long refer_count;
> > EIF_OBJ object;
> > int16 dtype;
> >
> > object = obj;
> > zone = HEADER(object);
> > flags = zone->ov_flags;
> > dtype = Dtype (object);
> > if (flags & EO_SPEC) {
> > special:
> > o_ref = (char *) (object + (zone->ov_size & B_SIZE) - LNGPAD(2));
> > return (*(long *) o_ref);
> > }
> > else {
> > refer_count = References(dtype);
> > for (
> > o_ptr = object; refer_count > 0 ;
> > refer_count--, o_ptr = (char *)(((char **) o_ptr) +1)
> > ) {
> > o_ref = *(char **)o_ptr;
> > if (o_ref != (char *) 0) {
> > object = o_ref;
> > zone = HEADER(object);
> > flags = zone->ov_flags;
> > if (flags & EO_SPEC) {
> > dtype = Dtype(object);
> > goto special;
> > }
> > }
> > }
> > return ((long) 0);
> > }
> > }
> >
> > Best regards,
> > Iliyan Gochev
> >
> >
> > On Tue, Jul 1, 2008 at 8:13 PM, Emmanuel Stapf [ES] <manus@...<manus%40eiffel.com>
> >
> > wrote:
> >
> > > > wmt_support.lib(wmt_support.obj) : error LNK2019: unresolved
> > external
> > > > symbol
> > > > _References referenced in function _eif_array_area
> > > > wmt_support.lib(wmt_support.obj) : error LNK2019: unresolved external
> > > > symbol
> > > > _RTAS_OPT referenced in function _c_get_string_array
> > > >
> > > > I've tried clean compilation but still no luck. I guess I have to add
> > > > another external lib, but which one?
> > >
> > > Those requires the C code provided by the Matisse binding to be updated
> > to
> > > the new
> > > EiffelStudio 6.2 headers. The macro RTAS_OPT can be safely replaced by
> > > RTAR, since
> > > RTAR takes one argument less, simply remove the index argument. For
> > > `eif_array_area' using `References', it will need to be rewritten so
> > that
> > > it does
> > > not use `References' anymore. Can you show me the code, and I can
> > provide
> > > you with
> > > the updated version?
> > >
> > > Manu
> > >
> > >
> > >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>
>  
>


[Non-text portions of this message have been removed]


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@...
    mailto:eiffel_software-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/