Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Rainer Stratmann via fpc-pascal
Am Sonntag, 7. Januar 2024, 14:09:24 CET schrieb Florian Klämpfl via fpc-
pascal:
> > Am 07.01.2024 um 13:21 schrieb Ingemar Ragnemalm via fpc-pascal
> > :
> > 
> > Just for comparison, I fired up Think Pascal and made Hello world!
> > 
> > Plain Hello world, closes so quickly that you don't have time to see it:
> > 4625 bytes.
> > 
> > Including ShowText and while not Button do; 4639 bytes.
> > 
> > Yes, less than 5k! Progress?
> 
> https://github.com/chainq/amiga-tiny-hello-p
> 
> 244 bytes with FPC.

Is the size of AVR programs reasonable small?
Is the AVR code stable?
I would like to switch to freepascal.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] RIP: Software design pioneer and Pascal creator Niklaus Wirth

2024-01-05 Thread Rainer Stratmann via fpc-pascal
Misconstruing complexity as sophistication: According to Wirth, “people seem 
to misinterpret complexity as sophistication.” The more complicated a product 
is, the more polished or knowledgeable the user would appear. Hence, software 
vendors create complex software and send this marketing message.

I see it widely

https://www.techslang.com/definition/what-is-wirths-law/



Am Freitag, 5. Januar 2024, 10:13:53 CET schrieb Tony Whyman via fpc-pascal:
> "Swiss computer scientist Professor Niklaus Wirth died on New Year's
> Day, roughly six weeks before what would have been his 90th birthday."
> 
> https://www.theregister.com/2024/01/04/niklaus_wirth_obituary/?utm_source=da
> ily_medium=newsletter_content=top-article
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Program crash - read the error messages

2023-09-01 Thread Rainer Stratmann via fpc-pascal
Am Freitag, 1. September 2023, 18:46:06 CEST schrieb Peter B via fpc-pascal:
> Can you compile the crashing program with  -gl?

Yes, I can. I know this, but then the program is bigger. For finding the error 
it is useful, yes. Otherwise I switch it off. There are around 100 clients that 
download the program automatically.

> That should give you a useful stack dump with line numbers.
:-)


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Program crash - read the error messages

2023-09-01 Thread Rainer Stratmann via fpc-pascal
Am Freitag, 1. September 2023, 17:57:26 CEST schrieb Tomas Hajny via fpc-
pascal:
> On 2023-09-01 17:39, Rainer Stratmann via fpc-pascal wrote:
> > Ah, sorry. I Forgot it totally.
> > 
> > It is a plain console program under Linux.
> > 
> > Yes, the remaining program starts the crashing one and I would like to
> > check
> > the results? Yes, a run-time error was there.
> > 
> > I start the program with a console command.
> > 
> > An unhandled exception occured at $0814EC41:
> > EAccessViolation:  Access violation
> > 
> >   $0814EC41
> >   ...
> >   ...
> >   ...
> > 
> > This messages I need to read automatically
> 
> OK. You still missed to provide information on how you start the
> crashing program from the remaining program

Look above.
> > I start the program with a console command.
More precisely: I start the crashing program with a shell command from the 
remaining program.

Everything runs as root. These are more or less the only programs on this 
(mini-itx embedded) computer running. I have full control then.

> - certain approaches don't
> allow simple access to the result (e.g. checking whether it's still
> running or accessing the process exit code), whereas others do. However,
> in general, you need to redirect the output and stderr handles (e.g. to
> a pipe if doing it under Linux, but a file would do as well) and read
> them from the remaining program. As an example, TProcess (in unit
> Process) provides means for all of this.

If I start the program with

program 2>output.txt

it works! Thank you.

> 
> Tomas
> 
> > Am Freitag, 1. September 2023, 16:13:54 CEST schrieb Tomas Hajny via
> > fpc-
> > 
> > pascal:
> >> On 2023-09-01 15:43, Rainer Stratmann via fpc-pascal wrote:
> >> 
> >> 
> >> Hello,
> >> 
> >> > Where can I find the output of the error messages if a program crashes.
> >> > 
> >> > There is another program that still is running.
> >> > I want to read the error messages automatically if that is possible.
> >> 
> >> I'm afraid that we'd need a bit more information on what is your
> >> situation and what you try to achieve. In particular:
> >> 
> >> 1) What kind of an application is your program (console, GUI, ...),
> >> under which operating system?
> >> 
> >> 2) You mention that there is another program that is still running -
> >> do
> >> you mean that the remaining program starts the crashing one and you
> >> would like to check the results? If this is the case, how you start
> >> the
> >> program (Dos.Exec, SysUtils.ExecuteProcess, Process.TProcess, ...)?
> >> 
> >> 3) What do you mean if you say "crashes" - a run-time error? Or a GUI
> >> message box stating that the program crashed? Or...?
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Program crash - read the error messages

2023-09-01 Thread Rainer Stratmann via fpc-pascal
Ah, sorry. I Forgot it totally.

It is a plain console program under Linux.

Yes, the remaining program starts the crashing one and I would like to check 
the results? Yes, a run-time error was there.

I start the program with a console command.

An unhandled exception occured at $0814EC41:
EAccessViolation:  Access violation
  $0814EC41
  ...
  ...
  ...

This messages I need to read automatically

Am Freitag, 1. September 2023, 16:13:54 CEST schrieb Tomas Hajny via fpc-
pascal:
> On 2023-09-01 15:43, Rainer Stratmann via fpc-pascal wrote:
> 
> 
> Hello,
> 
> > Where can I find the output of the error messages if a program crashes.
> > 
> > There is another program that still is running.
> > I want to read the error messages automatically if that is possible.
> 
> I'm afraid that we'd need a bit more information on what is your
> situation and what you try to achieve. In particular:
> 
> 1) What kind of an application is your program (console, GUI, ...),
> under which operating system?
> 
> 2) You mention that there is another program that is still running - do
> you mean that the remaining program starts the crashing one and you
> would like to check the results? If this is the case, how you start the
> program (Dos.Exec, SysUtils.ExecuteProcess, Process.TProcess, ...)?
> 
> 3) What do you mean if you say "crashes" - a run-time error? Or a GUI
> message box stating that the program crashed? Or...?
> 
> Tomas
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Program crash - read the error messages

2023-09-01 Thread Rainer Stratmann via fpc-pascal
Where can I find the output of the error messages if a program crashes.

There is another program that still is running.
I want to read the error messages automatically if that is possible.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Compile time -> processor benchmark values

2023-05-29 Thread Rainer Stratmann via fpc-pascal
Now I have a i7-3770S

cpubenchmark says:
Average CPU Mark: 6175
Single Thread Rating: 2043
https://www.cpubenchmark.net/cpu.php?cpu=Intel+Core+i7-3770S+%40+3.10GHz

I expect to buy a new computer with a i5-13400F or similar
cpubenchmark says:
Average CPU Mark: 25969
Single Thread Rating: 3702
https://www.cpubenchmark.net/cpu.php?cpu=Intel+Core+i5-13400

What is important for the compile time?
The average CPU Mark that means more than 4 times faster?
Or the single thread rating that means 1,8 times faster?

Besides faster memory, ssd, etc.



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Working on a new way to educate people about pascal

2022-12-29 Thread Rainer Stratmann via fpc-pascal
Am Donnerstag, 29. Dezember 2022, 15:02:41 CET schrieb DougC via fpc-pascal:
> The response has been made that the example code in the tutorial is more
> complicated than it should be.

The installation process (in my case Linux) should be easy as well.
For beginners that is at least as important as a good example.
My experience is that this is often a problem in Linux. I use debian.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Working on a new way to educate people about pascal

2022-12-28 Thread Rainer Stratmann via fpc-pascal
Am Dienstag, 27. Dezember 2022, 17:47:13 CET schrieb Anthony Walter via fpc-
pascal:
> Hi guys,
> 
> I had a new idea for an interface design to help people who either are not
> into programming yet or have only used a language other than Free Pascal.

Hello,

the design is really good.
I have the same opinion that the example is very difficult. If I was a beginner 
I would not be enthusiastic about starting with freepascal with these kind of 
example. I would also describe me as a very experienced programmer.

You could make 2 examples. One simple and one advanced.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Be careful of too many features

2022-05-30 Thread Rainer Stratmann via fpc-pascal
Am Montag, 30. Mai 2022, 20:59:56 CEST schrieb Steve Litt via fpc-pascal:
> I think adding yet more features obfuscates and Perlizes
> Pascal.

What does Perlize mean?

Only a very little percentage of the code is using it.
And you could easily do it in another way.
I also don't like make things complicated.
But they will do it anyway.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-22 Thread Rainer Stratmann via fpc-pascal
Am Freitag, 22. April 2022, 19:53:34 CEST schrieben Sie:
> Am 22.04.2022 um 15:48 schrieb Rainer Stratmann via fpc-pascal:
> > Am Mittwoch, 20. April 2022, 19:15:15 CEST schrieb Sven Barth via fpc-
pascal:

> We don't deal in percentages, however it reduces the amount of typing
> required to write code with a lot of specializations (in theory an IDE
> like Lazarus *could* help here as well however).

Of course 'you' do. When I asked for a simple feature years ago it was 
refused. And there were several explanations why this feature is not 
necessary.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-22 Thread Rainer Stratmann via fpc-pascal
Am Freitag, 22. April 2022, 17:27:33 CEST schrieb Hairy Pixels via fpc-pascal:
> > On Apr 22, 2022, at 8:48 PM, Rainer Stratmann via fpc-pascal

> It’s like everything else in programming languages.
> 
> 1) you can specialize the function manually so implicit specialization is
> not needed. 
> 2) you can duplicate functions and change types manually so
> generic functions are not needed. 
> 3) you can program in assembly so high-level languages are needed. 
> 4) etc… :)
> 
> Joking aside it just makes for less code and more readable code (in my
> opinion).

From assembly to high-level language there is a huge step.
From high-level language to implicit generic function specializations it is a 
little step regarding the benefits.

In my opinion it makes everything more complicated. My mind refuses to read 
the description of the new feature.

But mostly I am worried because of the statement "has the potential to break 
existing code".
 


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-22 Thread Rainer Stratmann via fpc-pascal
Am Mittwoch, 20. April 2022, 19:15:15 CEST schrieb Sven Barth via fpc-pascal:
> This feature is enabled with the modeswitch
> ImplicitFunctionSpecialization and is for now not enabled by default as
> this has the potential to break existing code.

How many percent of the users need this feature?
Is it a feature that is a must?
Can everyone get also a solution without the feature?
Does it justify the risk of the whole language (has the potential to break 
existing code)?



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Interface section overload procedures are all public

2022-01-23 Thread Rainer Stratmann via fpc-pascal
// making only one procedure bugtest public in the interface section
// makes all other bugtest procedures public as well!
// Lazarus 2.0.0+dfsg-2
// FPC-Version: 3.0.4
// OS: Linux Debian 32 Bit

unit test;

interface

procedure bugtest( p1 : longint );

implementation

procedure bugtest( p1 : longint );
begin
end;

procedure bugtest( p1 , p2 : longint );
begin
end;

procedure bugtest( p1 , p2 , p3 : longint );
begin
end;

begin
end. 


// Somewhere in the main program
 bugtest( 1 );
 bugtest( 1 , 2 );
 bugtest( 1 , 2 , 3 );



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] freepascal.org SSL_ERROR_BAD_CERT_DOMAIN

2022-01-05 Thread Rainer Stratmann via fpc-pascal
Here it is ok now.

Linux Debian, Firefox Browser

Am Mittwoch, 5. Januar 2022, 11:05:34 CET schrieb Michael Van Canneyt via fpc-
pascal:
> On Wed, 5 Jan 2022, Dimitrios Chr. Ioannidis via fpc-pascal wrote:
> > Hi,
> > 
> > On 2022-01-05 11:09, Dmitry Boyarintsev via fpc-pascal wrote:
> >> On Wed, Jan 5, 2022 at 2:49 AM Dimitrios Chr. Ioannidis via fpc-pascal
> >> 
> >>  wrote:
> >>> the certificate issued for www.freepascal.org [1] and not for
> >>> freepascal.org [2] .
> >>> 
> >>> It seems that the let's encrypt script was run with -d
> >>> freepascal.org [2]
> >>> instead of -d *.freepascal.org [2] .
> >> 
> >> I don't know how it works for Open Source world, but for the
> >> commercial world wild-card certificates (*.freepascal.org [2]) are
> >> more expensive, than a single name certificate (www.freepascal.org
> >> [1])
> > 
> > AFAIK, let's encrypt support's wildcard certificates from 2018. I don't
> > know if anything is changed.
> 
> I have made some changes, hopefully all is fixed...
> 
> Michael.
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] freepascal.org SSL_ERROR_BAD_CERT_DOMAIN

2022-01-04 Thread Rainer Stratmann via fpc-pascal
https://freepascal.org/


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-12-28 Thread Rainer Stratmann via fpc-pascal
May be that helps a little bit.
Please give a feedback if it works or not or if you can improve it.

I use the curl library directly. Not on the command line.

{$ifdef windows}

uses sockets , winsock2;

procedure adds2( var dw : dword ; p : pointer );
var
 addr : pinaddr;
begin
 addr := p;
 if addr <> nil then begin
  dw := addr^.s_bytes[ 1 ] shl 24
  + addr^.s_bytes[ 2 ] shl 16
  + addr^.s_bytes[ 3 ] shl 8
  + addr^.s_bytes[ 4 ];
 end;
end;

function ipx_getlocal_ip( out ip , mask , flags : dword ) : boolean;
var
 hostinfo : phostent;
 addr2 : pchar;
 p1 : pointer;
 pp : ^pointer;
 l : longint;
begin
 result := false;
 ip := 0;
 mask := 0;
 flags := 0;
 hostinfo := gethostbyname( nil );
 if hostinfo <> nil then begin
   p1 := hostinfo^.h_addr_list;
   pp := p1;
   if pp^ <> nil then adds2( ip , pp^ );
 end;
end;
{$endif} 




Am Freitag, 10. September 2021, 09:03:30 CET schrieb Bo Berglund via fpc-
pascal:
> Is there a way to enumerate the active adapters on a Windows computer with
> their IPv4 and MAC addresses?
> 
> I am trying to convert a Linux reporting script to Windows, but I have a
> hard time finding a suitable Windows command. The script uses common Linux
> commands and tools to get the eth0 and wlan0 data (IPv4 and MAC addresses)
> and then to POST it to my website mailer (php script) via curl. See below.
> 
> I have curl on Windows too so once the data are found the same command can
> be used here as well, but the network info extraction seems to be a lot
> harder.
> 
> So I figured I could write a small FPC command line tool to extract this
> information and use it in the batch file.
> 
> But is there some such call available in FPC or standard packages like LNet
> or similar?
> 
> On Linux I can do this in the bash script:
> 
> MyName=$(hostname)
> IPAddr=$(ifconfig eth0|grep "inet "|sed 's/ *inet //;s/ .*//')
> IPAddrWiFi=$(ifconfig wlan0|grep "inet "|sed 's/ *inet //;s/ .*//')
> IPMac=$(ifconfig eth0 | grep -Eo ..\(\:..\){5})
> IPMacWiFi=$(ifconfig wlan0 | grep -Eo ..\(\:..\){5})
> 
> I don't believe there is a similar command line way on Windows, so therefore
> I ask for a FPC way of getting it.




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Creating a shared library (Linux)

2021-12-28 Thread Rainer Stratmann via fpc-pascal
Ok.

'lib' is placed in front of the output file and '.so' afterwards.
So the library is "libmylib.so"

And "nm -D libmylib.so" works now.

But it is confusing, because it is nowhere explained in the compiler.
[x] Konventionen anwenden
[x] use conventions
In the Project settings -> path window could be better explained.

Am Dienstag, 28. Dezember 2021, 13:10:56 CET schrieb Rainer Stratmann via fpc-
pascal:
> https://www.freepascal.org/docs-html/prog/progse55.html
> 
> When analysing the mylib.o output file under Linux with
> 
> nm -D mylib.o
> 
> the answer is: no symbols.
> 
> I have an export section in the library and in the past it worked already,
> but I did not remember exactly how.
> 
> How can I get a shared library?
> What compiler switches do I have to set?
> 
> 
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Creating a shared library (Linux)

2021-12-28 Thread Rainer Stratmann via fpc-pascal
https://www.freepascal.org/docs-html/prog/progse55.html

When analysing the mylib.o output file under Linux with

nm -D mylib.o

the answer is: no symbols.

I have an export section in the library and in the past it worked already, but 
I did not remember exactly how.

How can I get a shared library?
What compiler switches do I have to set?



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] 64 bit Linux syscall from 32 bit fpc program

2021-12-24 Thread Rainer Stratmann via fpc-pascal
Am Freitag, 24. Dezember 2021, 23:02:03 CET schrieb Sven Barth via fpc-pascal:
> Rainer Stratmann via fpc-pascal  schrieb
> 
> am Fr., 24. Dez. 2021, 15:04:
> > Is it possible to make a direct 64 bit Linux syscall from a 32 bit fpc
> > programm?
> 
> No, because your program is running as a 32-bit process and thus only has
> access to the 32-bit space of syscalls.
> 
> Why, what do you want to do?

My Kernel Mode Setting Program is not working on the latest Debian Linux 64 
Bit Kernel.

Debian 10 - 32 Bit Linux - it works
Debian 10 - 64 Bit Linux - it works
Debian 11 - 32 Bit Linux - it works
Debian 11 - 64 Bit Linux - it does not work

It has something to do with mmap2 and may be the vtconsole.
I guess mmap2 is not working correctly in Debian 11 - 64 Bit Linux.
Or the vtconsole takes over the framebuffer.

> Regards,
> Sven




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] 64 bit Linux syscall from 32 bit fpc program

2021-12-24 Thread Rainer Stratmann via fpc-pascal
Is it possible to make a direct 64 bit Linux syscall from a 32 bit fpc 
programm?


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How To: Use lib curl example

2021-12-05 Thread Rainer Stratmann via fpc-pascal
Am Sonntag, 5. Dezember 2021, 20:38:30 CET schrieb Rainer Stratmann via fpc-
pascal:
> Does that mean curl is always waiting until the whole operation (download)
> is complete?
> 
> Is it possible to do it in a nonblocked way? For example with a continuous
> nonblocked loop call and a flag when the operation is finished?
> 

Found it already. It seems that a nonblocking operation mode is possible!

https://everything.curl.dev/libcurl/drive
https://everything.curl.dev/libcurl/drive/multi

> 
> Am Dienstag, 28. September 2021, 02:01:00 CET schrieb Anthony Walter via
> fpc-
> pascal:
> > I was having some problems using vanilla sockets and OpenSSL to read a few
> > specific web pages using HTTPS. Normally I don't have any problems
> > using HTTPS, but with a few sites my code was not working. I ending up
> > finding the RTL unit LibCurl in one of the FPC packages and got it working
> > without too much trouble. LibCurl is a library allowing programmers to get
> > the functionality of the curl program without launching an external
> > process.
> > 
> > If anyone is interested, here is a small bit of code to GET a page over
> > HTTP or HTTPS using LibCurl.
> > 
> > Interface:
> > 
> > function CurlGet(const Url: string; out Data: string; UserAgent: string =
> > ''): Boolean;
> > 
> > Implementation:
> > 
> > uses
> > 
> >   LibCurl;
> > 
> > function WriteData(Ptr: PChar; MemberSize, MemberCount: UIntPtr; var Data:
> > string): UIntPtr; cdecl;
> > var
> > 
> >   S: string;
> > 
> > begin
> > 
> >   SetString(S, Ptr, MemberSize * MemberCount);
> >   Data := Data + S;
> >   Result := MemberSize * MemberCount;
> > 
> > end;
> > 
> > function CurlGet(const Url: string; out Data: string; UserAgent: string =
> > ''): Boolean;
> > var
> > 
> >   Curl: PCURL;
> > 
> > begin
> > 
> >   Data := '';
> >   Result := False;
> >   if Url = '' then
> >   
> > Exit;
> >   
> >   Curl := curl_easy_init();
> >   if Curl = nil then
> >   
> > Exit;
> >   
> >   try
> >   
> > curl_easy_setopt(curl, CURLOPT_URL, [PChar(Url)]);
> > if UserAgent <> '' then
> > 
> >   curl_easy_setopt(curl, CURLOPT_USERAGENT, [PChar(UserAgent)]);
> > 
> > curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, [@WriteData]);
> > curl_easy_setopt(curl, CURLOPT_WRITEDATA, [@Data]);
> > curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, [0]);
> > curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, [0]);
> > Result := curl_easy_perform(curl) = CURLE_OK;
> >   
> >   finally
> >   
> > curl_easy_cleanup(Curl);
> >   
> >   end;
> > 
> > end;
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How To: Use lib curl example

2021-12-05 Thread Rainer Stratmann via fpc-pascal
Does that mean curl is always waiting until the whole operation (download) is 
complete?

Is it possible to do it in a nonblocked way? For example with a continuous 
nonblocked loop call and a flag when the operation is finished?


Am Dienstag, 28. September 2021, 02:01:00 CET schrieb Anthony Walter via fpc-
pascal:
> I was having some problems using vanilla sockets and OpenSSL to read a few
> specific web pages using HTTPS. Normally I don't have any problems
> using HTTPS, but with a few sites my code was not working. I ending up
> finding the RTL unit LibCurl in one of the FPC packages and got it working
> without too much trouble. LibCurl is a library allowing programmers to get
> the functionality of the curl program without launching an external process.
> 
> If anyone is interested, here is a small bit of code to GET a page over
> HTTP or HTTPS using LibCurl.
> 
> Interface:
> 
> function CurlGet(const Url: string; out Data: string; UserAgent: string =
> ''): Boolean;
> 
> Implementation:
> 
> uses
>   LibCurl;
> 
> function WriteData(Ptr: PChar; MemberSize, MemberCount: UIntPtr; var Data:
> string): UIntPtr; cdecl;
> var
>   S: string;
> begin
>   SetString(S, Ptr, MemberSize * MemberCount);
>   Data := Data + S;
>   Result := MemberSize * MemberCount;
> end;
> 
> function CurlGet(const Url: string; out Data: string; UserAgent: string =
> ''): Boolean;
> var
>   Curl: PCURL;
> begin
>   Data := '';
>   Result := False;
>   if Url = '' then
> Exit;
>   Curl := curl_easy_init();
>   if Curl = nil then
> Exit;
>   try
> curl_easy_setopt(curl, CURLOPT_URL, [PChar(Url)]);
> if UserAgent <> '' then
>   curl_easy_setopt(curl, CURLOPT_USERAGENT, [PChar(UserAgent)]);
> curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, [@WriteData]);
> curl_easy_setopt(curl, CURLOPT_WRITEDATA, [@Data]);
> curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, [0]);
> curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, [0]);
> Result := curl_easy_perform(curl) = CURLE_OK;
>   finally
> curl_easy_cleanup(Curl);
>   end;
> end;




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Example for unit paszlib

2021-08-26 Thread Rainer Stratmann via fpc-pascal
Yes it works now.

I used the unit paszlib like in the wiki on top and in the url of the wiki.
It works somehow, because the paszlib unit exists.
But I changed it into zipper now and everything is fine!
Thank you for helping me.


Am Mittwoch, 25. August 2021, 22:14:26 CEST schrieb Michael Van Canneyt via 
fpc-pascal:
> On Wed, 25 Aug 2021, Rainer Stratmann via fpc-pascal wrote:
> > Is there an example for the unit paszlib?
> > 
> > This does not work:
> > https://wiki.lazarus.freepascal.org/paszlib
> 
> What does not work exactly ? the zipper unit is used a lot.
> It definitely works.
> 
> > I have Lazarus 2.0.0
> > FPC 3.0.4
> 
> Maybe start by upgrading to 3.2.2 ?
> 
> > May be there are different versions of paszlib.
> 
> Not to our knowledge.
> 
> Michael.
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Example for unit paszlib

2021-08-25 Thread Rainer Stratmann via fpc-pascal
Is there an example for the unit paszlib?

This does not work:
https://wiki.lazarus.freepascal.org/paszlib

I have Lazarus 2.0.0
FPC 3.0.4

May be there are different versions of paszlib.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] 50 years of Pascal, by the the author himself

2021-05-12 Thread Rainer Stratmann via fpc-pascal
https://www.mikroe.com/mikropascal-avr

It is in heavy use.

They have Pascal compilers for ARM, PIC, etc. also.

Am Mittwoch, 12. Mai 2021, 21:51:03 CEST schrieb Ryan Joseph via fpc-pascal:
> > On May 12, 2021, at 12:30 PM, Ralf Quint via fpc-pascal
> >  wrote:
> > 
> > Thought this was kind of interesting, though it leaves short of mentioning
> > the later Object Pascal evolution and thus Delphi and FreePascal...
> Isn't Free Pascal and Delphi basically the only Pascal compilers left? I
> used THINK Pascal and Metrowerks Pascal in the distant past but those are
> all long dead. You can't really talk about Pascal in 2021 without
> mentioning those 2 compilers.
> 
> Regards,
>   Ryan Joseph
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] 50 Years of Pascal

2021-02-24 Thread Rainer Stratmann via fpc-pascal
Am Mittwoch, 24. Februar 2021, 17:50:45 CET schrieb Liam Proven via fpc-
pascal:
> I thought this might interest folks. Apologies if I am late to the party.
> 
> https://cacm.acm.org/magazines/2021/3/250705-50-years-of-pascal/fulltext

https://de.wikipedia.org/wiki/Niklaus_Wirth

Here is an interesting Video Interview with the founder of the language 
Pascal. In german.



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpmmap problem 64 bit linux

2020-11-22 Thread Rainer Stratmann via fpc-pascal
mmap2 could be helpful.

The mmap2() system call provides the same interface as mmap(),
except that the final argument specifies the offset into the file in
4096-byte units (instead of bytes, as is done by mmap()).  This
enables applications that use a 32-bit off_t to map large files (up
to 2^44 bytes).

https://man7.org/linux/man-pages/man2/mmap2.2.html

But it is not yet implemented.

FPC 3.0.4


Am Samstag, 21. November 2020, 13:31:22 CET schrieb Rainer Stratmann via fpc-
pascal:
> I watched the syscalls with strace and my assumption was confirmed.
> 
> function Fpmmap( start: pointer; len: size_t; prot: cint; flags: cint;
> fd:cint; offst: off_t ):pointer;
> 
> My offst value for fpmmap is $1.
> 
> strace output:
> 
> mmap(NULL, 192, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_32BIT, 3, 0) = -1
> EINVAL
> 
> Here the value is 0.
> 
> It is likely that the offst value is stripped to 32 bit before passed to the
> mmap syscall.
> 
> 
> 
> Am Samstag, 21. November 2020, 01:15:20 CET schrieb Alexander Grotewohl via
> 
> fpc-pascal:
> > It would seem C handles this at compile time with a define.. mapping mmap
> > to mmap64. Which would almost seem to imply you'd end up with a 32 bit
> > binary that would only work on 64 bit systems. I'm not really sure how
> > this would work for Pascal. You could start by looking in the file listed
> > in the fpmmap docs you posted. My guess is the easiest answer is
> > "distribute both 32 and 64 bit versions," but that doesn't help when you
> > need to test the 32 bit one..
> > 
> > --
> > Alexander Grotewohl
> > https://dcclost.com
> > 
> > --
> > Alexander Grotewohl
> > https://dcclost.com
> > ____
> > From: fpc-pascal  on behalf of
> > Rainer Stratmann via fpc-pascal  Sent:
> > Friday, November 20, 2020 6:33:51 PM
> > To: fpc-pascal@lists.freepascal.org 
> > Cc: Rainer Stratmann 
> > Subject: [fpc-pascal] fpmmap problem 64 bit linux
> > 
> > A 32 bit freepascal program on a 32 bit Linux Debian system is working
> > properly. It uses fpmmap for getting the adress of a kms framebuffer.
> > 
> > The same 32 bit program on a 64 bit Linux Debian system *** is not
> > working.
> > When it comes to the fpmmap it gives an error:
> > 
> > Sys_EINVAL
> > 
> > One of the record fields Start, length or offset is invalid.
> > 
> > https://www.freepascal.org/docs-html/rtl/baseunix/fpmmap.html
> > 
> > I figured out that it likely can only be the offset value since start and
> > length are always the same.
> > 
> > The offset value I got from a previous DRM function.
> > 
> > On the 32 bit System this offset value is $1000 (fits in 32 bit)
> > And on the 64 bit System this offset value is $1 (does not fit in
> > 32 bit).
> > 
> > Can it be possible that the fpmmap function strips the offset value to 32
> > bit? Is there another way to call fpmmap more directly?
> > What does fpmmap exactly?
> > Where can I research?
> > 
> > 
> > ***
> > dpkg --add-architecture i386
> > apt-get update
> > apt-get install libc6-i386
> > 
> > 
> > ___
> > fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpmmap problem 64 bit linux

2020-11-21 Thread Rainer Stratmann via fpc-pascal
I watched the syscalls with strace and my assumption was confirmed.

function Fpmmap( start: pointer; len: size_t; prot: cint; flags: cint; fd:cint; 
offst: off_t ):pointer;

My offst value for fpmmap is $1.

strace output:

mmap(NULL, 192, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_32BIT, 3, 0) = -1 
EINVAL

Here the value is 0.

It is likely that the offst value is stripped to 32 bit before passed to the 
mmap syscall.



Am Samstag, 21. November 2020, 01:15:20 CET schrieb Alexander Grotewohl via 
fpc-pascal:
> It would seem C handles this at compile time with a define.. mapping mmap to
> mmap64. Which would almost seem to imply you'd end up with a 32 bit binary
> that would only work on 64 bit systems. I'm not really sure how this would
> work for Pascal. You could start by looking in the file listed in the
> fpmmap docs you posted. My guess is the easiest answer is "distribute both
> 32 and 64 bit versions," but that doesn't help when you need to test the 32
> bit one..
> 
> --
> Alexander Grotewohl
> https://dcclost.com
> 
> --
> Alexander Grotewohl
> https://dcclost.com
> ________
> From: fpc-pascal  on behalf of
> Rainer Stratmann via fpc-pascal  Sent:
> Friday, November 20, 2020 6:33:51 PM
> To: fpc-pascal@lists.freepascal.org 
> Cc: Rainer Stratmann 
> Subject: [fpc-pascal] fpmmap problem 64 bit linux
> 
> A 32 bit freepascal program on a 32 bit Linux Debian system is working
> properly. It uses fpmmap for getting the adress of a kms framebuffer.
> 
> The same 32 bit program on a 64 bit Linux Debian system *** is not working.
> When it comes to the fpmmap it gives an error:
> 
> Sys_EINVAL
> One of the record fields Start, length or offset is invalid.
> 
> https://www.freepascal.org/docs-html/rtl/baseunix/fpmmap.html
> 
> I figured out that it likely can only be the offset value since start and
> length are always the same.
> 
> The offset value I got from a previous DRM function.
> 
> On the 32 bit System this offset value is $1000 (fits in 32 bit)
> And on the 64 bit System this offset value is $1 (does not fit in 32
> bit).
> 
> Can it be possible that the fpmmap function strips the offset value to 32
> bit? Is there another way to call fpmmap more directly?
> What does fpmmap exactly?
> Where can I research?
> 
> 
> ***
> dpkg --add-architecture i386
> apt-get update
> apt-get install libc6-i386
> 
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] fpmmap problem 64 bit linux

2020-11-20 Thread Rainer Stratmann via fpc-pascal
A 32 bit freepascal program on a 32 bit Linux Debian system is working 
properly. It uses fpmmap for getting the adress of a kms framebuffer.

The same 32 bit program on a 64 bit Linux Debian system *** is not working.
When it comes to the fpmmap it gives an error:

Sys_EINVAL
One of the record fields Start, length or offset is invalid.

https://www.freepascal.org/docs-html/rtl/baseunix/fpmmap.html

I figured out that it likely can only be the offset value since start and 
length 
are always the same.

The offset value I got from a previous DRM function.

On the 32 bit System this offset value is $1000 (fits in 32 bit)
And on the 64 bit System this offset value is $1 (does not fit in 32 
bit).

Can it be possible that the fpmmap function strips the offset value to 32 bit?
Is there another way to call fpmmap more directly?
What does fpmmap exactly?
Where can I research?


***
dpkg --add-architecture i386
apt-get update
apt-get install libc6-i386


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Writeln() behaves differently on Windows and Linux, why?

2020-07-09 Thread Rainer Stratmann
I had exactly the same behaviour.

Some setterm commands solved it, if I remember correct.

setterm -blank 0
setterm -powersave off

I guess it was the first command.
You can try it.


Am Donnerstag, 9. Juli 2020, 18:01:42 CEST schrieb Bo Berglund via fpc-pascal:
> I am writing a cross-platform program (console program, no GUI).
> I am using Lazarus 2.0.8 and FPC 3.0.4 on both Linux and Windows.
> 
> During sebugging I have put numerous writeln commands in the code to
> track what is happening.
> I started on Windows and all worked just fine according to
> expectations.
> Every new output generated a new line on the console with the printed
> text left aligned.
> 
> But then I moved the code over to Linux (Raspbian Buster) and
> strangely this happens:
> 
> Test line 1
>Test line 2
>   Test line 3
> 
> and so on.
> It looks exactly the same if I use a terminal window on the Linux
> system itself as it does if I connect to the Linux machine using PuTTY
> from Windows...
> 
> 
> It seems like a writeln() in the code does actually not do a carriage
> return on the console, just a linefeed so the console continues at the
> column where the previous line ended.
> The messages I print out are simple text strings either showing
> incoming data packets or just my comment.
> 
> Typical code:
> 
>   s := 'Status changed: ' + newstat + ' msg: ' + AStatusText;
>   LogStd(s);
>   Writeln(s);
> 
> In the log file this obviously does not happen...
> 
> What can cause this strange behaviour?




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC for Win64

2020-07-07 Thread Rainer Stratmann
Am Dienstag, 7. Juli 2020, 09:42:54 CEST schrieb Marco van de Voort:
> Op 07/07/2020 om 09:14 schreef Rainer Stratmann:
> > For Linux: Does that mean apt-get install lazarus is always the 32bit
> > version? Regardless of the Linux Version (32bit or 64bit).
> 
> No. The reason for no 64-bit compiler is specific to Windows 64-bit.

Then how to install a 32-bit Lazarus/FPC on a 64-bit Linux Debian System?



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC for Win64

2020-07-07 Thread Rainer Stratmann
Am Samstag, 4. Juli 2020, 20:02:39 CEST schrieb Graeme Geldenhuys:
> On 02/07/2020 9:30 pm, Evert van Dijken via fpc-pascal wrote:
> > I see a WIN32 compiler and a WIN64 cross
> > compiler. How it works is a mystery for me.
> 
> I never understood the choice FPC made to not create a native 64-bit
> compiler, but rather stay with a cross-compiler. *shrug*
> I've always simply downloaded the latest release source code, and
> built my own native 64-bit FPC with the previous FPC release.
> 
> I've done this for 10 years - simply because 10 years ago (there
> about) I had issues with the cross-compiler generating broken
> executables. Obviously that could have been a local problem, but
> either way, I didn't trust them since. So I compile my own
> native 64-bit version (just like I did for Linux and FreeBSD).

For Linux: Does that mean apt-get install lazarus is always the 32bit version?
Regardless of the Linux Version (32bit or 64bit).
 
> 
> Regards,
>   Graeme




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Different behaviour between FPC 2.6.4 and FPC 3.0.4

2020-05-05 Thread Rainer Stratmann
Am Dienstag, 5. Mai 2020, 22:53:53 CEST schrieb Bart via fpc-pascal:
> On Tue, May 5, 2020 at 10:05 PM Rainer Stratmann
> 
>  wrote:
> > Did I overlooked something?
> 
> Your function returns a functiontype?
> Is that intended?

And I wonder why
 result := false;
did not work in this function :-)
 
> --
> Bart
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Different behaviour between FPC 2.6.4 and FPC 3.0.4

2020-05-05 Thread Rainer Stratmann
Am Dienstag, 5. Mai 2020, 22:53:53 CEST schrieb Bart via fpc-pascal:
> On Tue, May 5, 2020 at 10:05 PM Rainer Stratmann
> 
>  wrote:
> > Did I overlooked something?
> 
> Your function returns a functiontype?
> Is that intended?

No :-)
But that worked a long time (2 years or so) with FPC 2.6.4

procvar points either to a library function or to a default function.

In case of the shown example it was the default function.

May be a pointer to zero was not executed in FPC 2.6.4 because it does not 
make sense. And in FPC 3.0.4 the compiled program executes a pointer to zero 
(nil). Or similar.

Anyway it runs well now. Thanks!
 
> --
> Bart
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Different behaviour between FPC 2.6.4 and FPC 3.0.4

2020-05-05 Thread Rainer Stratmann
YES that works, thank you!


Am Dienstag, 5. Mai 2020, 22:27:12 CEST schrieb Alexander Grotewohl:
> my original suggestion and then
> 
> function proc_bool : boolean;
> 
> what exactly are you trying to accomplish?
> 
> --
> Alexander Grotewohl
> https://dcclost.com
> 
> From: fpc-pascal  on behalf of
> Rainer Stratmann  Sent: Tuesday, May 5, 2020
> 4:20:11 PM
> To: FPC-Pascal users discussions 
> Subject: Re: [fpc-pascal] Different behaviour between FPC 2.6.4 and FPC
> 3.0.4
> Am Dienstag, 5. Mai 2020, 22:14:09 CEST schrieb Alexander Grotewohl:
> > procvar:=@proc_bool; ?
> 
> Error: Incompatible types
> 
> > --
> > Alexander Grotewohl
> > https://dcclost.com
> > 
> > 
> > From: fpc-pascal  on behalf of
> > Rainer Stratmann  Sent: Tuesday, May 5, 2020,
> > 4:05 PM
> > To: FPC-Pascal users discussions
> > Subject: [fpc-pascal] Different behaviour between FPC 2.6.4 and FPC 3.0.4
> > 
> > Compiled with FPC 3.0.4 there is an access violation when executing
> > procvar; Compiled with FPC 2.6.4 it works for a long time.
> > 
> > Did I overlooked something?
> > 
> > Mode: MObjFPC
> > 
> > type
> > 
> >  t_funcboolean = function : boolean;
> > 
> > var
> > 
> >  procvar : t_funcboolean;
> > 
> > function proc_bool : t_funcboolean;
> > begin
> > end;
> > 
> > begin
> > 
> >  procvar := proc_bool;
> >  procvar; // -> access violation with FPC 3.0.4
> > 
> > ___
> > fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Different behaviour between FPC 2.6.4 and FPC 3.0.4

2020-05-05 Thread Rainer Stratmann
Am Dienstag, 5. Mai 2020, 22:14:09 CEST schrieb Alexander Grotewohl:
> procvar:=@proc_bool; ?

Error: Incompatible types

> --
> Alexander Grotewohl
> https://dcclost.com
> 
> 
> From: fpc-pascal  on behalf of
> Rainer Stratmann  Sent: Tuesday, May 5, 2020,
> 4:05 PM
> To: FPC-Pascal users discussions
> Subject: [fpc-pascal] Different behaviour between FPC 2.6.4 and FPC 3.0.4
> 
> Compiled with FPC 3.0.4 there is an access violation when executing procvar;
> Compiled with FPC 2.6.4 it works for a long time.
> 
> Did I overlooked something?
> 
> Mode: MObjFPC
> 
> type
>  t_funcboolean = function : boolean;
> var
>  procvar : t_funcboolean;
> 
> function proc_bool : t_funcboolean;
> begin
> end;
> 
> begin
>  procvar := proc_bool;
>  procvar; // -> access violation with FPC 3.0.4
> 
> 
> 
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Different behaviour between FPC 2.6.4 and FPC 3.0.4

2020-05-05 Thread Rainer Stratmann
Compiled with FPC 3.0.4 there is an access violation when executing procvar; 
Compiled with FPC 2.6.4 it works for a long time.

Did I overlooked something?

Mode: MObjFPC

type
 t_funcboolean = function : boolean;
var
 procvar : t_funcboolean;

function proc_bool : t_funcboolean;
begin
end;

begin
 procvar := proc_bool;
 procvar; // -> access violation with FPC 3.0.4




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] New release of MSEide.

2020-04-02 Thread Rainer Stratmann
Am Donnerstag, 2. April 2020, 20:23:07 CEST schrieb fredvs via fpc-pascal:
> Hello everybody.
> 
> Many thanks to fpc team that helped so much for that release (particularly
> Sven).
> 
> Have a lot of fun.
> 
> Fre;D

How long are you involved already in the MSEide project?


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpbind ipv6 version

2019-10-28 Thread Rainer Stratmann
On Sonntag, 27. Oktober 2019 10:32:11 CET Michael Van Canneyt wrote:
> On Sat, 26 Oct 2019, Rainer Stratmann wrote:
> > https://www.freepascal.org/docs-html/current/rtl/sockets/fpbind.html
> > 
> > Is there an example for IPV6?
> > 
> > function fpbind(
> > 
> >  s: cint;
> >  addrx: psockaddr;
> >  addrlen: TSockLen
> > 
> > ):cint;
> > 
> > I guess psockaddr is different in IPV6 version.
> 
> No, it does not have to be..
> The addrlen will differ of course. That's why it is there to begin with.
> Maybe an overload could be added, I would need to look into this to see if
> it is required.

I wrote an http server on my own. It works a long time already with IPv4.

For the IPV6 version I changed psockaddr to sockaddr_in6.
And the proper addrlen -> sizeof( sockaddr_in6 );
I discovered that shortly after my first question about this topic here in the 
mailinglist.
Additionally the socket protocol family was changed from PF_INET to PF_INET6 
when creating the socket.

Also I have to change fpaccept the same way as fpbind.

The server then worked properly with a localhost IPV6 request from a browser 
[::1]

FPC 2.6.4

> Michael.
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] fpbind ipv6 version

2019-10-26 Thread Rainer Stratmann
https://www.freepascal.org/docs-html/current/rtl/sockets/fpbind.html

Is there an example for IPV6?

function fpbind(
  s: cint;
  addrx: psockaddr;
  addrlen: TSockLen
):cint;

I guess psockaddr is different in IPV6 version.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] += property bug?

2019-08-15 Thread Rainer Stratmann
On Mittwoch, 14. August 2019 14:15:51 CEST Ryan Joseph wrote:
> > On Aug 14, 2019, at 12:33 PM, Rainer Stratmann
> >  wrote:
> > 
> > Didn't you know that Ryan?
> 
> Yes, of course, I use them all the time and it’s why I was defending them
> from their critics (which I still find hard to believe even exist).
> Anyways, they exist and can be disabled using the directive Sven mentioned.
> Everyone wins. :)

Even in your sentences you put (too) much in a small place.
I can hardly understand what you mean.
May by I am not so good in English language.

> Regards,
>   Ryan Joseph
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] += property bug?

2019-08-14 Thread Rainer Stratmann
On Mittwoch, 14. August 2019 18:24:40 CEST Michael Van Canneyt wrote:
> On Wed, 14 Aug 2019, Ryan Joseph wrote:
> >> On Aug 14, 2019, at 12:04 PM, Rainer Stratmann  wrote:
> >>> It’s so
> >>> intuitive that basically all languages have adopted the syntax.
> >> 
> >> That is not true
> > 
> > All languages I use have them: Pascal, C, PHP, C#, Swift, Python,
> > JavaScript. These are some of the most popular languages in the world
> > right now. You’re fighting a losing battle sir.
> I don't see what the issue is ?
> 
> You do have +=  and the like. They exist, since about as long as I can
> remember.

Didn't you know that Ryan?

> You just cannot use it on properties.
> 
> Properties have some other restrictions as well:
> 
> * You also cannot Use Inc() on integer properties,
> * or use Include()/Exclude() on set properties.
> * You also cannot do SomeRecordProp.X:=Y;
> * or pass them to functions that require var arguments.
> 
> And I'm probably forgetting some other limitations.
> 
> The += is just another one in the list of limitations of properties.
> 
> Basically any operation that requires an address is not allowed.
> That += is using an address is an implementation detail of the compiler.
> Same as Inc() or In/Exclude(). I don't know the exact reason for this
> limitation, but it's bound to be a good one, otherwise it would have been
> lifted a long time ago...
> 
> And if someone doesn't like these limitations of properties, (s)he can use
> fields. No-one abolished those, after all.
> 
> Michael.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] += property bug?

2019-08-14 Thread Rainer Stratmann
On Mittwoch, 14. August 2019 11:45:20 CEST Ryan Joseph wrote:
> > On Aug 14, 2019, at 11:41 AM, wkitt...@windstream.net wrote:
> > 
> > good reason?? because someone is too lazy to type 4 more characters? yes,
> > i'm counting the readability spaces which could easily be left out...
> yes, that’s exactly why. Programers got sick of wasting time typing
> redundant characters so they attacked the problem at the root.

I am so sick of typing all the characters...

No, your eyes get sick if you have to read C code.

If you had a real problem where there is no solution at the moment I could 
understand you. But there is no problem, and no one is preventing you from 
writing good and readable code.

> It’s so
> intuitive that basically all languages have adopted the syntax.

That is not true.

> I’m not
> saying you should but it’s going to  hurt Pascal if we ignore these kinds
> of trends.

Also not true.

> 
> Regards,
>   Ryan Joseph
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] += property bug?

2019-08-11 Thread Rainer Stratmann
On Sonntag, 11. August 2019 12:21:18 CEST Ryan Joseph wrote:
> > On Aug 11, 2019, at 11:41 AM, Sven Barth via fpc-pascal
> >  wrote:
> > 
> > This is forbidden by design.
> 
> Why? It makes sense it should resolve to: d.setter(d.getter + 10) but maybe
> there’s a problem?

For me it seems that you can solve the issue easily with existing 
technologies.
Moreover the code will be better to read and to handle in my opinion.
Otherwise your code will be likewise C code with much information in the 
smallest place. That is not good to handle in my opinion.
I have some experience with C code. It is not my preferred language.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions

2019-07-21 Thread Rainer Stratmann
On Dienstag, 16. April 2019 22:36:07 CEST Mattias Gaertner via fpc-pascal 
wrote:
> Packages / Install Packages
> Select anchordockingdsgn on the right side and click "Install
> selection".
> Then "Save and rebuild IDE".

Habe jetzt das ganz neue Debian 10 - mit apt-get install lazarus (2.0.0) - auf 
einem Rechner und es so wie oben beschrieben probiert.

Der Complier sagt: kann anchordockpgk nicht finden

Rainer
 
> Mattias
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Linphone wrapper

2019-05-29 Thread Rainer Stratmann
Is someone using Linphone?
I need a wrapper for the library.

https://www.linphone.org/technical-corner/liblinphone

Or is there another solution for automatic VoIP calls?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Translating c records

2019-04-24 Thread Rainer Stratmann
struct sockaddr_ll {
 unsigned short sll_family;   
 unsigned short sll_protocol; 
 intsll_ifindex;  
 unsigned short sll_hatype;   
 unsigned char  sll_pkttype;  
 unsigned char  sll_halen;
 unsigned char  sll_addr[8];  
 };


type
 sockaddr_ll = record
  sll_family : word;
  sll_protocol : word;
  sll_ifindex : integer;
  sll_hatype : word;
  sll_pkttype : byte;
  sll_halen : byte;
  sll_addr: array[ 0 .. 7 ] of byte;
 end;

Is this correct?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions

2019-04-17 Thread Rainer Stratmann
On Dienstag, 16. April 2019 22:36:07 CEST Mattias Gaertner via fpc-pascal 
wrote:
> On Tue, 16 Apr 2019 21:13:52 +0200
> 
> Rainer Stratmann  wrote:
> > On Dienstag, 16. April 2019 21:02:50 CEST Rainer Stratmann wrote:
> > > But how can I install/activate it.
> > 
> > I found an instruction, but I got an error:
> > 
> > lazarus.pp(1,1) Fatal: Kann anchordockingdsgn nicht finden verwendet
> > von Lazarus. Check if package AnchorDockingDsgn creates
> > anchordockingdsgn.ppu, check nothing deletes this file and check that
> > no two packages have access to the unit source..
> 
> What did you do?
> 
> Packages / Install Packages
> Select anchordockingdsgn on the right side and click "Install
> selection".
> Then "Save and rebuild IDE".

Yes.
I sent you an email to
nc-gaert...@netcologne.de
Did you receive the email?

 
> Mattias
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions

2019-04-16 Thread Rainer Stratmann
On Dienstag, 16. April 2019 13:07:33 CEST Ralf Quint wrote:
> But I still think that this should not be the default setting...

As you may have not seen while being busy with something else...
I repeat it for you.

On Dienstag, 16. April 2019 20:44:56 CEST Mattias Gaertner via fpc-pascal 
wrote:
> It is not a fixed docking. You can undock any window and place them on
> other screens. Or dock only some and place them on another screen.



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

Re: [fpc-pascal] Linux DRM (Direct Rendering Manager) porting (kernel mode setting)

2019-04-16 Thread Rainer Stratmann
The code below is now ported into pascal.
That took me about 2-3 weeks.

Anyone who is interested can write directly to me.
It's mainly for embedded projects writing directly into the framebuffer.

You can enquire and set the resolution of all possible connectors (monitor: 
for example vga, hdmi, dvi connector).
You get a mempointer to a framebuffer.
It is possible to have access to more than one connector at the same time if 
the mainboard or graphic card supports it.


On Donnerstag, 21. März 2019 23:41:08 CEST Rainer Stratmann wrote:
> Currently I am porting some C code from the Linux DRM Mode-Setting API to
> pascal. First in my own way. So that it is usable for me. But it would be
> possible to make a separate unit out of it, of course.
> 
> I could compile the modeset.c code with the Linux compiler. It runs well on
> Linux. It's a good assist to check the progress of the porting.
> 
> https://dvdhrm.wordpress.com/2012/09/13/linux-drm-mode-setting-api/
> 
> Also the library code has to be ported. That is not easy, but should be
> possible. About 1/3rd of the work is done, I guess.
> 
> May be someone is also interested in DRM and we can divide the work :-)
> 
> With DRM you can have access to all the possible video connectors on the
> mainboard. You can have access to the framebuffer directly for example. It
> is interesting for embedded devices, like I am working with.
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions

2019-04-16 Thread Rainer Stratmann
On Dienstag, 16. April 2019 21:02:50 CEST Rainer Stratmann wrote:
> But how can I install/activate it.

I found an instruction, but I got an error:

lazarus.pp(1,1) Fatal: Kann anchordockingdsgn nicht finden verwendet von 
Lazarus. Check if package AnchorDockingDsgn creates anchordockingdsgn.ppu, 
check nothing deletes this file and check that no two packages have access to 
the unit source..


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

Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions

2019-04-16 Thread Rainer Stratmann
On Dienstag, 16. April 2019 14:34:05 CEST Sven Barth via fpc-pascal wrote:
> You can install the AnchorDockingDsgn package and have all windows
> integrated (except for forms which need an additional package).

That sounds good for both use cases.

But how can I install/activate it.

I tried with apt-get install AnchorDockingDsgn
But that does not work.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions

2019-04-16 Thread Rainer Stratmann
On Dienstag, 16. April 2019 11:37:56 CEST Ralf Quint wrote:
> On 4/16/2019 4:46 AM, Rainer Stratmann wrote:

> Anyone who seriously develops software, specially desktop applications,
> is/should be using at least two (better 3 monitors).

That is completely new for me that the amount of monitors is an indication of 
how professional someone can write good software.

> And the "many"
> different windows allow easily to spread those out to those various
> screens as needed. One screen has the source code and associated
> windows, the second one the debugging windows, and the third one has the
> actually tested application screen.

For you that may makes sense.
But for me that seems like pretending who has the biggest car.

> 
> Something like this would be a major PITA with those stupid docked
> windows. That's only something that makes sense for someone who's
> tinkering along on a laptop or such...
> 
> Ralf
> 
> 
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions

2019-04-16 Thread Rainer Stratmann
On Dienstag, 16. April 2019 13:46:59 CEST Rainer Stratmann wrote:
> buttons of the main window. Also the output window could be one tab of the
> search window.

I mean search result window more precisely.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions

2019-04-16 Thread Rainer Stratmann
Are there plans to merge some windows?

Like here (best solution):
https://cdn.portableapps.com/GeanyPortable.png

Because I think it is no more up to date.
I don't know any other Software that uses so many windows across the whole 
desktop. It would be more userfriendly to merge at least the main window with 
the code window. So that on top of the code window there are the buttons of 
the main window. Also the output window could be one tab of the search window.

Very often I use the search dialog.

It would be way more userfriendly if the search word (for example) can be 
double clicked and then is transferred automatically in a field at the bottom 
of the code window.

Like here:
http://3.bp.blogspot.com/-4GQwMug5bzE/VgN5qaECs7I/EdM/4jPugE78oWw/
s1600/kate5.png

Or here:
http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/4726430_orig.jpg




On Dienstag, 16. April 2019 10:24:09 CEST Mattias Gaertner via fpc-pascal 
wrote:
> The Lazarus team is glad to announce the release of Lazarus 2.0.2.
> 
> This release was built with FPC 3.0.4.
> The previous release Lazarus 2.0.0 was built with FPC 3.0.4 as
> well.
> 
> Here is the list of changes for Lazarus and Free Pascal:
> http://wiki.lazarus.freepascal.org/Lazarus_2.0.0_release_notes
> http://wiki.lazarus.freepascal.org/User_Changes_3.0.4
> 
> Here is the list of fixes for Lazarus 2.0.x:
> http://wiki.freepascal.org/Lazarus_2.0_fixes_branch
> 
> The release is available for download on SourceForge:
> http://sourceforge.net/projects/lazarus/files/
> 
> Choose your CPU, OS, distro and then the "Lazarus 2.0.2" directory.
> 
> Checksums for the SourceForge files:
> http://www.lazarus-ide.org/index.php?page=checksums#2_0_2
> 
> Minimum requirements:
> 
> Windows:
>   2k, XP, Vista, 7, 8, 8.1 and 10, 32 or 64bit.
> 
> FreeBSD/Linux:
>   gtk 2.8 for gtk2, qt4.5 for qt, qt5.6 for qt5, 32 or 64bit.
> 
> Mac OS X:
>   10.5 to 10.12; Carbon (32bit), Cocoa (64bit, beta), qt and qt5 (32 or
>   64bit).
> 
> The svn tag is
> http://svn.freepascal.org/svn/lazarus/tags/lazarus_2_0_2
> 
> For people who are blocked by SF, the Lazarus releases from SourceForge
> are mirrored at: ftp://ftp.freepascal.org/pub/lazarus/releases/
> and later at (after some time for synchronization)
> http://mirrors.iwi.me/lazarus/
> 
> Mattias
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-15 Thread Rainer Stratmann
On Sonntag, 14. April 2019 21:35:43 CEST wkitt...@windstream.net wrote:
> On 4/14/19 7:28 AM, Rainer Stratmann wrote:
> > On Samstag, 13. April 2019 22:30:55 CEST Alexey Tor. wrote:
> >> E.g. i have a loop which test each s[i] char for several cases: 'a',
> >> 'b', 'c'.
> >> 
> >> for i:= 1 to length(s) do
> >> 
> >> if (s[i]='a') or (s[i]='b') or (s[i]='c') then ...
> >> 
> >> Can FPC optimize it so it only reads s[i] once (to register), not 3
> >> times?
> > 
> > You can optimise by yourself.
> > 
> > var
> > 
> >   c : char;
> >   l : longint;
> > 
> > begin
> > 
> >   l := length( s );
> >   for i := 1 to l do
> >   
> >c := s[ i ];
> >if ( c = 'a' ) or ( c = 'b' ) or ( c = 'c' ) then ...
> 
> this looks like it will read three times like the original instead of once
> like using the IN set operation... it is still stepping through each one of
> the comparison steps instead of just doing a set match...

It is at least better than reading s[ i ] at every compare operation.
Feel free to make more optimizations if there is a chance.
For example the IN operation.

if c in ['a', 'b', 'c'] then ...

You have to know the whole code to decide if it makes sense to drop the var c 
completely.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-14 Thread Rainer Stratmann
On Samstag, 13. April 2019 22:30:55 CEST Alexey Tor. wrote:
> E.g. i have a loop which test each s[i] char for several cases: 'a',
> 'b', 'c'.
> 
> for i:= 1 to length(s) do
> 
> if (s[i]='a') or (s[i]='b') or (s[i]='c') then ...
> 
> Can FPC optimize it so it only reads s[i] once (to register), not 3 times?

You can optimise by yourself.

var
 c : char;
 l : longint;

begin
 l := length( s );
 for i := 1 to l do
  c := s[ i ];
  if ( c = 'a' ) or ( c = 'b' ) or ( c = 'c' ) then ...

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

[fpc-pascal] Linux DRM (Direct Rendering Manager) porting

2019-03-21 Thread Rainer Stratmann
Currently I am porting some C code from the Linux DRM Mode-Setting API to 
pascal. First in my own way. So that it is usable for me. But it would be 
possible to make a separate unit out of it, of course.

I could compile the modeset.c code with the Linux compiler. It runs well on 
Linux. It's a good assist to check the progress of the porting.

https://dvdhrm.wordpress.com/2012/09/13/linux-drm-mode-setting-api/

Also the library code has to be ported. That is not easy, but should be 
possible. About 1/3rd of the work is done, I guess.

May be someone is also interested in DRM and we can divide the work :-)

With DRM you can have access to all the possible video connectors on the 
mainboard. You can have access to the framebuffer directly for example. It is 
interesting for embedded devices, like I am working with.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Compiling 32 bit software on Debian Linux 64 bit

2018-10-30 Thread Rainer Stratmann
On Dienstag, 30. Oktober 2018 12:25:04 CET Rainer Stratmann wrote:
> How is it possible to compile a 32 bit program on a 64 bit Debian Linux?
> 
> When I select i386 as the target cpu the message 'ppc 386 can't be executed'
> appears.
> 
> Is it possible to install ppc386 with an apt-get command?
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Does 
fpc-3.0.4.i386-linux.tar
makes it?

From here:
https://sourceforge.net/projects/freepascal/
?

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

[fpc-pascal] Compiling 32 bit software on Debian Linux 64 bit

2018-10-30 Thread Rainer Stratmann
How is it possible to compile a 32 bit program on a 64 bit Debian Linux?

When I select i386 as the target cpu the message 'ppc 386 can't be executed' 
appears.

Is it possible to install ppc386 with an apt-get command?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Searchable docs online

2018-07-05 Thread Rainer Stratmann
Is the server itself written in freepascal?
Or is it apache or nginx?

Am Donnerstag, 5. Juli 2018, 15:50:23 schrieb Michael Van Canneyt:
> Hello,
> 
> Given the questions of late, I have created a search page for the docs:
> 
> https://www.freepascal.org/docsearch/docsearch.html
> 
> This will search in the manuals, and in the reference documentation for the
> units.
> 
> There is ample room for improvement, but the page already works.
> 
> Things to improve:
> - Allow 'contains'
> - Allow 'minimum rank' (rank is the number of times a word appears in a
> page) - Allow to specify in which manual you want to search.
> - Integrate searching in the doc pages themselves.
> 
> The underlying mechanisms for this search are 100% FPC based:
> fpindexer, fcl-web, and the webpage logic is done using pas2js.
> (meaning you need to have Javascript enabled)
> 
> Feedback and comments welcome.
> 
> Michael.
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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

Re: [fpc-pascal] Default record fields

2018-06-22 Thread Rainer Stratmann
Am Freitag, 22. Juni 2018, 16:03:28 schrieb Marcos Douglas B. Santos:
> On Fri, Jun 22, 2018 at 12:59 PM, Ralf Quint  wrote:
> > On 6/22/2018 4:19 AM, Karoly Balogh (Charlie/SGR) wrote:
> >> Hi,
> >> 
> >> On Fri, 22 Jun 2018, Ryan Joseph wrote:
> >>> I want to do a pivot away from the macro stuff to ask another question.
> >>> Since I’ve wanted to contribute to the compiler for so long and I
> >>> finally have a little understanding I’d like to know if there’s anything
> >>> minor I could do, that isn’t offensive to the compiler team.
> >> 
> >> It's not about the compiler team. It's about the integrity of a
> >> programming language, which doesn't matter these days a lot, when all
> >> languages turned into a feature race to provide the same broken concepts,
> >> but with slightly different syntax. Nevermind. I sometimes do not even
> >> understand how people did stuff for 50 years without
> >> TObjectClassAdvancedTemplateGenericRecordRTTI...
> > 
> > +1
> > It's not (only/just) what "the compiler team" wants. There are people
> > actually using the compiler. For real life purposes.
> > And a lot of what people are proposing, over and over again, are solutions
> > for problems that nobody has (in real life)...
> 
> +1
> It is better to have a simple language with packages/libs to do the (real)
> job than a complex language that try doing anything that someone could
> imagine or want to do.
> 
Yes, you can already do almost everything you want with freepascal.
Keep it easy.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] AppImage

2018-01-16 Thread Rainer Stratmann
Am Dienstag, 16. Januar 2018, 22:41:34 schrieb Sven Barth via fpc-pascal:
> This won't work in the more diverse
> Linux world where users are more free to decide.

But if you take a closer look at this (diverse) that is some kind of pseudo 
free and decide.

It would be technical no such problem to make some compatibility between the 
distributions. I am not deep in the KDE and Gnome development, but I wonder 
why it is not possible to make compatibility between them. That prevents a 
progress which is long overdue. Instead of they are fighting against each other 
who has the better window manager.

Also it is not a lack of choice if you put for example two distributions in 
one and make it possible to behave either like distro1 or distro2 by a 
checkbox. Or better to make it behave like distro1 and distro2. I guess that 
would be also technical possible.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] AppImage

2018-01-16 Thread Rainer Stratmann
Am Dienstag, 16. Januar 2018, 19:41:38 schrieb Graeme Geldenhuys:
> On 2018-01-16 06:51, Sven Barth via fpc-pascal wrote:
> > So, yeah, I'm definitely skeptical about such approaches.
> 
> All valid points. But if it was such a big concern, then why was Apple
> happy to go with it. Maybe the concern is not so bad. As for bigger apps
> (due to bundled dependencies) That might have been a concern years
> back, but nobody seems to care now about large apps. Hell, even websites
> are now 5+MB per page downloads (massive JavaScript libraries, huge
> high-res images etc). View a few pages and you have downloaded some 50MB
> easily.

Yes.

This is a very understandable constructive propagation. Everyone who can think 
right, especially from the view of a user should say, yes it is easy and good.

And yes, memory is enough there today. Since some years already.

My way is always a separate directory with all in it and an entry application.

And the key is to try to generate as less dependencies as possible.

Better less functionallity but almost working and extensible than an 
obstructive dependency.

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

Re: [fpc-pascal] AppImage

2018-01-16 Thread Rainer Stratmann
Am Dienstag, 16. Januar 2018, 07:51:27 schrieb Sven Barth via fpc-pascal:
> Maybe because each app will have its own dependencies, thus duplicating
> code.
> Also if you have different versions of dependencies they might access
> shared global configuration in incompatible ways.
> Not to mention that if there is a (security) bug in one dependency you need
> to update all apps containing the bugged library instead of merely the
> library (that is if you can easily find out that an app contains that
> library).
> So, yeah, I'm definitely skeptical about such approaches.

For me the andvantage of the easy installation is higher.

You can leave the base Linux system as it is.

But if you want to install a hand full of special Apps you can do it fast.
If there is a security bug, then (easy) update your hand full of Apps.

If I make an App I do it always in a separate directory with minimum 
dependencies. So you have it easy and a have good overview of the needed app 
and data files.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] AppImage

2018-01-15 Thread Rainer Stratmann
Take a look at

https://appimage.org/

Is this possible for Freepascal and Lazarus?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] MSEide+MSEgui 4.6 for FPC 3.0.4

2017-11-29 Thread Rainer Stratmann
Am Mittwoch, 29. November 2017, 21:43:00 schrieb Marcos Douglas B. Santos:
> On Wed, Nov 29, 2017 at 9:35 PM, Rainer Stratmann
> 
> <rainerstratm...@t-online.de> wrote:
> > Am Mittwoch, 29. November 2017, 07:19:32 schrieb Martin Schreiber:
> >> What is missing
> >> in Free Pascal?
> > 
> > A userfriendly setup/install for every compile/cross compile scenario out
> > of the box.
> > 
> > Without the need for compiling fpc.
> > 
> > Without the need for an internet connection.
> 
> Have you already seen fpcup -> http://wiki.freepascal.org/fpcup ?
> 
yes
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] MSEide+MSEgui 4.6 for FPC 3.0.4

2017-11-29 Thread Rainer Stratmann
Am Mittwoch, 29. November 2017, 07:19:32 schrieb Martin Schreiber:
> What is missing
> in Free Pascal?

A userfriendly setup/install for every compile/cross compile scenario out of 
the box.

Without the need for compiling fpc.

Without the need for an internet connection.

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

Re: [fpc-pascal] FPC for AVR

2017-06-15 Thread Rainer Stratmann
Am Donnerstag, 15. Juni 2017, 08:34:49 schrieb Mark Morgan Lloyd:
> On 14/06/17 20:15, Brian wrote:
> > mikroPascal (not free) supports AVR and many other chips.
> > https://shop.mikroe.com/compilers/mikropascal/avr-electronic-license
> > Brian
> 
> Yes, but I was asking about the FPC situation. I'm desperately resisting
> local pressure to write code that might end up non-trivial in C/C++.

As far as I know there is not ab FPC solution by now.

I have Mikropascal for AVR and it works good.
All the projects I do with with it.

They also have an ARM Pascal compiler which works fine.

4k Byte code for AVR and 8k Byte code for ARM is free.
You can download it for free. I have a USB dongle Version here.

> 
> --
> Mark Morgan Lloyd
> markMLl .AT. telemetry.co .DOT. uk
> 
> [Opinions above are the author's, not those of his employers or colleagues]
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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

[fpc-pascal] https how does it work

2017-02-16 Thread Rainer Stratmann
How does httpy work, what is needed?

TLS/SSL library?

A http webserver without encryption I programed already on my own and wanted 
to integrate https.

Is there any example code of https?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Socket pair

2016-10-03 Thread Rainer Stratmann
There is fpaccept

http://www.freepascal.org/docs-html/rtl/sockets/fpaccept.html

But in the example accept is used ... (?!)


Am Montag, 3. Oktober 2016, 10:27:55 schrieb Santiago A.:
> I've seen that "accept" functions with socket pairs are deprecated. And
> fpsocketpair returns always -1.
> 
> How do you get the in and out streams when a server  accepts a new
> client connection? I have seen some server examples, like isocksrv.pp,
> but only read from client and send nothing back to client.
> 
> can anyone point and example with pair of sockets or bidirectional
> connection communication?
> 
> 
> --
> Saludos
> Santiago A.
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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


Re: [fpc-pascal] Test for valid ip address

2016-07-28 Thread Rainer Stratmann
Am Donnerstag, 28. Juli 2016, 10:26:32 schrieb Jonas Maebe:
> On 28/07/16 10:14, Koenraad Lelong wrote:
> > I need a way to test if an string containing an ipv4-address is really
> > an ipv4-address.
> > I tried
> > tmpAddress:=HostAddrToStr(StrToHostAddr(IPAddressStr));
> > writeln(tmpAddress);
> > 
> >  if (tmpAddress='0.0.0.0') then
> >  
> >   begin
> >   
> >writeln('Error in IP-address');
> >IPAddressStr:=tmpAddress;
> >   
> >   end;
> > 
> > When I enter 192.168.185.297 (i.e. not a valid ipv4 address) in
> > IPAddressStr I get
> > 192.168.185.41
> > not the expected error-message.
> 
> You can add a multiple of 256 to any octet of an IPv4 address in most
> programs. Try it in your browser, it will probably also work.

In Firefox 45.2.0 on Linux it does not work.
It is confusing anyway.
 
> 
> Jonas
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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


Re: [fpc-pascal] Test for valid ip address

2016-07-28 Thread Rainer Stratmann
The IP-Adress is a dword, but you can change, that it fits for you.


function str_getval( str : shortstring ) : longint;
var cod : longint;
begin
 val( str , result , cod );
end;

function ip_from_string( ipstr : shortstring ; out error : boolean ) : dword;
var
 c : char;
 ipn , pointanz : longint;
 x : longint;
 pstr : shortstring;
 ip : dword;


 procedure add_ip;
 begin
  ipn := str_getval( pstr );
  if ( ipn > 255 ) or ( pstr = '' ) then error := true;
  ip := ip shl 8;
  ip := ip or ipn;
  pstr := '';
 end;

begin
 ip := 0;
 pstr := '';
 error := false;
 pointanz := 0;
 for x := 1 to length( ipstr ) do begin
  c := ipstr[ x ];
  case c of
   '0'..'9' : pstr := pstr + c;
   '.' : begin
inc( pointanz );
add_ip;
   end;
   else error := true;
  end;
 end;
 add_ip;
 if pointanz <> 3 then error := true;
 if error then result := 0
  else result := ip;
end;



Am Donnerstag, 28. Juli 2016, 10:14:10 schrieb Koenraad Lelong:
> Hi,
> 
> I need a way to test if an string containing an ipv4-address is really
> an ipv4-address.
> I tried
> tmpAddress:=HostAddrToStr(StrToHostAddr(IPAddressStr));
> writeln(tmpAddress);
>   if (tmpAddress='0.0.0.0') then
>begin
> writeln('Error in IP-address');
> IPAddressStr:=tmpAddress;
>end;
> When I enter 192.168.185.297 (i.e. not a valid ipv4 address) in
> IPAddressStr I get
> 192.168.185.41
> not the expected error-message.
> 
> According to the rtl-manual :
> 
> function StrToHostAddr(IP: AnsiString) : in_addr
> Description: StrToHostAddr converts the string representation in IP to a
> host address and returns the host
> address.
> Errors: On error, the host address is filled with zeroes.
> 
> I would think that converting those zeroes to a host-address would yield
> 0.0.0.0.
> 
> Am I missing something ?
> Is there a better way, without using some other network-library ?
> 
> Koenraad.
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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


[fpc-pascal] EBusError

2016-07-26 Thread Rainer Stratmann
An unhandled exception occured at $08113310 :
EBusError : Bus error or misaligned data access
 $08113310
 $08052EF3
 $08078A3E
 $080540B0
 $08054D96
 $080551D1
 $08055915

Is it likely that there is a problem with my Freepascal program or is it also 
possible that Linux or the Mainboard causes the error?

I found several things related to Freepascal when searching for EBusError.

Is it possible to see more if Debug Information is switched on?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Maximum of memory which can be used by single program in 32 bit Windows

2016-05-19 Thread Rainer Stratmann

Is there a different behaviour on linux?

I guess there is no limit...(!?)


Am Donnerstag, 19. Mai 2016, 08:46:57 schrieb LacaK:
> >> another question: is there any limit in FPC, which causes that only cca
> >> 1GB of memory can be used by FPC ?
> > 
> > No, but there is one that limits to 2GB.
> 
> Yes
> 
> > With {$peflags $20} in the main file that is increasable to 3GB
> > (reportedly 4GB for 32-bits apps under 64-bit windows, but I never tested
> > that)
> 
> Wow I never heared about such option.
> This are my results:
> (compiled application is Win 32 bit)
> 
> Before I have used this flag:
>Win7 32 bit with 4GB RAM: Out of memory at approx. 1 GB
>Win7 64 bit with 4GB RAM: Out of memory at approx. 1 GB
> 
> After I have used this flag:
>Win7 32 bit with 4GB RAM: Out of memory at 1 GB (no difference)
>Win7 64 bit with 4GB RAM: Success! (application consumes approx 1.8
> GB RAM, 1GB remains free)
> 
> Strange, does not ?
> Why I still encounter 1 GB limit and not 2 GB without {$setpeflag $20} ?
> Why on Win32 I still get Out of memory also with {$setpeflag $20} , but
> not on Win64 ?
> Take into account, that both OSes have 4GB RAM and application is same.
> 
> According to
> https://msdn.microsoft.com/en-us/library/windows/desktop/aa366778%28v=vs.85%
> 29.aspx it should be 2GB on 32bit and 4GB on 64bit Windows with
> *IMAGE_FILE_LARGE_ADDRESS_AWARE*
> 
> -Laco.
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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


Re: [fpc-pascal] Build in a C compiler

2016-04-20 Thread Rainer Stratmann
Am Mittwoch, 20. April 2016, 12:40:19 schrieb Mark Morgan Lloyd:
> > http://www.mikroe.com/compilers
> 
> If you want to believe that BASIC- as originally implemented- and ALGOL
> are related then go ahead and do so. But the politest thing I can say is
> that it doesn't make you look particularly well-informed.

You can go to the company and say poliltely to them that they are not well 
informed. I don't know if they take you serious.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Build in a C compiler

2016-04-20 Thread Rainer Stratmann
Am Mittwoch, 20. April 2016, 07:05:10 schrieb Mark Morgan Lloyd:
> No. Pascal and ALGOL are closely related, C and ALGOL are closely
> related. Pascal and C are not so closely related.

As you can see here Pascal, C, and Basic are very close related.

http://www.mikroe.com/compilers
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Build in a C compiler

2016-04-19 Thread Rainer Stratmann
That would be great.

It is not that difficult.

{ = begin
} = end

and the other stuff is quite similar.

Pascal and C are close related.

It could be made with a compiler switch to determine if the compiler is in the 
Pascal or in the C compiling mode.

No more need to translate (huge amount of) C code. :-)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Lazarus vs MSEgui

2016-04-08 Thread Rainer Stratmann
con of mside why I don't use it:

The behaviour of the cursor on the end of the line. You cannot go behind the 
line as it is usual in almost every other editor. Martin says it is difficult 
to 
integrate which I find hard to understand. That behaviour of the cursor 
confuses me. The other editors are smarter in that way. And the editor is the 
most important thing you use when programming.


Am Freitag, 8. April 2016, 11:08:41 schrieb Santiago A.:
> I know it is a dangerous question that can easily turn into a  holly
> war, flame or whatever. But here it is.
> 
> I have only used Lazarus or a general editor (usually Jedit, geany).
> Time ago I checked a little MSEgui and, well, I didn't go for it.
> In MSEgui I found fonts small and interface not very nice. Beside I
> found it a little confusing. Later I found that it could be compiled to
> make fonts bigger etc.
> 
> The honest reality is that I didn't devote much time to evaluate it.
> That's the problem of frameworks: when you learn one you get a little
> married with it, there are always complains and quirks, but before
> divorce you want to be sure that where you are moving to is better that
> what you have now. Unfortunately, getting the pros and cons requires
> working with it some time.
> 
> The first pro of MSEgui is that it is light.
> In fact, That is the main pro of any thing that is not lazarus. No just
> because it's lighter but because lighter usually means less complex and
> less bugs.
> 
> Cons. The most important. It looks like Lazarus has more developers, so
> may be a better decision for the long term.
> The second is the RAD. The immediate two directions updates, from GUI to
> source and from source to GUI, is very handy.
> 
> Any body has experience in both (or another IDE for FPC) and has his two
> cents?
> 
> By the way, has anybody managed to debug strings.text or any property
> with a getter?
> 
> 
> --
> Saludos
> 
> Santi
> s...@ciberpiula.net
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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


Re: [fpc-pascal] Primitive Record Wrappers

2016-03-01 Thread Rainer Stratmann
 On Wednesday 17 February 2016 18:40:52 you wrote:
> Hello list,
> 
> In some situations, would be very interesting to determine whether the
> value of a primitive variable is initialized or not. For example, fields in
> database records can contain null values. By implementing an ORM, it would
> be interesting to represent these null values in the properties of objects.
> 
> Java has the so called Primitives Class Wrappers, where each primitive type
> (int, boolean ...) has a corresponding wrapper class (Integer, Boolean
> ...). By using class wrappers you can represent null values in primitive
> types through null class instances references.
> 
> Using class wrappers in FPC is not feasible due to memory management issues
> (the programmer needs to worry about the lifetime of the instances and free
> the instances manually).
> 
> Perhaps, a solution in FPC would be using primitive record wrappers with
> custom records operators.
> 
> What do you think about it? Is there any other solution?
> 
> Regards 

I did not read everything. But it seems, that you want to have a function you 
also can program by yourself.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] shell script with root rights and automatic password

2015-12-07 Thread Rainer Stratmann
 On Monday 07 December 2015 08:38:28 you wrote:
> Rainer Stratmann wrote:
> > What works is an entry in the sudoers file.
> > And then the program/script you can call with root rights.
> 
> I hope this is for something that will only ever run on your own
> machine, because unless you take a lot of precautions (hardcoding a set
> of *absolute* paths to scripts that may be executed this way like
> Michael mentioned can help, but only if you can guarantee none of these
> locations can be overwritten, symlinked to somewhere else or substituted
> through mounting), this is a security disaster waiting to happen.

I am aware of some security stuff. And I asked myself often to do more 
security. For example disabling ssh on the machine. And some more.

But in some cases I need root acess. The location is secret and is deleted 
after the call. That's all I can do so far.

Only this application runs on the machine.

With 'setuid binary' I am not familiar.

> A lot of security holes in various Unix-like OSes happen through abuse
> of setuid helpers or helper programs executed as root. If you really
> need to do something as root, having a small setuid binary that can only
> do this one thing is much safer than invoking a general purpose shell
> that can do anything. You can find a very basic overview of some issues
> at
> https://developer.apple.com/library/mac/documentation/OpenSource/Conceptual
> /ShellScripting/ShellScriptSecurity/ShellScriptSecurity.html .
> 
> If everything mentioned there isn't completely obvious to you, please do
> not distribute any program that invokes shell scripts as root before you
> familiarise yourself very thoroughly with security at the Unix/shell
> level. And even if it is, ask yourself whether there is no safer way to
> achieve the same results.
> 
> 
> Jonas
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] shell script with root rights and automatic password

2015-12-06 Thread Rainer Stratmann
How to do this?

I would like to run a script with root rights from an application.
The password should be transferred automatically.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] shell script with root rights and automatic password

2015-12-06 Thread Rainer Stratmann
 On Sunday 06 December 2015 19:15:45 you wrote:
> On So, 2015-12-06 at 17:20 +0100, Rainer Stratmann wrote:
> > How to do this?
> > 
> > I would like to run a script with root rights from an application.
> > The password should be transferred automatically.
> 
> Others told that unix doesn't allow skripts run as root.

That seens to be true. Nothing found about that.

What works is an entry in the sudoers file.
And then the program/script you can call with root rights.
 
> For your task sudo may help. With it you allow the user (or group) in
> question to run programs with root rights, but they have to identify
> with their own password. Lowering security risk ... 

What do you mean exactly with "with their own password"?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] MSEide+MSEgui 4.0beta1 for FPC 3.0

2015-10-02 Thread Rainer Stratmann
Is it possible now to go behind the last character with the cursor?

code abcdefg[c]

[c] = cursor



 On Friday 02 October 2015 10:53:13 you wrote:
> Hi,
> 
> MSEide+MSEgui 4.0beta1 for FPC 3.0 is ready for testing:
> http://mseide-msegui.sourceforge.net/pics/mseide_4_0.png
> http://sourceforge.net/projects/mseide-msegui/files/mseide-msegui/4.0beta1/
> 
> There are also new versions for MSEgit, MSEspice and MSErun:
> http://sourceforge.net/projects/mseuniverse/files/
> 
> Martin
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Unit crt

2015-09-23 Thread Rainer Stratmann
 On Wednesday 23 September 2015 13:19:28 you wrote:
> Rainer Stratmann wrote on Wed, 23 Sep 2015:
> > Does an example exist to turn off (and on) the rawmode?
> 
> You posted the routine to do that yourself in the first mail of this
> thread (the last one).

Ok, I guess the ONOCR flag in c_oflag bits is responsible for supressing CR.

http://svn.freepascal.org/svn/fpc/tags/release_2_6_4/rtl/linux/termios.inc
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Unit crt

2015-09-23 Thread Rainer Stratmann
 On Wednesday 23 September 2015 12:05:43 you wrote:
> In our previous episode, Rainer Stratmann said:
> > Does it have something to do with the output of Linux commands?
> 
> Yes. In raw mode cr and lf are separate. so suddenly your lf only advances
> to the next line, but doesn't reset the carriage to the first column.
> 
> Use TProcess to capture the command output and add #13#10 or turn off
> rawmode before executing and on again after (like the textmode IDE does)
> 
Does an example exist to turn off (and on) the rawmode?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Unit crt

2015-09-23 Thread Rainer Stratmann
 On Wednesday 23 September 2015 13:19:28 you wrote:
> Rainer Stratmann wrote on Wed, 23 Sep 2015:
> > Does an example exist to turn off (and on) the rawmode?
> 
> You posted the routine to do that yourself in the first mail of this
> thread (the last one).
> 
http://man7.org/linux/man-pages/man3/termios.3.html
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Unit crt

2015-09-23 Thread Rainer Stratmann
 On Wednesday 23 September 2015 18:24:54 you wrote:
> On 23/09/15 15:06, Rainer Stratmann wrote:
> >   On Wednesday 23 September 2015 13:19:28 you wrote:
> >> >Rainer Stratmann wrote on Wed, 23 Sep 2015:
> >>> > >Does an example exist to turn off (and on) the rawmode?
> >> >
> >> >You posted the routine to do that yourself in the first mail of this
> >> >thread (the last one).
> > 
> > There is not enough information available at the moment to me to do so.
> > 
> > I need the information what CFMakeRaw(Tio) does. I can not find the
> > source.
> 
> cfmakeraw is a C routine that is implemented in a C library.
> 
> However, you can just call SetRawMode(false) before you want the output
> to be "normal" (and in the process prevent the crt unit from functioning
> correctly) and call SetRawMode(true) when you want to use the crt unit's
> functionality again.

That would be good, but SetRawMode() is not in the interface section.

I am confident to get solution soon. It is already good to know where to work 
on. Thanks. May be I will post the solution here.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Unit crt

2015-09-23 Thread Rainer Stratmann
 On Wednesday 23 September 2015 13:19:28 you wrote:
> Rainer Stratmann wrote on Wed, 23 Sep 2015:
> > Does an example exist to turn off (and on) the rawmode?
> 
> You posted the routine to do that yourself in the first mail of this
> thread (the last one).

There is not enough information available at the moment to me to do so.

I need the information what CFMakeRaw(Tio) does. I can not find the source.

Which bit is responsible for surpressing the cr output?

Is this bit in c_iflag, c_oflag, c_lflag, or c_cflag?

Who can help?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Unit crt

2015-09-23 Thread Rainer Stratmann
 On Wednesday 23 September 2015 22:40:32 you wrote:
> What means CRT for ? :)

https://en.wikipedia.org/wiki/Cathode_ray_tube
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Unit crt

2015-09-23 Thread Rainer Stratmann

What does SetRawMode do?




var
  OldIO : termio.TermIos;
  inputRaw, outputRaw: boolean;

procedure saveRawSettings(const tio: termio.termios);
Begin
  with tio do
   begin
 inputRaw :=
   ((c_iflag and (IGNBRK or BRKINT or PARMRK or ISTRIP or
INLCR or IGNCR or ICRNL or IXON)) = 0) and
   ((c_lflag and (ECHO or ECHONL or ICANON or ISIG or IEXTEN)) = 0);
 outPutRaw :=
   ((c_oflag and OPOST) = 0) and
   ((c_cflag and (CSIZE or PARENB)) = 0) and
   ((c_cflag and CS8) <> 0);
   end;
end;

procedure restoreRawSettings(tio: termio.termios);
begin
  with tio do
begin
  if inputRaw then
begin
  c_iflag := c_iflag and (not (IGNBRK or BRKINT or PARMRK or ISTRIP or
INLCR or IGNCR or ICRNL or IXON));
  c_lflag := c_lflag and
(not (ECHO or ECHONL or ICANON or ISIG or IEXTEN));
   end;
 if outPutRaw then
   begin
 c_oflag := c_oflag and not(OPOST);
 c_cflag := c_cflag and not(CSIZE or PARENB) or CS8;
   end;
   end;
end;


Procedure SetRawMode(b:boolean);
Var
  Tio : Termios;
Begin
  if b then
   begin
 TCGetAttr(1,Tio);
 SaveRawSettings(Tio);
 OldIO:=Tio;
 CFMakeRaw(Tio);
   end
  else
   begin
 RestoreRawSettings(OldIO);
 Tio:=OldIO;
   end;
  TCSetAttr(1,TCSANOW,Tio);
End;

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


Re: [fpc-pascal] Unit crt

2015-09-23 Thread Rainer Stratmann
Does it have something to do with the output of Linux commands?

Now the outputs are:

Message 1
 Message 2
  Message 3

How is it possible to get the normal behaviour?

Message 1
Message 2
Message 3


 On Wednesday 23 September 2015 11:46:15 you wrote:
> On Tue, 22 Sep 2015, Rainer Stratmann wrote:
> > What does SetRawMode do?
> 
> puts the terminal in RAW mode.
> This disables usual terminal tricks such as translating CTRL-C to SIGINT
> etc.
> 
> A terminal does quite some things 'behind your back', which are not
> desirable for the CRT unit.
> 
> Michael.
> 
> > var
> > 
> >  OldIO : termio.TermIos;
> >  inputRaw, outputRaw: boolean;
> > 
> > procedure saveRawSettings(const tio: termio.termios);
> > Begin
> > 
> >  with tio do
> >  
> >   begin
> >   
> > inputRaw :=
> > 
> >   ((c_iflag and (IGNBRK or BRKINT or PARMRK or ISTRIP or
> >   
> >INLCR or IGNCR or ICRNL or IXON)) = 0) and
> >   
> >   ((c_lflag and (ECHO or ECHONL or ICANON or ISIG or IEXTEN)) = 0);
> > 
> > outPutRaw :=
> > 
> >   ((c_oflag and OPOST) = 0) and
> >   ((c_cflag and (CSIZE or PARENB)) = 0) and
> >   ((c_cflag and CS8) <> 0);
> >   
> >   end;
> > 
> > end;
> > 
> > procedure restoreRawSettings(tio: termio.termios);
> > begin
> > 
> >  with tio do
> >  
> >begin
> >
> >  if inputRaw then
> >  
> >begin
> >
> >  c_iflag := c_iflag and (not (IGNBRK or BRKINT or PARMRK or
> >  ISTRIP or
> >  
> >INLCR or IGNCR or ICRNL or IXON));
> >  
> >  c_lflag := c_lflag and
> >  
> >(not (ECHO or ECHONL or ICANON or ISIG or IEXTEN));
> >   
> >   end;
> > 
> > if outPutRaw then
> > 
> >   begin
> >   
> > c_oflag := c_oflag and not(OPOST);
> > c_cflag := c_cflag and not(CSIZE or PARENB) or CS8;
> >   
> >   end;
> >   
> >   end;
> > 
> > end;
> > 
> > 
> > Procedure SetRawMode(b:boolean);
> > Var
> > 
> >  Tio : Termios;
> > 
> > Begin
> > 
> >  if b then
> >  
> >   begin
> >   
> > TCGetAttr(1,Tio);
> > SaveRawSettings(Tio);
> > OldIO:=Tio;
> > CFMakeRaw(Tio);
> >   
> >   end
> >  
> >  else
> >  
> >   begin
> >   
> > RestoreRawSettings(OldIO);
> > Tio:=OldIO;
> >   
> >   end;
> >  
> >  TCSetAttr(1,TCSANOW,Tio);
> > 
> > End;
> > 
> > ___
> > fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Release of Lazarus 1.4

2015-04-22 Thread Rainer Stratmann
Are there screenshots?
Is it with the new layout, one Window only?

 On Wednesday 22 April 2015 11:07:47 you wrote:
 The Lazarus team is glad to announce the release of Lazarus 1.4.
 
 This release was built with FPC 2.6.4, same as the previous
 release Lazarus 1.2.6.
 
 Here is the list of changes for Lazarus and Free Pascal:
 http://wiki.lazarus.freepascal.org/Lazarus_1.4.0_release_notes
 http://wiki.lazarus.freepascal.org/User_Changes_2.6.4
 
 The release is available for download on SourceForge:
 http://sourceforge.net/projects/lazarus/files/
 
 Choose your CPU, OS, distro and then the Lazarus 1.4 directory.
 Windows x64 users: please use the 32 bit installer if possible. See
 http://wiki.lazarus.freepascal.org/Windows_Programming_Tips#FPC_2.6.x.2FLaz
 arus_warning_.28Missing_support_for_SEH.29 for more details.
 
 Minimum requirements:
 Windows:   98, 2k, XP, Vista, 7, 32 or 64bit.
On 64bit it is recommended to use the 32bit IDE.
Win98 IDE needs building with flag -dWIN9XPLATFORM.
 FreeBSD/Linux: gtk 2.8 or qt4.5, 32 or 64bit.
 Mac OS X:  10.5 to 10.10, 10.9+ debugging requires -gw,
LCL only 32bit, non LCL apps can be 64bit.
 
 The svn tag is
 http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_4
 
 For people who are blocked by SF, the Lazarus releases from SourceForge
 are mirrored at:
 ftp://freepascal.dfmk.hu/pub/lazarus/releases/
 and later at (after some time for synchronization)
 http://michael-ep3.physik.uni-halle.de/Lazarus/releases/
 and
 http://mirrors.iwi.me/lazarus/
 
 
 Mattias
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Debug information

2015-01-14 Thread Rainer Stratmann
Linux Platform.

In the past there was a discussion about it already.

It may has to do with dynamic loaded library?

 On Tuesday 13 January 2015 16:32:37 you wrote:
 On 13 Jan 2015, at 16:14, Martin Frb wrote:
  On 13/01/2015 14:40, Rainer Stratmann wrote:
  Can not get debug information
  
  -g -gl -gw
  
  switched on
  
  but no further information (line nr) is displayed when an error
  occured.
  
  -gl  has a feature it prints the stack info, until it finds an
  address for which there is no stack info (e.g. in the rtl, if the
  rtl was not compiled with info).
 
 No, it only stops printing line info for both the current and all
 future backtraces if an error occurs during the reading/decoding of
 the line information. If no line info is found for a particular
 address, nothing special happens.
 
 However, -gl is not fully functional on platforms. E.g., it doesn't
 work for DWARF on (Mac) OS X.
 
 
 Jonas
 
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Debug information

2015-01-13 Thread Rainer Stratmann
Can not get debug information

-g -gl -gw 

switched on

but no further information (line nr) is displayed when an error occured.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linux, keypressed, readkey

2014-12-23 Thread Rainer Stratmann
 On Sunday 21 December 2014 07:26:42 you wrote:
  I downloaded the sources, but can not find the crt sources.
 
 fpsrc/rtl/linux ?
 
 latest stable:
 http://svn.freepascal.org/svn/fpc/tags/release_2_6_4/rtl/unix/crt.pp
 trunk:
 http://svn.freepascal.org/svn/fpc/trunk/packages/rtl-console/src/unix/crt.p
 p

Thanks!
 
 
 
 --
 View this message in context:
 http://free-pascal-general.1045716.n5.nabble.com/Linux-keypressed-readkey-
 tp5720638p5720660.html Sent from the Free Pascal - General mailing list
 archive at Nabble.com. ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] unit crt linux CR LF

2014-12-20 Thread Rainer Stratmann
When using the crt unit the CR LF is not working properly as I understand.

Is it possible to change this behaviour?
So that the CR LF is working?
For examlpe when displaying file contents with linux command cat.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Size of a partition

2014-12-19 Thread Rainer Stratmann
 On Thursday 18 December 2014 22:49:08 you wrote:
 On 12/18/14, Rainer Stratmann rainerstratm...@t-online.de wrote:
  How to get the total size of an unmounted partition in Linux?
 
 Can you use the info at
 http://serverfault.com/questions/190685/whats-the-best-way-to-get-info-abou
 t-currently-unmounted-drives ?
 
 Just googled you question ;-)

Thanks, it is may interesting.
Better would be a syscall.
 
 You can run these commands and parse the output.
 
 Bart
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Linux, keypressed, readkey

2014-12-19 Thread Rainer Stratmann
Is it possible to do

keypressed and readkey

directly with a systemcall in linux without unit crt?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


  1   2   3   4   5   >