FreeBSD Programming Tips
From Lazarus wiki
│ English (en) │
Note: Work in Progress
FreeBSD Programming Tips
Other Interfaces
- Lazarus known issues (things that will never be fixed) - A list of interface compatibility issues
- Win32/64 Interface - The Windows API (formerly Win32 API) interface for Windows 95/98/Me/2000/XP/Vista/10, but not CE
- Windows CE Interface - For Pocket PC and Smartphones
- Carbon Interface - The Carbon 32 bit interface for macOS (deprecated; removed from macOS 10.15)
- Cocoa Interface - The Cocoa 64 bit interface for macOS
- Qt Interface - The Qt4 interface for Unixes, macOS, Windows, and Linux-based PDAs
- Qt5 Interface - The Qt5 interface for Unixes, macOS, Windows, and Linux-based PDAs
- GTK1 Interface - The gtk1 interface for Unixes, macOS (X11), Windows
- GTK2 Interface - The gtk2 interface for Unixes, macOS (X11), Windows
- GTK3 Interface - The gtk3 interface for Unixes, macOS (X11), Windows
- fpGUI Interface - Based on the fpGUI library, which is a cross-platform toolkit completely written in Object Pascal
- Custom Drawn Interface - A cross-platform LCL backend written completely in Object Pascal inside Lazarus. The Lazarus interface to Android.
Platform specific Tips
- Android Programming - For Android smartphones and tablets
- iPhone/iPod development - About using Objective Pascal to develop iOS applications
- FreeBSD Programming Tips - FreeBSD programming tips
- Linux Programming Tips - How to execute particular programming tasks in Linux
- macOS Programming Tips - Lazarus tips, useful tools, Unix commands, and more...
- WinCE Programming Tips - Using the telephone API, sending SMSes, and more...
- Windows Programming Tips - Desktop Windows programming tips
Interfaces Development Articles
- Adding a new interface - How to add a new widget set interface
- Carbon interface internals - If you want to help improving the Carbon interface
- Cocoa Internals - Some info about the inner workings of the Cocoa widget set
- LCL Defines - Choosing the right options to recompile LCL
- LCL Internals - Some info about the inner workings of the LCL
- Windows CE Development Notes - For Pocket PC and Smartphones
Configuration Files
Refer to the Multiplatform Programming Guide Configuration files section.
Making a Beep
As SysUtils.Beep
has no effect on FreeBSD, I looked around for a way to make a beep and found nothing useful. So, I reinvented the wheel as follows:
{$IFDEF FREEBSD}
procedure FBSDbeep;
var
BProcess: TProcess;
begin
BProcess:= TProcess.Create(nil);
BProcess.CommandLine := 'sh -c "echo xxxxxxx > /dev/dsp"';
BProcess.Execute;
BProcess.Free;
end;
{$ENDIF}
Note: /dev/dsp will automatically reroute to the sound device's correct device node (eg /dev/dsp0.0) using the dynamic devfs(5) clone handler.
Qualifications
- Ok, it's more of a burp than a beep, but it serves the purpose. If you're really fussy, you could send a real .wav file to /dev/dsp and play any musical note(s) you desire.
- If FreeBSD is using a GENERIC kernel, it will work.
- If FreeBSD is using a custom kernel and it's a desktop system, then it will most probably work because who doesn't want sound on their desktop system.
- If FreeBSD is using a custom kernel and is running on a server, it may not work. I don't see this as a significant defect in user applications which is its use case for my purposes.
Using HTTPS
Placeholder. Content to come.