[fpc-pascal] Install freepascal Mysql package to kylix 3

2006-10-06 Thread suryono_03
Hi, does anyone know how to install freepascal mysql component to kylix 3
open edition? Or is there any database component that can be use with
kylix 3 open edition?

Thx b4.

=



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] RE: h2pas error report

2006-10-06 Thread Marc Santhoff
Am Donnerstag, den 05.10.2006, 22:19 -0500 schrieb Jeff Pohlmeyer:
> > Errm, I actually forgot the obvious questions:
> > What's wrong here? How can I get around it?
> 
> 
> cat input.h | awk '{gsub(/\<__int64\>/," long long "); print}'  > output.h
> 
>  - should work, at least on Linux x86

That has done the trick. At least h2pas runs through and I'll see later,
if the type change makes any difference on windows.

Many thanks Jeff,
Marc


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] THREADVARLIST_FVCOMMON & THREADVARLIST_MEMORY undefined symbols while linking

2006-10-06 Thread Ken G. Brown
Downloaded fpc 2.0.4 yesterday and I am trying to compile a legacy CW Pro 2 app 
on Mac 10.4.8 with Xcode 2.4.
I am getting undefined symbols THREADVARLIST_FVCOMMON &
THREADVARLIST_MEMORY when trying to link, and I have no clue how to get past 
this problem. I searched my hard drive and found them showing up in 
/myDevelopment/PrtTstfpc/build/PrtTstfpc.build/DerivedSources/ppc/program.s
but do not know what this means or what to do.
Any help would be appreciated.
Thx
Ken
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] visualserver from VisualSynapse how implement it as a Linux console Daemon

2006-10-06 Thread TOUZEAU DAVID

Dear

is anybody there use visualserver from VisualSynapse  
(http://visualsynapse.sourceforge.net/?id=8) and impleted it on Linux 
has a console mode...??

Examples given is only on application interface ...

Problems:

1) When the application start, no web page are generated...
2) i would like to develop a variant of this web server. In this case, i 
need to trap the requests received by the process.


Here it is a sample that didn't working

//*
program shttpserver;

{$mode objfpc}{$H+}

uses
//ArticaAgent
 cthreads,custapp, Classes, SysUtils, fpcunit,httpserver ;

const
 Version = 'Version 0.1';

type
 TTestRunner = class(TCustomApplication)
 private


 protected
   procedure DoRun; override;
 public
 procedure Listen(receive:string);
 end;

procedure TTestRunner.DoRun;
 var
   I: integer;
   S: string;
 begin
  //  writeln('create...');
  end;
 
procedure TTestRunner.Listen(receive:string);

 begin
  //  writeln('string received: ' + receive);
  end;

var
 App: TTestRunner;
 eHTTP : TvsHTTPServer;
begin
 App := TTestRunner.Create(nil);
 eHTTP := TvsHTTPServer.Create(nil);
 eHTTP.LogFile := 'httplog.log';
 eHTTP.ServerName := 'Visual Synapse Demo HTTP Server';
 eHTTP.ListenPort := '8000';
 eHTTP.SSL := False;
 eHTTP.ListenIP := '0.0.0.0'; //any
 eHTTP.RegisterDir ('/home/touzeau/Desktop/visualserverdemo/web', '/');
 eHTTP.RegisterDefaultDoc('index.htm');
 eHTTP.Active := True;
// eHTTP.OnGet := @App.Listen; //not working it seems that here i can 
receive requests from clients.


 App.Initialize;
 App.Title := 'Console  www.';
 App.Run;
 App.Free;
end.

//*

--

David Touzeau -- Linux Ubuntu Dapper 6.0.6 
FreePascal-Lazarus,perl,delphi,php icq:160018849

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] RE: Get Local IP using glib (eth0,eth1)

2006-10-06 Thread TOUZEAU DAVID

Many thanks to the community

To reply to Graeme :
why not just use the /sbin/ifconfig output ?
Simply to be more dev compliance... using an external program is slower 
and sometime ifconfig doesn't exist or is deleted on target computers.


To reply to Marco :
And the only "good" solution is a portable resolver unit?
How will you resolve "eth0" on Win32 or BSD ?

For WIN32, i d'ont care because the program is only for Linux systems.
Your are true, in BSD the network interface is not the same and i must 
detect wich interface is used...


Best regards






Graeme Geldenhuys a écrit :

I have these two functions in my .bashrc file.  You only need to run
"ii" for the cool output.  Now back to the question -  If it is for
linux only, why not just use the /sbin/ifconfig output.  After all, it
is accurate and seem much easier than all those libc/library methods.
I pull the IPs and Interfaces available from the /sbin/ifconfig output
and works just fine.  If it was needed on windows, I am sure you could
to the same thing with the 'ipconfig' output.

My 2c worth!  :-)


Regards,
 - Graeme -



 .bashrc -
function my_ip() # get IP adresses
{
   MY_IP=$(/sbin/ifconfig eth0 | awk '/inet/ { print $2 } ' | sed -e 
s/addr://)

   MY_ISP=$(/sbin/ifconfig ppp0 | awk '/P-t-P/ { print $3 } ' | sed
-e s/P-t-P://)
}

function ii()   # get current host related info
{
   echo -e "\nYou are logged on ${RED}$HOST"
   echo -e "\nAdditionnal information:$NC " ; uname -a
   echo -e "\n${RED}Users logged on:$NC " ; w -h
   echo -e "\n${RED}Current date :$NC " ; date
   echo -e "\n${RED}Machine stats :$NC " ; uptime
   echo -e "\n${RED}Memory stats :$NC " ; free
   my_ip 2>&- ;
   echo -e "\n${RED}Local IP Address :$NC" ; echo ${MY_IP:-"Not 
connected"}

   echo -e "\n${RED}ISP Address :$NC" ; echo ${MY_ISP:-"Not connected"}
   echo
}
-

On 06/10/06, Jeff Pohlmeyer <[EMAIL PROTECTED]> wrote:

> Better, but still Linux only. For a good solution,
> a resolver unit that accesses libc should be
> written that is portable (unlike the libc unit)


If I understood correctly, the OP had two questions:

1. Retrieve a list of interface names on a *linux* system.
2. Return the IP address for a given *linux* interface name.


And the only "good" solution is a portable resolver unit?

How will you resolve "eth0" on Win32 or BSD ?

 -Jeff





--

David Touzeau -- Linux Ubuntu Dapper 6.0.6 
FreePascal-Lazarus,perl,delphi,php icq:160018849


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Unistalling FPC (and reinstalling from svn)

2006-10-06 Thread Jochem Berndsen
On Friday 06 October 2006 10:49, Adrian Maier wrote:
> I have a silly question :  which is the best way to uninstall FPC ? 
I don't know.

> Also, after compiling FPC  with 'make build'  ,  if i execute 'make
> install'  will it
> copy everyting in  /usr/local   by default ?   Is the destination
> directory configurable
> somehow?
Yes. You can choose the installation directory using
make install INSTALL_PREFIX=/path/to/install
(For example,
make install INSTALL_PREFIX=/usr/local
This will create bin/ and lib/ and other directories if they do not exist 
already.)

Jochem.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] RE: Get Local IP using glib (eth0,eth1)

2006-10-06 Thread Marco van de Voort
> > Better, but still Linux only. For a good solution,
> > a resolver unit that accesses libc should be
> > written that is portable (unlike the libc unit)
> 
> If I understood correctly, the OP had two questions:
> 
> 1. Retrieve a list of interface names on a *linux* system.
> 2. Return the IP address for a given *linux* interface name.

I don't understand that last one. _WHY_ would you want to enumerate and then
still use hardcoded "eth0" What if eth0 is my internal and eth1 my external
interface? The only meaning of the name is order of detection.
 
> And the only "good" solution is a portable resolver unit?
> 
> How will you resolve "eth0" on Win32 or BSD ?

Usually you enumerate the interfaces list, till you find the interface with
the "default" (ANY) route, so you have the default gateway, regardless of
name. That is usually the interface you interested in.

IOW names say nothing, routes and masks do.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] RE: Get Local IP using glib (eth0,eth1)

2006-10-06 Thread Graeme Geldenhuys

I have these two functions in my .bashrc file.  You only need to run
"ii" for the cool output.  Now back to the question -  If it is for
linux only, why not just use the /sbin/ifconfig output.  After all, it
is accurate and seem much easier than all those libc/library methods.
I pull the IPs and Interfaces available from the /sbin/ifconfig output
and works just fine.  If it was needed on windows, I am sure you could
to the same thing with the 'ipconfig' output.

My 2c worth!  :-)


Regards,
 - Graeme -



 .bashrc -
function my_ip() # get IP adresses
{
   MY_IP=$(/sbin/ifconfig eth0 | awk '/inet/ { print $2 } ' | sed -e s/addr://)
   MY_ISP=$(/sbin/ifconfig ppp0 | awk '/P-t-P/ { print $3 } ' | sed
-e s/P-t-P://)
}

function ii()   # get current host related info
{
   echo -e "\nYou are logged on ${RED}$HOST"
   echo -e "\nAdditionnal information:$NC " ; uname -a
   echo -e "\n${RED}Users logged on:$NC " ; w -h
   echo -e "\n${RED}Current date :$NC " ; date
   echo -e "\n${RED}Machine stats :$NC " ; uptime
   echo -e "\n${RED}Memory stats :$NC " ; free
   my_ip 2>&- ;
   echo -e "\n${RED}Local IP Address :$NC" ; echo ${MY_IP:-"Not connected"}
   echo -e "\n${RED}ISP Address :$NC" ; echo ${MY_ISP:-"Not connected"}
   echo
}
-

On 06/10/06, Jeff Pohlmeyer <[EMAIL PROTECTED]> wrote:

> Better, but still Linux only. For a good solution,
> a resolver unit that accesses libc should be
> written that is portable (unlike the libc unit)


If I understood correctly, the OP had two questions:

1. Retrieve a list of interface names on a *linux* system.
2. Return the IP address for a given *linux* interface name.


And the only "good" solution is a portable resolver unit?

How will you resolve "eth0" on Win32 or BSD ?

 -Jeff



--
There's no place like 127.0.0.1
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Last missing benchmark: regex-dna

2006-10-06 Thread Vincent Snijders

Пётр Косаревский schreef:

Then there is also synregexpr.pas:
http://svn.freepascal.org/svn/lazarus/trunk/components/synedit/synregexpr.pas
But that is not distrubuted with fpc. And I don't know, if the license is open 
source. Is it looks likes a BSD derivative, but item 3, about income, doesn't seem 
to fit in.


How should this benchmark be implemented?



What about contacting author of synregexpr and asking him to implement it?

He seems to live in the same city as me, so if the e-mail address is a dead-end 
(both web links are broken), I can try to contact him another way (and pursuade 
him to resolve this issue).


I think synregexpr already implements it. The problem is, that synregexpr isn't 
distributed with fpc, so I cannot use it in the shootout.


Vincent
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re[2]: [fpc-pascal] Last missing benchmark: regex-dna

2006-10-06 Thread Пётр Косаревский
> Then there is also synregexpr.pas:
> http://svn.freepascal.org/svn/lazarus/trunk/components/synedit/synregexpr.pas
> But that is not distrubuted with fpc. And I don't know, if the license is 
> open 
> source. Is it looks likes a BSD derivative, but item 3, about income, doesn't 
> seem 
> to fit in.
> 
> How should this benchmark be implemented?
> 
> Vincent

What about contacting author of synregexpr and asking him to implement it?

He seems to live in the same city as me, so if the e-mail address is a dead-end 
(both web links are broken), I can try to contact him another way (and pursuade 
him to resolve this issue).
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] RE: Get Local IP using glib (eth0,eth1)

2006-10-06 Thread Jeff Pohlmeyer

Better, but still Linux only. For a good solution,
a resolver unit that accesses libc should be
written that is portable (unlike the libc unit)



If I understood correctly, the OP had two questions:

1. Retrieve a list of interface names on a *linux* system.
2. Return the IP address for a given *linux* interface name.


And the only "good" solution is a portable resolver unit?

How will you resolve "eth0" on Win32 or BSD ?

-Jeff
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] low level disk access under Windows

2006-10-06 Thread Pianoman
   Hello, I'd like to ask if someone has experiences with low level 
disk operations in windows with FPC.
The program should be able to copy entire diskete to one single image file 
and for example extract a single file from that image or view its contents.


For example how can I read one sector from disk in to buffer?
Thanx for help
Pianoman
- Original Message - 
From: <[EMAIL PROTECTED]>

To: 
Sent: Friday, October 06, 2006 1:31 PM
Subject: fpc-pascal Digest, Vol 26, Issue 16



Send fpc-pascal mailing list submissions to
fpc-pascal@lists.freepascal.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]

You can reach the person managing the list at
[EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of fpc-pascal digest..."


Today's Topics:

  1. Re:  Re: fpUnit - AssertEquals gives Access violation
 (Vincent Snijders)
  2.  [libtar.pas]:Error: Illegal type conversion: "ShortString"
 to "^Char" without compilator options (TOUZEAU DAVID)
  3. Re:  [libtar.pas]:Error: Illegal type conversion:
 "ShortString" to "^Char" without compilator options (Vincent 
Snijders)

  4. Re:  Last missing benchmark: regex-dna (Marco van de Voort)
  5. Re:  Re: fpUnit - AssertEquals gives Access violation
 (Graeme Geldenhuys)
  6. Re:  [libtar.pas]:Error: Illegal type conversion:
 "ShortString" to "^Char" without compilator options (TOUZEAU DAVID)
  7.  RE: Get Local IP using glib (eth0,eth1) (Jeff Pohlmeyer)
  8. Re:  RE: Get Local IP using glib (eth0,eth1) (Marco van de Voort)


--

Message: 1
Date: Fri, 06 Oct 2006 11:58:16 +0200
From: Vincent Snijders <[EMAIL PROTECTED]>
Subject: Re: [fpc-pascal] Re: fpUnit - AssertEquals gives Access
violation
To: FPC-Pascal users discussions 
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Graeme Geldenhuys schreef:

Oh, I forgot to mention.  If the ObjectStates match, the test passes
fine, and doesn't give an access violation.

While creating the new AssertEquals method, I purposefully created a
failure with then gives the access violation, instead to the
comparison message I expected:
 "Failing on 1: Expected  but got "



Try creating a back trace, maybe that gives some insight.

Vincent


--

Message: 2
Date: Fri, 06 Oct 2006 12:17:20 +0200
From: TOUZEAU DAVID <[EMAIL PROTECTED]>
Subject: [fpc-pascal] [libtar.pas]:Error: Illegal type conversion:
"ShortString" to "^Char" without compilator options
To: FPC-Pascal users discussions 
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Dear

I would like to use some units developped from delphi/klyx with Lazarus
IDE On Linux.

It seems that there is some differences between delphi/freepascal
especially for longstring conversion.

Many times, i received this compilator error :

For example by using the LibTar.pas
(http://www.destructor.de/libtar/index.htm)

libtar.pas(355,8) Error: Illegal type conversion: "ShortString" to "^Char"

i fixed this error with  {$H+}{$LongString On} tokens

But is it this good way ??? is there an another solution ??

Best regards.

--

David Touzeau -- Linux Ubuntu Dapper 6.0.6
FreePascal-Lazarus,perl,delphi,php icq:160018849


--

Message: 3
Date: Fri, 06 Oct 2006 12:19:46 +0200
From: Vincent Snijders <[EMAIL PROTECTED]>
Subject: Re: [fpc-pascal] [libtar.pas]:Error: Illegal type conversion:
"ShortString" to "^Char" without compilator options
To: [EMAIL PROTECTED], FPC-Pascal users discussions

Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

TOUZEAU DAVID schreef:

Dear

I would like to use some units developped from delphi/klyx with Lazarus
IDE On Linux.

It seems that there is some differences between delphi/freepascal
especially for longstring conversion.

Many times, i received this compilator error :

For example by using the LibTar.pas
(http://www.destructor.de/libtar/index.htm)

libtar.pas(355,8) Error: Illegal type conversion: "ShortString" to 
"^Char"


i fixed this error with  {$H+}{$LongString On} tokens

But is it this good way ??? is there an another solution ??


An alternative is to add {$mode delphi} to the source file or compile 
with -Sd

compiler option.

Vincent


--

Message: 4
Date: Fri, 6 Oct 2006 12:32:52 +0200 (CEST)
From: [EMAIL PROTECTED] (Marco van de Voort)
Subject: Re: [fpc-pascal] Last missing benchmark: regex-dna
To:  ??? <[EMAIL PROTECTED]>, FPC-Pascal users discussions

Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="US-ASCII"


> Although fpc has a regexpr unit:
> http://svn.freepascal.org/svn/fpc/trunk/packages/bas

Re[2]: [fpc-pascal] Last missing benchmark: regex-dna

2006-10-06 Thread Пётр Косаревский
> > Basic seems to be: |()?*+ (non-UNICODE) support (from wikipedia).
> | is not basic afaik. From re_format BSD Manpage:
>  Obsolete (``basic'') regular expressions differ in several respects.  `|'
>  is an ordinary character and there is no equivalent for its functional-
>  ity.  `+' and `?' are ordinary characters, and their functionality can
>  be expressed using bounds (`{1,}' or `{0,1}' respectively).  Also note
>  that `x+' in modern REs is equivalent to `xx*'.  The delimiters for
>  bounds are `\{' and `\}', with `{' and `}' by themselves ordinary
>  characters.  The parentheses for nested subexpressions are `\(' and
>  `\)', with `(' and `)' by themselves ordinary characters.  `^' is an
>  ordinary character except at the beginning of the RE or= the beginning
>  of a parenthesized subex- pression, `$' is an ordinary character except
>  at the end of the RE or= the end of a parenthesized subexpression, and
>  `*' is an ordinary charac- ter if it appears at the beginning of the RE
>  or the beginning of a paren- thesized subexpression (after a possible
>  leading `^').  Finally, there is one new type of atom, a back
>  reference: `\' followed by a non-zero deci- mal digit d matches the
>  same sequence of characters matched by the dth parenthesized
>  subexpression (numbering subexpressions by the positions of their
>  opening parentheses, left to right), so that (e.g.) `\([bc]\)\1'
>  matches `bb' or `cc' but not `bc'.

You know the traditional Unix syntax, I quoted wikipedia's definition of "basic 
regex", and it looks like a simplified POSIX ERE (extended regular expression) 
syntax ( http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html 
).

I've got the idea.

The "last missing benchmark" requires simplest bracket expressions like "[agt]" 
(equiv. to "(a|g|t)")). Bracketing is supported in FPC "regexpr" enough.

Also it requires substitution (find and replace all) of a regex in a string, 
which has nothing to do with regex standards.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] RE: Get Local IP using glib (eth0,eth1)

2006-10-06 Thread TOUZEAU DAVID

Many Thanks for this way jeff...
/proc/net/dev is more compatible
Impressed it
for your information.
My program will run only on linux system...


Marco van de Voort a écrit :

I would parse /proc/net/dev instead



Better, but still Linux only. For a good solution, a resolver unit that
accesses libc should be written that is portable (unlike the libc unit)

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

  


--

David Touzeau -- Linux Ubuntu Dapper 6.0.6 
FreePascal-Lazarus,perl,delphi,php icq:160018849


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] RE: Get Local IP using glib (eth0,eth1)

2006-10-06 Thread Marco van de Voort
> I would parse /proc/net/dev instead

Better, but still Linux only. For a good solution, a resolver unit that
accesses libc should be written that is portable (unlike the libc unit)

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] RE: Get Local IP using glib (eth0,eth1)

2006-10-06 Thread Jeff Pohlmeyer

how can i list wich interface loaded without
need to parse /etc/networks/...?




I would parse /proc/net/dev instead


program ifnames;
var
 s:shortstring;
 f:text;
 p:LongInt;
begin
 assign(f,'/proc/net/dev');
 reset(f);
 while not eof(f) do begin
   readln(f,s);
   p:=pos(':',s);
   if ( p > 0 ) then begin
 delete(s, p, 255);
 while ( s <> '' ) and (s[1]=#32) do delete(s,1,1);
 writeln(s);
   end;
 end;
 close(f);
end.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] [libtar.pas]:Error: Illegal type conversion: "ShortString" to "^Char" without compilator options

2006-10-06 Thread TOUZEAU DAVID

Many thanks Vincent

the {$mode delphi} is a good way...

Vincent Snijders a écrit :

TOUZEAU DAVID schreef:

Dear

I would like to use some units developped from delphi/klyx with 
Lazarus IDE On Linux.


It seems that there is some differences between delphi/freepascal 
especially for longstring conversion.


Many times, i received this compilator error :

For example by using the LibTar.pas 
(http://www.destructor.de/libtar/index.htm)


libtar.pas(355,8) Error: Illegal type conversion: "ShortString" to 
"^Char"


i fixed this error with  {$H+}{$LongString On} tokens

But is it this good way ??? is there an another solution ??


An alternative is to add {$mode delphi} to the source file or compile 
with -Sd compiler option.


Vincent



--

David Touzeau -- Linux Ubuntu Dapper 6.0.6 
FreePascal-Lazarus,perl,delphi,php icq:160018849


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: fpUnit - AssertEquals gives Access violation

2006-10-06 Thread Graeme Geldenhuys

Here is the backtrace.  I removed all other Assert tests, so only the
one that causes the problem is executed.

What is strange though, is that I created a new test that only creates
the object and then tests the ObjectState. It it works, but all the
other actual tests don't.  I hate such problems! :-)

Graeme.


--  Start ---
[New Thread -1216787536 (LWP 20619)]
[Switching to Thread -1213515552 (LWP 20607)]

Breakpoint 1, 0x0805f036 in fpc_raiseexception ()
(gdb) bt
#0  0x0805f036 in fpc_raiseexception ()
#1  0x082189d9 in FPCUNIT_TASSERT_$__FAIL$ANSISTRING ()
#2  0xb7f04ac0 in ?? ()
#3  0xb7a69200 in ?? ()
#4  0x082189ff in FPCUNIT_TASSERT_$__ASSERTTRUE$ANSISTRING$BOOLEAN ()
#5  0xb7f04ac0 in ?? ()
#6  0x08218b45 in
FPCUNIT_TASSERT_$__ASSERTEQUALS$ANSISTRING$ANSISTRING$ANSISTRING ()
#7  0x080a0202 in TNODEDATATEST__ASSERTEQUALS (PMESSAGE=0x8350cf0,
   PEXPECTED=POSDELETED, PACTUAL=POSCLEAN, this=0xb7a77a68)
   at NodeData_test.pas:89
#8  0x080a1cb7 in TNODEDATATEST__TESTNODECOMPOUND_SAVE2 (this=0xb7a77a68)
   at NodeData_test.pas:408
#9  0x0821abf1 in FPCUNIT_TTESTCASE_$__RUNTEST ()
#10 0x0821ab38 in FPCUNIT_TTESTCASE_$__RUNBARE ()
#11 0x0821ba67 in FPCUNIT_PROTECTTEST$TTEST$TTESTRESULT ()
#12 0x0821bb61 in FPCUNIT_TTESTRESULT_$__RUNPROTECTED$TTEST$TPROTECT ()
#13 0x0821ba9e in FPCUNIT_TTESTRESULT_$__RUN$TTESTCASE ()
#14 0xb7a77a68 in ?? ()
#15 0xb7a7cb68 in ?? ()
#16 0x0821aaeb in FPCUNIT_TTESTCASE_$__RUN$TTESTRESULT ()
#17 0x0821b4f1 in FPCUNIT_TTESTSUITE_$__RUNTEST$TTEST$TTESTRESULT ()
#18 0x083ee660 in _$FPCUNIT$_Ld19 ()
---Type  to continue, or q  to quit---
#19 0x0821b4cb in FPCUNIT_TTESTSUITE_$__RUN$TTESTRESULT ()
#20 0x0007 in ?? ()
#21 0xb7a7cb68 in ?? ()
#22 0xb7a77808 in ?? ()
#23 0x in ?? ()
(gdb)

-- Finish 

On 06/10/06, Vincent Snijders <[EMAIL PROTECTED]> wrote:

Graeme Geldenhuys schreef:
> Oh, I forgot to mention.  If the ObjectStates match, the test passes
> fine, and doesn't give an access violation.
>
> While creating the new AssertEquals method, I purposefully created a
> failure with then gives the access violation, instead to the
> comparison message I expected:
>  "Failing on 1: Expected  but got "
>

Try creating a back trace, maybe that gives some insight.

Vincent
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal




--
There's no place like 127.0.0.1
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Last missing benchmark: regex-dna

2006-10-06 Thread Marco van de Voort
> > Although fpc has a regexpr unit:
> > http://svn.freepascal.org/svn/fpc/trunk/packages/base/regexpr/regexpr.pp
> > It has many todos, such as adding support for | in the search expression. 
> > So this 
> > unit doesn't have enough functionality.
> 
> While '|' support is to be considered basic regex functionality, what is the 
> really expected functionality?
> 
> Basic seems to be: |()?*+ (non-UNICODE) support (from wikipedia).

| is not basic afaik. From re_format BSD Manpage:

 Obsolete (``basic'') regular expressions differ in several respects.  `|'
 is an ordinary character and there is no equivalent for its functional-
 ity.  `+' and `?' are ordinary characters, and their functionality can
 be expressed using bounds (`{1,}' or `{0,1}' respectively).  Also note
 that `x+' in modern REs is equivalent to `xx*'.  The delimiters for
 bounds are `\{' and `\}', with `{' and `}' by themselves ordinary
 characters.  The parentheses for nested subexpressions are `\(' and
 `\)', with `(' and `)' by themselves ordinary characters.  `^' is an
 ordinary character except at the beginning of the RE or= the beginning
 of a parenthesized subex- pression, `$' is an ordinary character except
 at the end of the RE or= the end of a parenthesized subexpression, and
 `*' is an ordinary charac- ter if it appears at the beginning of the RE
 or the beginning of a paren- thesized subexpression (after a possible
 leading `^').  Finally, there is one new type of atom, a back
 reference: `\' followed by a non-zero deci- mal digit d matches the
 same sequence of characters matched by the dth parenthesized
 subexpression (numbering subexpressions by the positions of their
 opening parentheses, left to right), so that (e.g.) `\([bc]\)\1'
 matches `bb' or `cc' but not `bc'.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] [libtar.pas]:Error: Illegal type conversion: "ShortString" to "^Char" without compilator options

2006-10-06 Thread Vincent Snijders

TOUZEAU DAVID schreef:

Dear

I would like to use some units developped from delphi/klyx with Lazarus 
IDE On Linux.


It seems that there is some differences between delphi/freepascal 
especially for longstring conversion.


Many times, i received this compilator error :

For example by using the LibTar.pas 
(http://www.destructor.de/libtar/index.htm)


libtar.pas(355,8) Error: Illegal type conversion: "ShortString" to "^Char"

i fixed this error with  {$H+}{$LongString On} tokens

But is it this good way ??? is there an another solution ??


An alternative is to add {$mode delphi} to the source file or compile with -Sd 
compiler option.


Vincent
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] [libtar.pas]:Error: Illegal type conversion: "ShortString" to "^Char" without compilator options

2006-10-06 Thread TOUZEAU DAVID

Dear

I would like to use some units developped from delphi/klyx with Lazarus 
IDE On Linux.


It seems that there is some differences between delphi/freepascal 
especially for longstring conversion.


Many times, i received this compilator error :

For example by using the LibTar.pas 
(http://www.destructor.de/libtar/index.htm)


libtar.pas(355,8) Error: Illegal type conversion: "ShortString" to "^Char"

i fixed this error with  {$H+}{$LongString On} tokens

But is it this good way ??? is there an another solution ??

Best regards.

--

David Touzeau -- Linux Ubuntu Dapper 6.0.6 
FreePascal-Lazarus,perl,delphi,php icq:160018849

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: fpUnit - AssertEquals gives Access violation

2006-10-06 Thread Vincent Snijders

Graeme Geldenhuys schreef:

Oh, I forgot to mention.  If the ObjectStates match, the test passes
fine, and doesn't give an access violation.

While creating the new AssertEquals method, I purposefully created a
failure with then gives the access violation, instead to the
comparison message I expected:
 "Failing on 1: Expected  but got "



Try creating a back trace, maybe that gives some insight.

Vincent
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: fpUnit - AssertEquals gives Access violation

2006-10-06 Thread Graeme Geldenhuys

Oh, I forgot to mention.  If the ObjectStates match, the test passes
fine, and doesn't give an access violation.

While creating the new AssertEquals method, I purposefully created a
failure with then gives the access violation, instead to the
comparison message I expected:
 "Failing on 1: Expected  but got "

Regards,
 - Graeme -


On 06/10/06, Graeme Geldenhuys <[EMAIL PROTECTED]> wrote:

Hi,

AssertEquals always gives an Access violation error for some reason.
First some background info is needed

I first write some of my tests using AssertTrue as follows:
  AssertTrue('Failed on 2', posClean = lNode1.ObjectState);

This just raise the exception when they didn't match. I preferred to
have the style expected <> but got <> message.  So I started change
those tests to the following:

  AssertEquals('Failed on 5', ObjectStateToString(posClean),
ObjectStateToString(lList.ObjectState));

This worked fine, but after doing this for a while I realized I am
typing my life away with all those ObjectStateToString() calls.  Then
I thought, why don't I create a new AssertEquals method for my
projects that take TPerObjectState as parameters.  So I created this
in my custom test case class.

{ defined under Public }
procedure TM2TestCase.AssertEquals(const pMessage: string; pExpected,
  pActual: TPerObjectState);
begin
  AssertEquals(pMessage,
ObjectStateToString(pExpected),
ObjectStateToString(pActual));
end;

BTW: TPerObjectState is define as follows...

  TPerObjectState = (
  posEmpty,
  posPK,
  posCreate,
  posUpdate,
  posDelete,
  posDeleted,
  posClean
 ) ;



Now changing my test to the following, which is much easier to type and read:

  AssertEquals('Failed on 1', posEmpty, lLang.ObjectState);


Finally, getting back to the problem.  Using this new AssertEquals
always gives me a Access violation error.  I know there is a
AssertEquals that uses TClass, could that interfere with this?  I even
tried changing my new AssertEquals to use a different name
AssertEqualsObjState(), but that didn't help either.

What could be causing the problem?

Regards,
  - Graeme -


--
There's no place like 127.0.0.1




--
There's no place like 127.0.0.1
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] RE: Get Local IP using glib (eth0,eth1)

2006-10-06 Thread TOUZEAU DAVID

OK i understand that i using i386 no 64 bits

Marco van de Voort a écrit :
 
  
This function works perfectly without need to regex ifconfig... And i 
use glibc

I develop only on linux system.



Note that it is linux/x86 only. No 64-bit, or other platforms.

  


--

David Touzeau -- Linux Ubuntu Dapper 6.0.6 
FreePascal-Lazarus,perl,delphi,php icq:160018849


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] fpUnit - AssertEquals gives Access violation

2006-10-06 Thread Graeme Geldenhuys

Hi,

AssertEquals always gives an Access violation error for some reason.
First some background info is needed

I first write some of my tests using AssertTrue as follows:
 AssertTrue('Failed on 2', posClean = lNode1.ObjectState);

This just raise the exception when they didn't match. I preferred to
have the style expected <> but got <> message.  So I started change
those tests to the following:

 AssertEquals('Failed on 5', ObjectStateToString(posClean),
   ObjectStateToString(lList.ObjectState));

This worked fine, but after doing this for a while I realized I am
typing my life away with all those ObjectStateToString() calls.  Then
I thought, why don't I create a new AssertEquals method for my
projects that take TPerObjectState as parameters.  So I created this
in my custom test case class.

{ defined under Public }
procedure TM2TestCase.AssertEquals(const pMessage: string; pExpected,
 pActual: TPerObjectState);
begin
 AssertEquals(pMessage,
   ObjectStateToString(pExpected),
   ObjectStateToString(pActual));
end;

BTW: TPerObjectState is define as follows...

 TPerObjectState = (
 posEmpty,
 posPK,
 posCreate,
 posUpdate,
 posDelete,
 posDeleted,
 posClean
) ;



Now changing my test to the following, which is much easier to type and read:

 AssertEquals('Failed on 1', posEmpty, lLang.ObjectState);


Finally, getting back to the problem.  Using this new AssertEquals
always gives me a Access violation error.  I know there is a
AssertEquals that uses TClass, could that interfere with this?  I even
tried changing my new AssertEquals to use a different name
AssertEqualsObjState(), but that didn't help either.

What could be causing the problem?

Regards,
 - Graeme -


--
There's no place like 127.0.0.1
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] RE: Get Local IP using glib (eth0,eth1)

2006-10-06 Thread Marco van de Voort
 
> This function works perfectly without need to regex ifconfig... And i 
> use glibc
> I develop only on linux system.

Note that it is linux/x86 only. No 64-bit, or other platforms.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] RE: Get Local IP using glib (eth0,eth1)

2006-10-06 Thread TOUZEAU DAVID

Many Thanks Jeff and Micha.

This function works perfectly without need to regex ifconfig... And i 
use glibc

I develop only on linux system.

Great respects...
Just another question... (this because i came from Windows OS) how can i 
list wich interface loaded without need to parse /etc/networks/...? 
(wlan0,wlan1,eth0,eth1...)


Best regards...


Jeff Pohlmeyer a écrit :

I'm trying to write a function to read the local IP eth0/eth1
using glibc library...



program ip_addr;
{$MODE OBJFPC}

uses libc;
const
 IP_NAMESIZE = 16;
type
 ipstr = array[0..IP_NAMESIZE-1] of char;


function GetIPAddressOfInterface( if_name:ansistring):ansistring;
var
 ifr : ifreq;
 tmp:ipstr;
 sock : longint;
 p:pChar;

begin
 Result:='0.0.0.0';
 strncpy( ifr.ifr_ifrn.ifrn_name, pChar(if_name), IF_NAMESIZE-1 );
 ifr.ifr_ifru.ifru_addr.sa_family := AF_INET;
 FillChar(tmp[0], IP_NAMESIZE, #0);
 sock := socket(AF_INET, SOCK_DGRAM, IPPROTO_IP);
 if ( sock >= 0 ) then begin
   if ( ioctl( sock, SIOCGIFADDR, @ifr ) >= 0 ) then begin
 p:=inet_ntoa( ifr.ifr_ifru.ifru_addr.sin_addr );
 if ( p <> nil ) then strncpy(tmp, p, IP_NAMESIZE-1);
 if ( tmp[0] <> #0 ) then Result :=  tmp;
   end;
   libc.__close(sock);
 end;
end;




begin
 if (ParamCount=1)
 then WriteLn(GetIPAddressOfInterface(ParamStr(1)))
 else WriteLn('Usage:', ParamStr(0), '')
end.



- Jeff
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



--

David Touzeau -- Linux Ubuntu Dapper 6.0.6 
FreePascal-Lazarus,perl,delphi,php icq:160018849


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Unistalling FPC (and reinstalling from svn)

2006-10-06 Thread Marco van de Voort
> I have a silly question :  which is the best way to uninstall FPC ?  I
> have used
> the 2.0.4 tarball (Linux) and the install script included within.  I
> chose to install
> it in /usr/local.

No automatic way. Maybe the script should keep a filelist of what it
installs somehow.

Everything sqldb related is in the /usr/local/lib/fpc/ dir.

Just delete that, and clean up /usr/local/bin as good as you can, but it is
not THAT important. 
 
> 
> Also, after compiling FPC  with 'make build'  ,  if i execute 'make
> install'  will it
> copy everyting in  /usr/local   by default ?   Is the destination
> directory configurable
> somehow?

make install INSTALL_PREFIX=/usr/exp/



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Unistalling FPC (and reinstalling from svn)

2006-10-06 Thread Adrian Maier

Hello,

I have a silly question :  which is the best way to uninstall FPC ?  I
have used
the 2.0.4 tarball (Linux) and the install script included within.  I
chose to install
it in /usr/local.

Now, I need to compile from sources (so debug some problems with sqldb)
and i want to make sure that there are no files left from the initial FPC.

Unfortunately, there is no uninstall script and I need to delete
individual files manually  ;  which is not extremely difficult but i
can't be sure that
i haven't missed some files (for example the man pages  and the executables in
/usr/local/bin ).

Also, after compiling FPC  with 'make build'  ,  if i execute 'make
install'  will it
copy everyting in  /usr/local   by default ?   Is the destination
directory configurable
somehow?


--
Adrian Maier
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal