Commit graph

109 commits

Author SHA1 Message Date
gambas
3d956c269c '_read' and '_write' are two new special methods that allow to make any object serializable by the READ and WRITE instructions.
[INTERPRETER]
* NEW: '_read' and '_write' are two new special methods that allow to make any object serializable by the READ and WRITE instructions.
* NEW: Rename macro that convert a Gambas stream object to the internal stream structure and add a macro that does the reverse conversion.
2019-12-21 17:03:42 +01:00
gambas
a0bcf85bd4 Active file descriptor watches and active timers are now automatically transferred to the component declaring a custom event loop.
[INTERPRETER]
* BUG: Active file descriptor watches and active timers are now automatically transferred to the component declaring a custom event loop. Consequently, a process started before the declaration of the event loop will have its termination signal correctly catched.
* NEW: Use waitpid() instead of wait4().

[GB.GTK]
* BUG: Declare the event loop hook last so that active file descriptor watches and active transfer are automatically transferred.

[GB.GTK3]
* BUG: Declare the event loop hook last so that active file descriptor watches and active transfer are automatically transferred.

[GB.QT4]
* BUG: Declare the event loop hook last so that active file descriptor watches and active transfer are automatically transferred.

[GB.QT5]
* BUG: Declare the event loop hook last so that active file descriptor watches and active transfer are automatically transferred.
2019-03-12 03:46:30 +01:00
gambas
3f7095bbd9 Run JIT compilation in the background to make programs start faster.
[INTERPRETER]
* OPT: JIT compilation is run in two steps.

[GB.JIT]
* OPT: Run JIT compilation in the background.
* NEW: JIT.Debug is a new property that allows to enable JIT debugging messages at runtime.
2019-03-11 16:34:50 +01:00
gambas
baaf962ab0 JIT now handles "no return value" errors correctly.
[INTERPRETER]
* BUG: Process.Wait() now handles error output correctly.

[GB.JIT]
* BUG: Display compiler error correctly.
* BUG: Handle "no return value" errors correctly.
2018-11-24 20:00:45 +01:00
bgermann
a0e95cc0b8 Spelling: catched -> caught 2018-10-14 21:52:07 +02:00
bgermann
6e2a9d458f Unify BSD ifdefs 2018-09-09 18:26:38 +02:00
gambas
ab3963c99c Fix some bugs detected by clang, and JIT code can now raise events.
[INTERPRETER]
* NEW: JIT: Support for event raising.
* BUG: Fix some bugs detected by clang.

[GB.JIT]
* NEW: Support for event raising.
* OPT: Some optimizations in jit code generation and compilation.
2018-06-25 19:17:44 +02:00
gambas
09a0573e61 Replace my old sourceforge mail address by the new one.
[CONFIGURATION]
Replace my old sourceforge mail address by the new one.
2018-02-12 02:53:46 +01:00
gambas
2953ea8d85 Fix error management that could lead to other potential crashes.
[INTERPRETER]
* BUG: Fix error management that could lead to other potential crashes.
2017-09-28 02:05:43 +02:00
gambas
f8358c6fa1 Initialize pseudo-terminal with ICRNL too.
[INTERPRETER]
* BUG: Initialize pseudo-terminal with ICRNL too.
2017-08-28 19:04:25 +02:00
gambas
359471cc30 Initialize master terminal of processes run inside a pseudo-terminal before forking.
[INTEPRETER]
* NEW: Initialize master terminal of processes run inside a pseudo-terminal before forking.
2017-08-26 13:11:59 +02:00
gambas
f45192abb2 Fix pseudo-terminal management again. Now processes run through a terminal set the ECHO flag, and do not clear the OCRNL flag.
[INTERPRETER]
* NEW: Initialize pseudo-terminals with ECHO and don't clear OCRNL flag. This is not compatible with previous versions, as now, by default, printing a NL will become CR+NL through the pseudo-terminal.
  But I didn't succeed in modifying the pseudo-terminal reliably once the child has started. It sometimes fails silently.
* NEW: Check the result of tcsetattr() carefully, as it returns an error only if none of the flags has been set, not just one.

[GB.TERM]
* NEW: Check the result of tcsetattr() carefully, as it returns an error only if none of the flags has been set, not just one.

[GB.FORM.TERMINAL]
* OPT: TerminalView: Reorder some tests in escape codes analyze.
* NEW: TerminalView: The mouse wheel now sends up and down keys when we are not in mouse mode, and if there is nothing to scroll.
2017-08-23 18:10:58 +02:00
gambas
f05e6bc0ca Fix the TerminalView control again, and the way processes are run in pseudo-terminals.
[DEVELOPMENT ENVIRONMENT]
* BUG: Terminal: Replace "\n" by "\r\n" when sending text to the output terminal.

[INTERPRETER]
* NEW: When a process is run with a pseudo-terminal, don't set the ECHO flag, and clear the ONLCR flag.
  That way, the data printed on the standard output is the same as when the process is not run in a pseudo-terminal.

[GB.FORM.TERMINAL]
* BUG: TerminalView: Output filter now works correctly when it receives incomplete data.
* OPT: TerminalViews: Resize the terminal less often when the terminal view is resized.
* NEW: TerminalView: When a process is run inside the terminal, set the ECHO and ONLCR flags automatically.
2017-08-22 13:20:26 +02:00
gambas
ba37aa6da7 Fix pseudo-terminal initialization when running an external process with Exec or Shell.
[INTERPRETER]
* BUG: Fix pseudo-terminal initialization when running an external process with Exec or Shell.

[COMPILER]
* BUG: Fix a typo in 'gbc_trans.h' header.
2017-08-21 13:57:40 +02:00
gambas
91de2cccd5 Flush the process outputs when it stops immediately after having been launched.
[INTERPRETER]
* BUG: Flush the process outputs when it stops immediately after having been launched.
2017-08-21 01:45:59 +02:00
gambas
38a60179aa Fix Process.Wait() (remove debugging messages). 2017-08-18 13:19:10 +02:00
gambas
e1a5412f4f Fix Process.Wait()
[INTERPRETER]
* BUG: Process.Wait() does not freeze anymore when the child process actually ends before checking the end of the process just after having run it.
2017-08-18 13:15:03 +02:00
Benoît Minisini
5189530aaf [INTERPRETER]
* BUG: Don't raise events just after a process has been started and has just been terminated. Postpone them.


git-svn-id: svn://localhost/gambas/trunk@8142 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2017-06-09 23:00:45 +00:00
Benoît Minisini
b225eba20f [CONFIGURATION]
* NEW: Update copyright year in all source files.


git-svn-id: svn://localhost/gambas/trunk@8056 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2017-01-13 03:29:42 +00:00
Benoît Minisini
6950a075f0 [INTERPRETER]
* BUG: Tasks do not inherit signal handler pipe anymore, they recreate it instead. Otherwise you have interferences with the parent process of the task, and some signals are lost.
* BUG: Buffered streams now take the internal stream flag "available_now" into account. No idea why that was disabled.
* BUG: Standard streams now set the internal stream flag "available_now" if they are not connected to a terminal. Which may not be necessarily accurate, so it is a temporary change.


git-svn-id: svn://localhost/gambas/trunk@8052 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2017-01-11 16:57:44 +00:00
Benoît Minisini
f2717c4ae8 [INTERPRETER]
* BUG: Remove debugging messages.


git-svn-id: svn://localhost/gambas/trunk@7998 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2016-11-27 02:44:07 +00:00
Benoît Minisini
7989d44979 [INTERPRETER]
* BUG: Close watched process input & outputs as soon as it is killed. Otherwise, running two processes using virtual terminals successively may fail.


git-svn-id: svn://localhost/gambas/trunk@7997 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2016-11-27 02:43:15 +00:00
Benoît Minisini
5d34538e33 [INTERPRETER]
* BUG: Exec with a null program name does not crash anymore.


git-svn-id: svn://localhost/gambas/trunk@7939 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2016-10-28 10:12:09 +00:00
Benoît Minisini
e71801407c [INTERPRETER]
* NEW: Process.CloseInput() is a new method that explicitly closes the process input, as if you send a CTRL+D from the shell. This implements the old process stream closing behaviour that was removed in revision #7622.


git-svn-id: svn://localhost/gambas/trunk@7833 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2016-08-10 18:37:25 +00:00
Benoît Minisini
f01ea65084 [INTERPRETER]
* BUG: Fix a possible misuse of kill() when calling Process.Kill().


git-svn-id: svn://localhost/gambas/trunk@7792 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2016-05-31 12:11:35 +00:00
Benoît Minisini
b9b46f3873 [CONFIGURATION]
* NEW: Add "-march=native" to the compilation flags. Maybe it could speed up then interpretrer a bit?

[DEVELOPMENT ENVIRONMENT]
* NEW: Connection editor: Update layout.
* NEW: Form editor: Clicking on the master selection selects the parent control.

[WEB SITE MAKER]
* NEW: Update for 3.8.4 version.

[GB.DB]
* BUG: Default values are now correctly taken into account by database templates.

[GB.DB.SQLITE3]
* BUG: Fix a possible uninitialized allocation of columns names.

[GB.UTIL]
* NEW: Class.Stat() class name argument now allows "../" in the name to search for classes in parent components.

[GB.WEB]
* NEW: Request.Language returns the main language requested by the HTTP client. This value can be directly assigned to System.Language.
* NEW: Session.Size returns the size of the session file in bytes.

[GB.WEB.FORM]
* NEW: Automatic management of favicon. The application favicon must be a file named "favicon.png" in the ".public" directory.
* NEW: The Align class for alignment constants.
* NEW: WebControl: Any control can raise a Message event now.
* NEW: The Message boxes now raise the "Message" event of the WebControl that opened the message box. If the event is not handled, then the event is raised by the WebForm of the control.
* NEW: The Select class for selection mode constants.
* BUG: WebComboBox: Define the default event.
* NEW: WebContainer: Indent is a new property that allows to add a left padding to the container.
* NEW: WebContainer: Extra children (those created after initialization) are now recreated with their event observer and event name, provided that the event observer is another WebControl.
* NEW: WebContainer: DeleteChildren() is a new method that deletes all container children.
* NEW: WebExpander: New container that implements an expander.
* NEW: WebForm: Teh application language now automatically switches to the language requested by the HTTP client.
* BUG: WebForm: Show() and ShowModal() method now raise the Open event.
* NEW: WebLabel: Add the Border property to the property list.
* NEW: WebLabel: Newlines in label text are automatically replaced by "<br>".
* NEW: WebTable: New control that implements an HTML table with automatic scrollbars. It gets its data through a Data event, and only displays the first hundred elements by default. A button allows to increase the number of displayed elements.
  The 'Mode' property allows to define the selection mode. When rows are selectable, an extra columns is added, with radion buttons on single selection mode, and checkboxes on multiple selection mode. The indexes of selected rows is returned by
  the 'Selection' property.
* BUG: Many fixes in the default stylesheet.


git-svn-id: svn://localhost/gambas/trunk@7536 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2015-12-27 18:16:32 +00:00
Benoît Minisini
5ecb973af4 [DEVELOPMENT ENVIRONMENT]
* BUG: Image editor: Don't load the image twice.
* NEW: Do not open the welcome dialog if a project directory has been 
  specified in program arguments.
* NEW: Farm client: Paint the software names the same way everywhere.
* BUG: If the workspace was filled before
  the main window is visible, then the QT5 backing store starts displaying
  garbage. The workaround was to always show the main window before trying 
  to load any file.
* NEW: Add the environment variables to the system information.

[WIKI CGI SCRIPT]
* BUG: Fix some HTML syntax errors.

[INTERPRETER]
* BUG: Add the Rand() syntax description.

[GB.DB.POSTGRESQL]
* BUG: If PostgreSQL version is greater than 9.0, then force the bytea 
  output format to 'escape', as it was before.

[GB.EVAL.HIGHLIGHT]
* NEW: The TextHighlighter.ToHtml() method now takes the 'Alternate' style
  flag into account, and the generated HTML is less verbose.
* BUG: The WebPage highlighting has been fixed.

[GB.FORM]
* BUG: Completion: Fix a possible crash.
* BUG: TabPanel: Fix a possible crash.

[GB.SDL2]
* NEW: Window.Handle is a new property that returns the window handle.


git-svn-id: svn://localhost/gambas/trunk@7188 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2015-07-27 03:54:57 +00:00
Benoît Minisini
b2eb17d344 [INTERPRETER]
* BUG: Correctly flush the output of a terminated child process.


git-svn-id: svn://localhost/gambas/trunk@6722 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-12-11 23:41:48 +00:00
Benoît Minisini
064ec73404 [INTERPRETER]
* BUG: 'Exec ... To' and 'Shell ... To' work correctly again.


git-svn-id: svn://localhost/gambas/trunk@6698 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-12-01 16:22:34 +00:00
Benoît Minisini
dfc8140da0 [INTERPRETER]
* BUG: The process error output callback now immediately closes its file 
  descriptor as soon as read() returns zero or an error, or if the Error
  event is not handled.


git-svn-id: svn://localhost/gambas/trunk@6694 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-12-01 11:51:27 +00:00
Benoît Minisini
89d56eb88f [DEVELOPMENT ENVIRONMENT]
* BUG: Don't crash when trying to download the offline help if 'wget' is 
  not installed on the system.
* BUG: Software farm: Don't create a '*.desktop' file if the software is a
  library or a component.
* NEW: Redesign the publish dialog by using a wizard.
* NEW: Use freedesktop categories as possible software tags.

[FARM SERVER]
* NEW: Add a 'size' field in the 'software' table, and an index to be able 
  to sort sotfwares by size later.

[INTERPRETER]
* BUG: Read data ahead before raising a Read event (on Process, File, or 
  any stream). Use the result of that read to detect EOF, as using the 
  stream end-of-file detection routine is not reliable.

[GB.FORM]
* BUG: FileProperties: Fix the media preview.

[GB.MEDIA.FORM]
* BUG: MediaView: Don't crash if the internal media player is not yet 
  initialized.


git-svn-id: svn://localhost/gambas/trunk@6691 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-11-30 22:41:41 +00:00
Benoît Minisini
25dc9cd30d [INTERPRETER]
* BUG: Retrieve the child process output correctly when it has terminated.
  No data should be lost anymore.
* NEW: Remove an unused internal stream method.


git-svn-id: svn://localhost/gambas/trunk@6687 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-11-29 15:29:10 +00:00
Benoît Minisini
40937ec321 [INTERPRETER]
* BUG: Process: Don't call the Read event if there is nothing to read.


git-svn-id: svn://localhost/gambas/trunk@6686 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-11-29 14:45:33 +00:00
Benoît Minisini
5796ac4e56 [DEVELOPMENT ENVIRONMENT]
* NEW: Software farm: Now softwares can be installed or removed. 
  Installation is not finished yet. Checksum, components and libraries are
  not checked. Desktop file is not created.
* NEW: Software farm: Design changes in the GUI.
* BUG: Offline help: The help timestamp is now used for detecting updates.
  File modification time is not used anymore as it is a localized time.
* BUG: Source archive files now ignore files named 'core'.

[INTERPRETER]
* BUG: SHELL now correctly resets the interpreter to '/bin/sh' if the 
  System.Shell property is reset to a null string.

[GB.DESKTOP]
* BUG: Desktop.NetworkAvailable now tries to find 'ifconfig' or 'ip' in 
  '/sbin' and '/usr/sbin' before relying on the PATH environment variable.


git-svn-id: svn://localhost/gambas/trunk@6685 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-11-29 14:20:31 +00:00
Benoît Minisini
996ff69d37 [INTERPRETER]
* BUG: Process: Don't check end of stream before calling the Read event. I
  don't remember what this test was supposed to fix, but for sure it leads
  to data loss if some data arrives just after the test.


git-svn-id: svn://localhost/gambas/trunk@6683 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-11-28 20:15:02 +00:00
Benoît Minisini
655f3474c7 [INTERPRETER]
* NEW: The process child errors raised before the exec() system call are 
  now catched in a separate function called by the compiler explicitly 
  after a SHELL or EXEC assignment.

[COMPILER]
* NEW: SHELL and EXEC assignments now call an hidden subroutine just after
  the assignment to immediately check for a possible child error.


git-svn-id: svn://localhost/gambas/trunk@6681 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-11-27 23:31:51 +00:00
Benoît Minisini
a607aaec6f [INTERPRETER]
* NEW: Apply the "close on exec" flag to all non-temporary file descriptors 
  opened by the interpreter.


git-svn-id: svn://localhost/gambas/trunk@6671 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-11-23 18:19:57 +00:00
Benoît Minisini
db2cb04d55 [DEVELOPMENT ENVIRONMENT]
* BUG: Use System.Exist() to check that 'wget' is installed before trying 
  to download the documentation.

[INTERPRETER]
* NEW: System.Exist() is a new method that returns if a specific program 
  can be found in the PATH environment variable.
* NEW: System.Find() is a new method that returns the absolute path of a 
  specific program according to the PATH environment variable.

[GB.GUI.BASE]
* NEW: Paint.DrawTextShadow() and Paint.DrawRichTextShadow() default radius 
  is now Desktop.Scale divided by three.
* NEW: Paint.DrawTextShadow() and Paint.DrawRichTextShadow() now take a new
  default argument to define the shadow opacity. The default value is 50%.


git-svn-id: svn://localhost/gambas/trunk@6479 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-09-15 20:05:43 +00:00
Benoît Minisini
315ced02f5 [INTERPRETER]
* NEW: When running an external process, search the PATH environment 
  variable before forking, so that if the program does not exist, an error 
  is immediately raised.


git-svn-id: svn://localhost/gambas/trunk@6471 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-09-13 20:37:50 +00:00
Benoît Minisini
50870e93cb [DEVELOPMENT ENVIRONMENT]
* BUG: Making executable works again.

[INTERPRETER]
* BUG: Don't use vfork() if a process has a custom environment, use a 
  terminal or is run through a shell.

[GB.FORM]
* BUG: ValueBox.ReadOnly works as expected now.



git-svn-id: svn://localhost/gambas/trunk@6292 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-05-29 16:01:16 +00:00
Benoît Minisini
89364d93e6 [DEVELOPMENT ENVIRONMENT]
* BUG: Correctly load information files on component classes overriden by a 
  project class.

[INTERPRETER]
* BUG: Use vfork() only if a new process does not use a virtual terminal,
  does not run in a shell, or use a specific environment.


git-svn-id: svn://localhost/gambas/trunk@6291 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-05-27 10:32:24 +00:00
Benoît Minisini
0d2aac1e38 [INTERPRETER]
* NEW: Use vfork() instead of fork() to implement EXEC and SHELL, so that 
  when the child process cannot run the child program for any reason, the 
  error is immediately catched.
* BUG: Fix a possible file descriptor leak when using LOCK.


git-svn-id: svn://localhost/gambas/trunk@6189 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-03-02 20:18:06 +00:00
Benoît Minisini
de0ff1afc1 [INTERPRETER]
* BUG: Correctly close the standard error output of an ending process if 
  its standard output has already been closed.


git-svn-id: svn://localhost/gambas/trunk@6081 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-01-14 12:06:39 +00:00
Benoît Minisini
8c6cf71838 [DEVELOPMENT ENVIRONMENT]
* NEW: ImageEditor: A text tool has been added.
* BUG: The "open terminal" and "open file browser" toolbar icons now work 
  as expected.

[WEBSITE MAKER]
* NEW: Update for 3.5.2 release.

[INTERPRETER]
* NEW: Successives spaces in a regular expression pattern now acts like a 
  single space.

[GB.DRAW]
* NEW: Paint.PathOutline is a new property that returns a array of polygons 
  corresponding to the current drawing path.

[GB.FORM]
* NEW: FontBox is a new control that allows to select a font from a text 
  field.
* NEW: The FontChooser control now adapts its interface if its height is 
  too small.

[GB.GTK]
* NEW: Paint.PathOutline is a new property that returns a array of polygons 
  corresponding to the current drawing path.

[GB.GUI.BASE]
* NEW: Add a little left and right padding to GridView cells.
* NEW: ListBox now uses the default selected background color.

[GB.QT4]
* NEW: Paint.PathOutline is a new property that returns a array of polygons 
  corresponding to the current drawing path.


git-svn-id: svn://localhost/gambas/trunk@6080 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-01-12 01:59:49 +00:00
Benoît Minisini
b09d1e18e4 [INTERPRETER]
* BUG: Don't detach a process that returns an error otherwise the Kill 
  event is lost.


git-svn-id: svn://localhost/gambas/trunk@5921 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-11-01 00:29:32 +00:00
Benoît Minisini
ec5cb392f3 [INTERPRETER]
* NEW: Process.Ignore is a now a boolean property.


git-svn-id: svn://localhost/gambas/trunk@5887 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-10-13 17:55:35 +00:00
Benoît Minisini
d405727342 [INTERPRETER]
* NEW: Process.Ignore() is a new method that tells the interpreter to not 
  wait for the process end. If the interpreter exits, that process is then
  automatically killed.


git-svn-id: svn://localhost/gambas/trunk@5791 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-08-12 20:48:45 +00:00
Benoît Minisini
30c67b1fcd [INTERPRETER]
* BUG: Process management is now reliable against processes killed and 
  started during process event handlers.


git-svn-id: svn://localhost/gambas/trunk@5790 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-08-12 20:01:24 +00:00
Benoît Minisini
c9ca5ab982 [CONFIGURATION]
* NEW: Update copyright year to 2013.

[GB.FORM]
* NEW: ImageView is a new control that allows to view an image inside a 
  scrolled view, at different zoom levels.
* BUG: FileProperties now works correctly if 'gb.desktop' is not used.
* NEW: The FileProperties preview tab now uses an ImageView control and has
  a toolbar to zoom the preview.
* BUG: Add the 'linux' and 'gnu' icon in the stock icon list.


git-svn-id: svn://localhost/gambas/trunk@5770 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-08-03 15:38:01 +00:00
Benoît Minisini
80e53c8dbd [INTERPRETER]
* BUG: Fix a memory leak when trying to run a non-existant program with 
  EXEC or SHELL.


git-svn-id: svn://localhost/gambas/trunk@5614 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-04-07 14:21:48 +00:00