comp.lang.ada
 help / color / mirror / Atom feed
* More Florist.
@ 2003-11-02  4:44 Freejack
  2003-11-02  6:38 ` Patrice Freydiere
  2003-11-02 22:45 ` Mark Lorenzen
  0 siblings, 2 replies; 9+ messages in thread
From: Freejack @ 2003-11-02  4:44 UTC (permalink / raw)


Well, everythings compiled and linked properly.

I can do just everything else I need with Florist. But I'm running into
trouble here...

type Database_Array is new POSIX.Octet_Array;
type Database_Array_Pointer is access all Database_Array;

function Get_Network_Info_By_Name
      (Name    : POSIX.POSIX_String;
       Storage : Database_Array_Pointer)
     return Network_Info;


Now, setting up the Posix_String is pretty straightforward. But I'm
totally lost on this Database_Array_Pointer business. I've tried about a
zillion different possible combinations and either it wont compile or I
get STORAGE_ERROR at runtime.

No problems with the other stuff. Just this. I give up. 

Any pointers(no pun intended) would be greatly appreciated.

Thanks.


Freejack



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: More Florist.
  2003-11-02  4:44 More Florist Freejack
@ 2003-11-02  6:38 ` Patrice Freydiere
  2003-11-02 13:23   ` Jeff C,
  2003-11-02 22:45 ` Mark Lorenzen
  1 sibling, 1 reply; 9+ messages in thread
From: Patrice Freydiere @ 2003-11-02  6:38 UTC (permalink / raw)



STORAGE ERROR could append if you use external libraries using interfaces
package. 
If so, read the RM, it has a lot of informations about interfaces and how
pass parameters.

Patrice


On Sun, 02 Nov 2003 04:44:19 +0000, Freejack wrote:

> Well, everythings compiled and linked properly.
> 
> I can do just everything else I need with Florist. But I'm running into
> trouble here...
> 
> type Database_Array is new POSIX.Octet_Array;
> type Database_Array_Pointer is access all Database_Array;
> 
> function Get_Network_Info_By_Name
>       (Name    : POSIX.POSIX_String;
>        Storage : Database_Array_Pointer)
>      return Network_Info;
> 
> 
> Now, setting up the Posix_String is pretty straightforward. But I'm
> totally lost on this Database_Array_Pointer business. I've tried about a
> zillion different possible combinations and either it wont compile or I
> get STORAGE_ERROR at runtime.
> 
> No problems with the other stuff. Just this. I give up. 
> 
> Any pointers(no pun intended) would be greatly appreciated.
> 
> Thanks.
> 
> 
> Freejack




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: More Florist.
  2003-11-02  6:38 ` Patrice Freydiere
@ 2003-11-02 13:23   ` Jeff C,
  2003-11-02 14:23     ` Freejack
  2003-11-02 17:57     ` Freejack
  0 siblings, 2 replies; 9+ messages in thread
From: Jeff C, @ 2003-11-02 13:23 UTC (permalink / raw)



"Patrice Freydiere" <frett27@free.fr> wrote in message
news:pan.2003.11.02.06.38.28.506509@free.fr...
>
> STORAGE ERROR could append if you use external libraries using interfaces
> package.
> If so, read the RM, it has a lot of informations about interfaces and how
> pass parameters.
>
> Patrice
>
>
> On Sun, 02 Nov 2003 04:44:19 +0000, Freejack wrote:
>
> > Well, everythings compiled and linked properly.
> >
> > I can do just everything else I need with Florist. But I'm running into
> > trouble here...
> >
> > type Database_Array is new POSIX.Octet_Array;
> > type Database_Array_Pointer is access all Database_Array;
> >
> > function Get_Network_Info_By_Name
> >       (Name    : POSIX.POSIX_String;
> >        Storage : Database_Array_Pointer)
> >      return Network_Info;
> >
> >

Have you tried something like

My_Storage : aliased Database_Array(1 .. 255);

begin
 XXX := Get_Network_Info_By_Name(Name => The_Name_You_Already_Figured_Out,
                                                              Storage =>
My_Storage'unchecked_access);
end;

....or something along those lines...





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: More Florist.
  2003-11-02 13:23   ` Jeff C,
@ 2003-11-02 14:23     ` Freejack
  2003-11-02 17:57     ` Freejack
  1 sibling, 0 replies; 9+ messages in thread
From: Freejack @ 2003-11-02 14:23 UTC (permalink / raw)


On Sun, 02 Nov 2003 08:23:51 -0500, Jeff C, wrote:


> Have you tried something like
> 
> My_Storage : aliased Database_Array(1 .. 255);
> 
> begin
>  XXX := Get_Network_Info_By_Name(Name =>
>  The_Name_You_Already_Figured_Out,
>                                                               Storage =>
> My_Storage'unchecked_access);
> end;
> 
> ....or something along those lines...
 
I just tried that out, and I get some warnings, but that statement does
compile. Havent been able to test it yet though. I'll post on that later.

Freejack.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: More Florist.
  2003-11-02 13:23   ` Jeff C,
  2003-11-02 14:23     ` Freejack
@ 2003-11-02 17:57     ` Freejack
  2003-11-02 18:25       ` Jeff C,
  1 sibling, 1 reply; 9+ messages in thread
From: Freejack @ 2003-11-02 17:57 UTC (permalink / raw)


On Sun, 02 Nov 2003 08:23:51 -0500, Jeff C, wrote:



> Have you tried something like
> 
> My_Storage : aliased Database_Array(1 .. 255);
> 
> begin
>  XXX := Get_Network_Info_By_Name(Name =>
>  The_Name_You_Already_Figured_Out,
>                                                               Storage =>
> My_Storage'unchecked_access);
> end;
> 
> ....or something along those lines...
 

Alright...here's what I have so far. Still getting Storage_Error. NetDB
is the only place I get it.(Why isn't there a simple "Get_Host_By_Name"
function? It's the most commonly used NetDB function. Why does one have
to parse the thing out of the response generated from the
"Get_Network_Info_By_Name" function? A design flaw?)
All my other procedures work so far. This is the only one that's
chaffing.

with Posix;
with Posix.Sockets.Internet;
with Ada.Text_IO;
procedure lookout is
	package NetSock renames Posix.Sockets.Internet;
	package TIO renames Ada.Text_IO;
	Response : Netsock.Network_Info;	
	URL : Posix.Posix_String := "www.yahoo.com";
	Address : Posix.Posix_String(1..64);
	My_Storage : aliased NetSock.Database_Array(1..255);
	Len : Positive;
begin

	Netsock.Open_Network_Database_Connection(True);
	Response := NetSock.Get_Network_Info_By_Name(Name => URL, 
				Storage => My_Storage'unrestricted_access);
	Address := NetSock.Get_Name(Response);
	Len := Address'length;
	declare
		Addr : String(1..Len);
	begin
		Addr := Posix.To_String(Address);

		-- Just to see what the hell Get_Network_Info_By_Name --
		-- spits back at me. I have no idea what it'll be.	  --
		TIO.Put_Line("Response was"& Addr &".");
	end;
	NetSock.Close_Network_Database_Connection;
end lookout;

Heh. Let the chuckles begin.

Really though.  Does this code make sense?

Freejack



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: More Florist.
  2003-11-02 17:57     ` Freejack
@ 2003-11-02 18:25       ` Jeff C,
  2003-11-02 19:11         ` Freejack
  2003-11-02 23:55         ` David Emery
  0 siblings, 2 replies; 9+ messages in thread
From: Jeff C, @ 2003-11-02 18:25 UTC (permalink / raw)



"Freejack" <user@nospam.net> wrote in message
news:pan.2003.11.02.18.03.46.69238.853@nospam.net...
> On Sun, 02 Nov 2003 08:23:51 -0500, Jeff C, wrote:
>
>
>
> > Have you tried something like
> >
> > My_Storage : aliased Database_Array(1 .. 255);
> >
> > begin
> >  XXX := Get_Network_Info_By_Name(Name =>
> >  The_Name_You_Already_Figured_Out,
> >                                                               Storage =>
> > My_Storage'unchecked_access);
> > end;
> >
> > ....or something along those lines...
>
>
> Alright...here's what I have so far. Still getting Storage_Error. NetDB
> is the only place I get it.(Why isn't there a simple "Get_Host_By_Name"
> function? It's the most commonly used NetDB function. Why does one have
> to parse the thing out of the response generated from the
> "Get_Network_Info_By_Name" function? A design flaw?)
> All my other procedures work so far. This is the only one that's
> chaffing.

Well..It is following the POSIX standard so if there is a problem it is in
the standard and (probably) not the
implementation.

Up until now we (I) have been answering your question directly without
knowing what your final goals are.
Perhaps you would be happier using the AdaSockets. I find it a lot easier to
use and more "Ada like" v.s. the
POSIX binding.

http://www.rfc1149.net/devel/adasockets

Of course if there is some reason you have to use florist then this is not
the right choice.







^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: More Florist.
  2003-11-02 18:25       ` Jeff C,
@ 2003-11-02 19:11         ` Freejack
  2003-11-02 23:55         ` David Emery
  1 sibling, 0 replies; 9+ messages in thread
From: Freejack @ 2003-11-02 19:11 UTC (permalink / raw)


On Sun, 02 Nov 2003 13:25:39 -0500, Jeff C, wrote:


> Well..It is following the POSIX standard so if there is a problem it is
> in the standard and (probably) not the implementation.
> 
> Up until now we (I) have been answering your question directly without
> knowing what your final goals are.
> Perhaps you would be happier using the AdaSockets. I find it a lot
> easier to use and more "Ada like" v.s. the POSIX binding.
> 
> http://www.rfc1149.net/devel/adasockets
> 
> Of course if there is some reason you have to use florist then this is
> not the right choice.
 
I have been using Adasockets in the past. My goal right now is just to
get familiar with Florist.

Adasockets is easier...but I also wanna know Florist.

But thanks for the help. I think I just about got it figured out. I'll
post up my answer once it works.

Freejack



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: More Florist.
  2003-11-02  4:44 More Florist Freejack
  2003-11-02  6:38 ` Patrice Freydiere
@ 2003-11-02 22:45 ` Mark Lorenzen
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Lorenzen @ 2003-11-02 22:45 UTC (permalink / raw)


What are you trying to accomplish? A "normal" DNS query?

- Mark Lorenzen

Freejack <user@nospam.net> writes:

> Well, everythings compiled and linked properly.
>
> I can do just everything else I need with Florist. But I'm running into
> trouble here...
>
> type Database_Array is new POSIX.Octet_Array;
> type Database_Array_Pointer is access all Database_Array;
>
> function Get_Network_Info_By_Name
>       (Name    : POSIX.POSIX_String;
>        Storage : Database_Array_Pointer)
>      return Network_Info;
>
>
> Now, setting up the Posix_String is pretty straightforward. But I'm
> totally lost on this Database_Array_Pointer business. I've tried about a
> zillion different possible combinations and either it wont compile or I
> get STORAGE_ERROR at runtime.
>
> No problems with the other stuff. Just this. I give up. 
>
> Any pointers(no pun intended) would be greatly appreciated.
>
> Thanks.
>
>
> Freejack



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: More Florist.
  2003-11-02 18:25       ` Jeff C,
  2003-11-02 19:11         ` Freejack
@ 2003-11-02 23:55         ` David Emery
  1 sibling, 0 replies; 9+ messages in thread
From: David Emery @ 2003-11-02 23:55 UTC (permalink / raw)


Jeff C, wrote:
...
> Well..It is following the POSIX standard so if there is a problem it is in
> the standard and (probably) not the
> implementation.

Does FLORIST claim to be a conforming POSIX/Ada implementation?  If
not, I'd strongly prefer that it not imply conformance.

So either say it's "conforming" (which is clearly defined by the
standard), or say that it is "patterned on" or words to that effect
that make it clear that it is not claiming or implying conformance.

				dave




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-11-02 23:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-02  4:44 More Florist Freejack
2003-11-02  6:38 ` Patrice Freydiere
2003-11-02 13:23   ` Jeff C,
2003-11-02 14:23     ` Freejack
2003-11-02 17:57     ` Freejack
2003-11-02 18:25       ` Jeff C,
2003-11-02 19:11         ` Freejack
2003-11-02 23:55         ` David Emery
2003-11-02 22:45 ` Mark Lorenzen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox