Re: [E-devel] Evas Smart objects

2006-06-19 Thread [EMAIL PROTECTED]
 
   2. the implementation   
   ive been playing with smart objects for evoak, so ill explain   

   I thought evoak was considered to be laid to rest?   
  
 No, it was just sleeping.  B-)  
   
 There has been a great desire amongst a few people to get evoak up 
 and on it's feet, and make it a useful thing.  I'm guessing that 
 Jorge is attempting that.  There is even money in it (someone has 
 offered a small bounty).  
 
Ahh, I see. Well, all the best to those involved :) 
 
Just to add a bit to the original email: 
If what Jorge or any others here are really interested in is 
having an evas canvas object, then that is fairly easy to add 
to evas. 
A 'quick  dirty' initial implementation would be along 
the same lines as what ecore-evas now does (one can later work 
on having more refined versions). 
 
The api would be simple: 
 
Evas_Object *evas_object_canvas_add(Evas *evas); 
which would add a 'canvas_obj' object to the given evas, 
and 
Evas *evas_object_canvas_evas_get(Evas_Object *canvas_obj); 
which would retrieve the internal evas that the given canvas_obj 
is associated with. 
 
You would then use the retrieved evas to do whatever.. 
add objects to it (you would not need to render such evases 
directly yourself as they will render when the associated canvas 
object gets rendered), etc, etc, :) 
 
 
jose. 
 



___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[E-devel] Edje transition: works only in one direction

2006-06-19 Thread Sevcsik AndrĂ¡s
Hi list.

I have these programs:

program { /*Programs that do the mouseover animation for statusimg_bg */
name, statusimg_bg_in;
signal, mouse,in;
source, statusimg_bg_over;
action, STATE_SET state2 1.0;
target, statusimg_bg_over;
transition, LINEAR 0.5;
after, statusimg_bg_in2;
}
program { 
name, statusimg_bg_in2;
action, STATE_SET state2 1.0;
target, statusimg_bg;
transition, LINEAR 0.5;
}
program { /* !! TODO: TRANSITION IS NOT WORKING HERE !!! */
name, statusimg_bg_out;
signal, mouse,out;
source, statusimg_bg_over;
action, STATE_SET state1 1.0;
target, statusimg_bg;
transition, LINEAR 0.5;
after, statusimg_bg_out2;
}
program { 
name, statusimg_bg_out2;
action, STATE_SET state1 1.0;
target, statusimg_bg_over;
transition, LINEAR 0.5;
}

Transition works nicely at mouse,in, but it at mouse,out, it only wait 0.5 
seconds, and change suddenly. These are just alpha changes, so I don't 
understand.

statusimg_bg (original)
state1 - visible
state2 - hidden

statusimg_bg (glow)
state1 - hidden
state2 - visible


___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Evas Smart objects

2006-06-19 Thread brian . mattern
On Mon, Jun 19, 2006 at 01:17:03AM +0200, Jorge Luis Zapata Muga wrote:
 Hi all,
 i have some doubts-ideas about evas smart objects,
 
 1. the API
 in order to add an object to a smart object you have to do
 _member_add(o, s) and to delete _member_del(o,s). On the code of both
 an evas smart object actually stores the members on a list but theres
 no function to retrieve them, Evas_List * _members_get(s), so when you
 code an evas smart obejct and you need to keep track of the objects
 you have, you need to duplicate the list and code a different function
 to do that.

Adding api to get the member list makes sense to me. Simple enough to
do, and would solve the issues you mentioned here.

 
 2. the implementation
 ive been playing with smart objects for evoak, so ill explain the case:
 my goal was to create a container, an evas objects container. the
 problem i see is that the evas smart objects where thought for a
 static environment, on the callback of a smart object add you create
 the static objects inside, store them on your list and when something
 happens (move, resize, whatever) you act accord with that and apply
 that to your internal objects. thats fine. but i thought the idea of
 the smart objects was to actually be a sub canvas of evas, so when you
 add an object: evas_object_add(evas) and then add it as a member of
 smart object it is no longer part of the evas objects but of the smart
 objects, so for example a layer change on that is actually a layer
 change inside the layers of the sub canvas, wich in fact the subcanvas
 is in one layer. but not in the evas canvas layers. another example is
 that when you move an object what is member of a smart object it
 should move relative to it, no relative to the evas canvas. dont know
 if i explain myself correctly :)
 so a problem with this is that if you want to move an object that is
 part of smart object you should call a different (own) function to
 calculate all the relative coordinates and move it there.

I'm not sure I quite understand what you're trying to do exactly.
Smart objects are not a sub-canvas, although they could be implemented
in such a way. Right now, the members stay as normal objects in the main
canvas. So, yes, you need to transform you local smart object relative
coordinates to canvas ones. Although slightly inconvenient, I don't see
this as a real issue.

As for layering, I believe evas handles smart object memeber layering
different from 'normal' objects. As far as I know, it keeps them
together so that they cannot interleave. I haven't looked at the actual
implementation of this though. In your theoretical subcanvas
implementation, this would be more clearly enforced.


 so my question is, the current aproach of evas smart objects in the
 correct way? or my use case is just an specific and doesnt make sense
 to change the behaviour of the smart objects?
 maybe a solution could be to add callbacks for a move, resize,
 layer_set, whatever, but not for the smart object but for the elements
 of a smart object.

The current way probably isn't the most ideal, but I think the answer
you're going to get will be along the lines of It works for everything
we need now. Maybe after e17 is released we can go back and improve
things. :)

--
rephorm



___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] E CVS: snow devilhorns

2006-06-19 Thread Andrew Williams
Not to complain to harsly - but is it not the job of the module owner to
decide on the licence for his/her own work???

Andy (snow author)

On Mon, Jun 19, 2006 at 04:52:56PM -0400, Enlightenment CVS wrote:
 Enlightenment CVS committal
 
 Author  : devilhorns
 Project : e_modules
 Module  : snow
 
 Dir : e_modules/snow
 
 
 Modified Files:
   COPYING 
 Added Files:
   COPYING-PLAIN 
 
 
 Log Message:
 Update license for snow module to bsd.
 
 ===
 RCS file: /cvs/e/e_modules/snow/COPYING,v
 retrieving revision 1.1
 retrieving revision 1.2
 diff -u -3 -r1.1 -r1.2
 --- COPYING   12 Dec 2005 05:14:17 -  1.1
 +++ COPYING   19 Jun 2006 20:52:56 -  1.2
 @@ -1,340 +1,28 @@
 - GNU GENERAL PUBLIC LICENSE
 -Version 2, June 1991
 +Copyright (C) 2004 The Enlightenment Development Team
  
 - Copyright (C) 1989, 1991 Free Software Foundation, Inc.
 - 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 - Everyone is permitted to copy and distribute verbatim copies
 - of this license document, but changing it is not allowed.
 -
 - Preamble
 -
 -  The licenses for most software are designed to take away your
 -freedom to share and change it.  By contrast, the GNU General Public
 -License is intended to guarantee your freedom to share and change free
 -software--to make sure the software is free for all its users.  This
 -General Public License applies to most of the Free Software
 -Foundation's software and to any other program whose authors commit to
 -using it.  (Some other Free Software Foundation software is covered by
 -the GNU Library General Public License instead.)  You can apply it to
 -your programs, too.
 -
 -  When we speak of free software, we are referring to freedom, not
 -price.  Our General Public Licenses are designed to make sure that you
 -have the freedom to distribute copies of free software (and charge for
 -this service if you wish), that you receive source code or can get it
 -if you want it, that you can change the software or use pieces of it
 -in new free programs; and that you know you can do these things.
 -
 -  To protect your rights, we need to make restrictions that forbid
 -anyone to deny you these rights or to ask you to surrender the rights.
 -These restrictions translate to certain responsibilities for you if you
 -distribute copies of the software, or if you modify it.
 -
 -  For example, if you distribute copies of such a program, whether
 -gratis or for a fee, you must give the recipients all the rights that
 -you have.  You must make sure that they, too, receive or can get the
 -source code.  And you must show them these terms so they know their
 -rights.
 -
 -  We protect your rights with two steps: (1) copyright the software, and
 -(2) offer you this license which gives you legal permission to copy,
 -distribute and/or modify the software.
 -
 -  Also, for each author's protection and ours, we want to make certain
 -that everyone understands that there is no warranty for this free
 -software.  If the software is modified by someone else and passed on, we
 -want its recipients to know that what they have is not the original, so
 -that any problems introduced by others will not reflect on the original
 -authors' reputations.
 -
 -  Finally, any free program is threatened constantly by software
 -patents.  We wish to avoid the danger that redistributors of a free
 -program will individually obtain patent licenses, in effect making the
 -program proprietary.  To prevent this, we have made it clear that any
 -patent must be licensed for everyone's free use or not licensed at all.
 -
 -  The precise terms and conditions for copying, distribution and
 -modification follow.
 -
 - GNU GENERAL PUBLIC LICENSE
 -   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 -
 -  0. This License applies to any program or other work which contains
 -a notice placed by the copyright holder saying it may be distributed
 -under the terms of this General Public License.  The Program, below,
 -refers to any such program or work, and a work based on the Program
 -means either the Program or any derivative work under copyright law:
 -that is to say, a work containing the Program or a portion of it,
 -either verbatim or with modifications and/or translated into another
 -language.  (Hereinafter, translation is included without limitation in
 -the term modification.)  Each licensee is addressed as you.
 -
 -Activities other than copying, distribution and modification are not
 -covered by this License; they are outside its scope.  The act of
 -running the Program is not restricted, and the output from the Program
 -is covered only if its contents constitute a work based on the
 -Program (independent of having been made by running the Program).
 -Whether that is true depends on what the Program does.
 -
 -  1. You may 

Re: [E-devel] E CVS: snow devilhorns

2006-06-19 Thread Andrew Williams
Whilst this is a valid point I was forgetting that snow was initially a
core module that I put in under BSD, so that is quite right - BSD it is.
Must have been thinking of one of my others.

Sorry
Andy

On Mon, Jun 19, 2006 at 04:48:51PM +0100, Andrew Williams wrote:
 Not to complain to harsly - but is it not the job of the module owner to
 decide on the licence for his/her own work???
 
 Andy (snow author)
 
 On Mon, Jun 19, 2006 at 04:52:56PM -0400, Enlightenment CVS wrote:
  Enlightenment CVS committal
  
  Author  : devilhorns
  Project : e_modules
  Module  : snow
  
  Dir : e_modules/snow
  
  
  Modified Files:
  COPYING 
  Added Files:
  COPYING-PLAIN 
  
  
  Log Message:
  Update license for snow module to bsd.
  
  ===
  RCS file: /cvs/e/e_modules/snow/COPYING,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -3 -r1.1 -r1.2
  --- COPYING 12 Dec 2005 05:14:17 -  1.1
  +++ COPYING 19 Jun 2006 20:52:56 -  1.2
  @@ -1,340 +1,28 @@
  -   GNU GENERAL PUBLIC LICENSE
  -  Version 2, June 1991
  +Copyright (C) 2004 The Enlightenment Development Team
   
  - Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  - 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  - Everyone is permitted to copy and distribute verbatim copies
  - of this license document, but changing it is not allowed.
  -
  -   Preamble
  -
  -  The licenses for most software are designed to take away your
  -freedom to share and change it.  By contrast, the GNU General Public
  -License is intended to guarantee your freedom to share and change free
  -software--to make sure the software is free for all its users.  This
  -General Public License applies to most of the Free Software
  -Foundation's software and to any other program whose authors commit to
  -using it.  (Some other Free Software Foundation software is covered by
  -the GNU Library General Public License instead.)  You can apply it to
  -your programs, too.
  -
  -  When we speak of free software, we are referring to freedom, not
  -price.  Our General Public Licenses are designed to make sure that you
  -have the freedom to distribute copies of free software (and charge for
  -this service if you wish), that you receive source code or can get it
  -if you want it, that you can change the software or use pieces of it
  -in new free programs; and that you know you can do these things.
  -
  -  To protect your rights, we need to make restrictions that forbid
  -anyone to deny you these rights or to ask you to surrender the rights.
  -These restrictions translate to certain responsibilities for you if you
  -distribute copies of the software, or if you modify it.
  -
  -  For example, if you distribute copies of such a program, whether
  -gratis or for a fee, you must give the recipients all the rights that
  -you have.  You must make sure that they, too, receive or can get the
  -source code.  And you must show them these terms so they know their
  -rights.
  -
  -  We protect your rights with two steps: (1) copyright the software, and
  -(2) offer you this license which gives you legal permission to copy,
  -distribute and/or modify the software.
  -
  -  Also, for each author's protection and ours, we want to make certain
  -that everyone understands that there is no warranty for this free
  -software.  If the software is modified by someone else and passed on, we
  -want its recipients to know that what they have is not the original, so
  -that any problems introduced by others will not reflect on the original
  -authors' reputations.
  -
  -  Finally, any free program is threatened constantly by software
  -patents.  We wish to avoid the danger that redistributors of a free
  -program will individually obtain patent licenses, in effect making the
  -program proprietary.  To prevent this, we have made it clear that any
  -patent must be licensed for everyone's free use or not licensed at all.
  -
  -  The precise terms and conditions for copying, distribution and
  -modification follow.
  -
  -   GNU GENERAL PUBLIC LICENSE
  -   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  -
  -  0. This License applies to any program or other work which contains
  -a notice placed by the copyright holder saying it may be distributed
  -under the terms of this General Public License.  The Program, below,
  -refers to any such program or work, and a work based on the Program
  -means either the Program or any derivative work under copyright law:
  -that is to say, a work containing the Program or a portion of it,
  -either verbatim or with modifications and/or translated into another
  -language.  (Hereinafter, translation is included without limitation in
  -the term modification.)  Each licensee is addressed as you.
  -
  -Activities other than copying, distribution and modification 

[E-devel] Actions for window fullscreen

2006-06-19 Thread R . Ramkumar
Hi!

This patch had been sitting with me for quite some time. If you guys
are ok with it, I could commit it. Basically adds an action for
toggling/fullscreen'ing of a window. Actually I once wrote an action
to send data over a socket, making it easy for writing shortcuts for
music player ipc's around. I know that this could be achieved by an
exec nc ..., but I was a bit unsatisfied with the delay :) I'm not
convinced myself as to whether this should go in, but I just included
it in case any one felt it was worthy enough.. Feel free to reject it
:)

Index: e_actions.c
===
RCS file: /cvs/e/e17/apps/e/src/bin/e_actions.c,v
retrieving revision 1.70
diff -r1.70 e_actions.c
355a356,416
 ACT_FN_GO(window_fullscreen_toggle)
 {
if (!obj) obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
if (obj-type != E_BORDER_TYPE)
  {
   obj = E_OBJECT(e_border_focused_get());
   if (!obj) return;
  }
if (!((E_Border *)obj)-lock_user_fullscreen)
  {
   E_Border *bd;
   bd = (E_Border *)obj;
   if (bd-fullscreen)
 e_border_unfullscreen(bd);
   else if (params == 0 || *params == '\0')
 e_border_fullscreen(bd, e_config-fullscreen_policy);
   else if (! strcmp(params, resize))
 e_border_fullscreen(bd, E_FULLSCREEN_RESIZE);
   else if (! strcmp(params, zoom))
 e_border_fullscreen(bd, E_FULLSCREEN_ZOOM);
  }
 }

 /***/
 ACT_FN_GO(window_fullscreen)
 {
if (!obj) obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
if (obj-type != E_BORDER_TYPE)
  {
   obj = E_OBJECT(e_border_focused_get());
   if (!obj) return;
  }
if (!((E_Border *)obj)-lock_user_fullscreen)
  {
   E_Border *bd;
   bd = (E_Border *)obj;
   if (params)
 {
int v;
char buf[32];
if (sscanf(params, %i %20s, v, buf) == 2)
  {
 if (v == 1)
   {
 if (buf == 0 || *buf == '\0')
   e_border_fullscreen(bd, e_config-fullscreen_policy);
 else if (! strcmp(buf, resize))
   e_border_fullscreen(bd, E_FULLSCREEN_RESIZE);
 else if (! strcmp(buf, zoom))
   e_border_fullscreen(bd, E_FULLSCREEN_ZOOM);
   }
 else if (v == 0)
   e_border_unfullscreen(bd);
  }
 }
  }
 }

 /***/
1203a1265,1355
 #include sys/socket.h
 #include sys/un.h

 #define UNIX_PATH_MAX 108

 #include netinet/in.h
 #include netdb.h

 ACT_FN_GO(sock)
 {
   if (params)
 {
   struct sockaddr* addr = NULL;
   char *buf, *token, *type;
   int fd, addrlen, flag = 0;
   buf = strdup (params);
   if (! (token = strtok (buf,  ))) goto final;
   type = token;
   if (! (token = strtok (NULL,  ))) goto final;
   if ((! strncmp (type, unix, 4)  (flag = 1)) ||
 (! strncmp (type, unix-abs, 4)  (flag = 2)))
   {
 struct sockaddr_un *caddr;
 if ((fd = socket (AF_UNIX, SOCK_DGRAM, 0))  0) goto final;
 caddr = (struct sockaddr_un*) malloc (sizeof (struct sockaddr_un));
 caddr-sun_family = AF_UNIX;
 if (flag == 1)
 strncpy (caddr-sun_path, token, UNIX_PATH_MAX);
 else
   {
 *(caddr-sun_path) = '\0';
 strncpy (caddr-sun_path + 1, token, UNIX_PATH_MAX - 1);
   }
 addr = (struct sockaddr*) caddr;
 addrlen = sizeof (struct sockaddr_un);
   }
   else if ((! strcmp (type, udp)  (flag = 3)) ||
  (! strcmp (type, tcp)  (flag = 4)))
   {
 struct addrinfo hints;
 struct addrinfo* caddr, *ptr;
 char *colon;
 if (! (colon = strchr (token, ':'))) goto final;
 *colon = '\0';
 memset (hints, 0, sizeof (struct addrinfo));
 hints.ai_family = AF_INET;
 hints.ai_socktype = ((flag == 3) ? SOCK_DGRAM : SOCK_STREAM);
 if (getaddrinfo (token, colon + 1, hints, caddr)) goto final;
 for (ptr = caddr; ptr; ptr = ptr-ai_next)
   {
 if (ptr-ai_family == hints.ai_family 
 ptr-ai_socktype == hints.ai_socktype)
   {
 if ((fd = socket (ptr-ai_family, ptr-ai_socktype,
   ptr-ai_protocol))  0)
   ptr = NULL;
 else
   {
 addrlen = ptr-ai_addrlen;
 addr = (struct sockaddr*) malloc (addrlen);
 memcpy (addr, ptr-ai_addr, addrlen);
   }
 break;
   }
   }
 freeaddrinfo (caddr);
 if (! ptr) goto final;
   }
   

Re: [E-devel] Actions for window fullscreen

2006-06-19 Thread The Rasterman
On Mon, 19 Jun 2006 22:41:40 +0530 R.Ramkumar [EMAIL PROTECTED]
babbled:

 Hi!
 
 This patch had been sitting with me for quite some time. If you guys
 are ok with it, I could commit it. Basically adds an action for
 toggling/fullscreen'ing of a window. Actually I once wrote an action
 to send data over a socket, making it easy for writing shortcuts for
 music player ipc's around. I know that this could be achieved by an
 exec nc ..., but I was a bit unsatisfied with the delay :) I'm not
 convinced myself as to whether this should go in, but I just included
 it in case any one felt it was worthy enough.. Feel free to reject it
 :)

well it's not a unified diff - so it'll have to be rejected (ie  a diff with the
+'s and -'s at the start of lines). also please attach diffs to mails - not
inline them :)

 Index: e_actions.c
 ===
 RCS file: /cvs/e/e17/apps/e/src/bin/e_actions.c,v
 retrieving revision 1.70
 diff -r1.70 e_actions.c
 355a356,416
  ACT_FN_GO(window_fullscreen_toggle)
  {
 if (!obj) obj = E_OBJECT(e_border_focused_get());
 if (!obj) return;
 if (obj-type != E_BORDER_TYPE)
   {
  obj = E_OBJECT(e_border_focused_get());
  if (!obj) return;
   }
 if (!((E_Border *)obj)-lock_user_fullscreen)
   {
  E_Border *bd;
  bd = (E_Border *)obj;
  if (bd-fullscreen)
e_border_unfullscreen(bd);
  else if (params == 0 || *params == '\0')
e_border_fullscreen(bd, e_config-fullscreen_policy);
  else if (! strcmp(params, resize))
e_border_fullscreen(bd, E_FULLSCREEN_RESIZE);
  else if (! strcmp(params, zoom))
e_border_fullscreen(bd, E_FULLSCREEN_ZOOM);
   }
  }
 
  /***/
  ACT_FN_GO(window_fullscreen)
  {
 if (!obj) obj = E_OBJECT(e_border_focused_get());
 if (!obj) return;
 if (obj-type != E_BORDER_TYPE)
   {
  obj = E_OBJECT(e_border_focused_get());
  if (!obj) return;
   }
 if (!((E_Border *)obj)-lock_user_fullscreen)
   {
  E_Border *bd;
  bd = (E_Border *)obj;
  if (params)
{
   int v;
   char buf[32];
   if (sscanf(params, %i %20s, v, buf) == 2)
 {
if (v == 1)
  {
if (buf == 0 || *buf == '\0')
  e_border_fullscreen(bd,
  e_config-fullscreen_policy); else if (! strcmp(buf, resize))
  e_border_fullscreen(bd, E_FULLSCREEN_RESIZE);
else if (! strcmp(buf, zoom))
  e_border_fullscreen(bd, E_FULLSCREEN_ZOOM);
  }
else if (v == 0)
  e_border_unfullscreen(bd);
 }
}
   }
  }
 
  /***/
 1203a1265,1355
  #include sys/socket.h
  #include sys/un.h
 
  #define UNIX_PATH_MAX 108
 
  #include netinet/in.h
  #include netdb.h
 
  ACT_FN_GO(sock)
  {
if (params)
  {
struct sockaddr* addr = NULL;
char *buf, *token, *type;
int fd, addrlen, flag = 0;
buf = strdup (params);
if (! (token = strtok (buf,  ))) goto final;
type = token;
if (! (token = strtok (NULL,  ))) goto final;
if ((! strncmp (type, unix, 4)  (flag = 1)) ||
(! strncmp (type, unix-abs, 4)  (flag = 2)))
  {
struct sockaddr_un *caddr;
if ((fd = socket (AF_UNIX, SOCK_DGRAM, 0))  0) goto final;
caddr = (struct sockaddr_un*) malloc (sizeof (struct
  sockaddr_un)); caddr-sun_family = AF_UNIX;
if (flag == 1)
strncpy (caddr-sun_path, token, UNIX_PATH_MAX);
else
  {
*(caddr-sun_path) = '\0';
strncpy (caddr-sun_path + 1, token, UNIX_PATH_MAX - 1);
  }
addr = (struct sockaddr*) caddr;
addrlen = sizeof (struct sockaddr_un);
  }
else if ((! strcmp (type, udp)  (flag = 3)) ||
 (! strcmp (type, tcp)  (flag = 4)))
  {
struct addrinfo hints;
struct addrinfo* caddr, *ptr;
char *colon;
if (! (colon = strchr (token, ':'))) goto final;
*colon = '\0';
memset (hints, 0, sizeof (struct addrinfo));
hints.ai_family = AF_INET;
hints.ai_socktype = ((flag == 3) ? SOCK_DGRAM : SOCK_STREAM);
if (getaddrinfo (token, colon + 1, hints, caddr)) goto final;
for (ptr = caddr; ptr; ptr = ptr-ai_next)
  {
if (ptr-ai_family == hints.ai_family 
ptr-ai_socktype == hints.ai_socktype)
  {
if ((fd = socket (ptr-ai_family, ptr-ai_socktype,
  ptr-ai_protocol))  0)
  ptr = NULL;
else
  {
addrlen = ptr-ai_addrlen;
addr = (struct sockaddr*) malloc