Commit graph

132 commits

Author SHA1 Message Date
gambas
1239f45687 Redesign internal file constants.
[INTERPRETER]
* NEW: Redesign internal file constants.
* BUG: Opening a file for creation in direct mode now implies the write flag.
2020-11-09 17:38:28 +01:00
gambas
2cd257be5b PEEK is a new instruction that peek some bytes from a stream without removing them.
[COMPILER]
* NEW: Support for the new PEEK instruction.

[INTERPRETER]
* NEW: PEEK is a new instruction that peek some bytes from a stream without removing them, so that they are available to the next READ instruction.
* OPT: IsAscii(), IsLower(), IsPunct()... instructions are now a bit faster.
2020-02-11 01:45:10 +01:00
gambas
ba221177da Fix call of special methods _read() and _write().
[INTERPRETER]
* BUG: Fix call of special methods _read() and _write().
2020-01-14 03:49:03 +01:00
gambas
507f48ca61 Fix a possible memory leak when reading an object on a stream through its special _read() method fails.
[INTERPRETER]
* BUG: Fix a possible memory leak when reading an object on a stream through its special _read() method fails.
2020-01-09 18:31:56 +01:00
gambas
2429cff72b Fix possible memory leaks when reading objects or variants with the READ instruction.
[INTERPRETER]
* BUG: Fix possible memory leaks when reading objects or variants with the READ instruction.
2020-01-07 02:34:40 +01:00
gambas
15a7a7f4f3 Fix objet serialization.
[INTERPRETER]
* BUG: Fix objet serialization.
* NEW: Use one byte for writing the class name length when serializing objects.
2019-12-21 20:54:13 +01:00
gambas
f39ed34592 Serializing an object is not ambiguous anymore.
[INTERPRETER]
* BUG: Serializing an object is not ambiguous anymore.
2019-12-21 17:35:30 +01:00
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
64be06797e Reading strings with the READ instruction when the NullTerminatedString property is set now works correctly on all streams.
[INTERPRETER]
* BUG: Reading strings with the READ instruction when the NullTerminatedString property is set now works correctly on all streams.
2019-12-20 00:29:07 +01:00
gambas
3e0398dbd1 OPEN NULL is a new syntax that opens a null stream.
[INTERPRETER]
* NEW: OPEN NULL is a new syntax that opens a null stream. Reading always returns end of file, and writing does nothing except advancing the file pointer, allowing to know how many bytes were written.

[COMPILER]
* NEW: OPEN NULL is a new syntax that opens a null stream.
2019-12-18 06:59:21 +01:00
gambas
2a6eaf8c8c Merge branch 'master' of gitlab.com:gambas/gambas 2019-12-18 06:34:42 +01:00
Benoît Minisini
53f83fb014 Forgot a semicolon.
[INTERPRETER]
* BUG: Forgot a semicolon.
2019-12-18 05:33:55 +00:00
gambas
4bca597638 Stream.NullTerminatedString is a new property that tells if writing a string on the stream emits the string length first, or a null terminated zero byte. This property is TRUE by default on memory streams.
[INTERPRETER]
* NEW: Stream.NullTerminatedString is a new property that tells if writing a string on the stream emits the string length first, or a null terminated zero byte. This property is TRUE by default on memory streams.
2019-12-18 06:29:33 +01:00
Benoît Minisini
6c1b9d6858 Really fix serialization of NULL values.
[INTERPRETER]
* BUG: Really fix serialization of NULL values.
2019-12-18 05:29:03 +00:00
gambas
b98ca797e4 Fix serialization of NULL values.
[INTERPRETER]
* BUG: Fix serialization of NULL values.
2019-12-18 05:46:26 +01:00
gambas
b8ca134643 Reading a string on a memory stream now correctly skip the terminating null byte.
[INTERPRETER]
* BUG: Reading a string on a memory stream now correctly skip the terminating null byte.
2019-12-16 13:32:49 +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
1b7abb97b7 Correct 3e6d9696 2018-08-30 14:07:18 +02:00
bgermann
3e6d969613 Change enum prefix that collides with statvfs 2018-08-30 13:33:13 +02:00
bgermann
b1a12236ad Convert from statfs to more portable statvfs
[INTERPRETER]
* NEW: Convert from statfs to more portable statvfs
2018-08-29 23:59:11 +02:00
gambas
7d16436c5c Eof() now correctly works on file bigger than 4GB opened in direct mode.
[INTERPRETER]
* BUG: Eof() now correctly works on file bigger than 4GB opened in direct mode.
2018-08-27 23:57:30 +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
a93f5b3cc2 Writing to a stream does not crash anymore if the stream is closed while the data is sent in several shots.
[INTERPRETER]
* BUG: Writing to a stream does not crash anymore if the stream is closed while the data is sent in several shots. Socket stream implementation should not close the stream while writing. I will try to fix that later.
2018-02-23 04:01:56 +01:00
gambas
6f06d516b3 Deleting a collection item while the collection is enumerated does not crash anymore.
[INTERPRETER]
* BUG: Deleting a collection item while the collection is enumerated does not crash anymore.
2018-02-20 23:00:17 +01:00
gambas
5487a3ca88 Fix a possible memory leak when using the Stream.End() method.
[INTERPRETER]
* BUG: Fix a possible memory leak when using the Stream.End() method.
2018-02-17 23:16:28 +01:00
gambas
3c8c5a2243 Fix an uninitialized flag in streams, that make watching real files from reading incorrectly raise the Read event.
[INTERPRETER]
* BUG: Fix an uninitialized flag in streams, that make watching real files from reading incorrectly raise the Read event.
2018-02-16 02:39:30 +01: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
e3f941c7e2 Use a dedicated stream for locks, and ignore Application.Busy when displaying a message box.
[DEVELOPMENT ENVIRONMENT]
* OPT: Don't load the help browser form immediately to speed up IDE starting.

[INTERPRETER]
* NEW: Use a dedicated stream for locks, so that the File object returned by LOCK cannot be used for reading or writing the locked file.

[GB.GTK]
* NEW: Ignore Application.Busy when displaying a message box.

[GB.GTK3]
* NEW: Ignore Application.Busy when displaying a message box.

[GB.QT4]
* NEW: Ignore Application.Busy when displaying a message box.

[GB.QT5]
* NEW: Ignore Application.Busy when displaying a message box.
2017-12-18 13:02:39 +01:00
gambas
e6495bcc5b READ instruction with a negtive length argument works correctly again.
[INTERPRETER]
* BUG: READ instruction with a negtive length argument works correctly again.
2017-10-10 18:49:15 +02:00
gambas
55a1701759 Correctly attach newly created objects.
[INTERPRETER]
* BUG: Correctly attach newly created objects.
* BUG: Lof() should work correctly now on streams having a specific implementation of Lof() function.
2017-10-05 23:18:19 +02:00
gambas
b17c977502 Fix internal stream buffer management, and STREAM_read_max() function.
[INTERPRETER]
* BUG: Fix internal stream buffer management, and STREAM_read_max() function.
2017-09-27 14:15:23 +02:00
gambas
aa67ba1309 Rework the stream interface, so that the stream read & write methods just have to actually read or write the data.
[INTERPRETER]
* NEW: Rework the stream interface, so that the stream read & write methods just have to actually read or write the data.
2017-09-27 02:48:00 +02:00
Benoît Minisini
1184d41881 [INTERPRETER]
* BUG: Fix a possible bad serialization of arrays.
* BUG: Don't crash during the unserialisation of an array whose datatype has been incorrectly serialized. Raise an error instead.


git-svn-id: svn://localhost/gambas/trunk@8110 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2017-03-18 12:14:01 +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
bd22007651 [INTERPRETER]
* BUG: Ignore EINPROGRESS and EAGAIN error codes when closing a file descriptor.


git-svn-id: svn://localhost/gambas/trunk@7658 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2016-03-23 02:58:13 +00:00
Benoît Minisini
cd9324c68e [INTERPRETER]
* BUG: Correctly detect error when closing a process stream.
* BUG: Ignore EBADF errors when closing a stream. It means that the underlying file descriptor has already been closed.


git-svn-id: svn://localhost/gambas/trunk@7624 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2016-03-08 20:24:24 +00:00
Benoît Minisini
6cee32287c [INTERPRETER]
* BUG: Now raise an error when a stream cannot be closed, instead of silently ignoring it.


git-svn-id: svn://localhost/gambas/trunk@7622 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2016-03-08 20:04:55 +00:00
Benoît Minisini
217f075c8b [INTERPRETER]
* OPT: Collection access is faster now.
* OPT: LINE INPUT and INPUT are faster now.
* OPT: Conversions to Boolean, from and to Variant are faster now.


git-svn-id: svn://localhost/gambas/trunk@7440 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2015-11-02 03:24:44 +00:00
Benoît Minisini
26d137d850 [INTERPRETER]
* OPT: Some optimization in native array accessors.
* BUG: Fix a compilation warning.


git-svn-id: svn://localhost/gambas/trunk@7439 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2015-10-31 01:49:40 +00:00
Benoît Minisini
bdd864f41a [DEVELOPMENT ENVIRONMENT]
* BUG: Fix windows using icons not existing anymore.
* NEW: Add dark theme versions of some icons.

[INTERPRETER]
* NEW: "../xxx" now refers to a file located in the parent archive, not
  necessarily the main project archive. "../../xxx" refers to the 
  grand-parent archive, and so on. A component written in Gambas that 
  receives a relative path is supposed to prefix it with "../" if he wants 
  to access it. Please report any incompatibility!
* NEW: File.IsRelative() is a new method that returns if a file is 
  relative, i.e. if it does not starts with '/' or '~'.
  
[GB.FORM]
* NEW: The Stock class does not use the Picture cache anymore. It is 
  useless as normally the Stock class is accessed from the Picture[]
  method.

[GB.FORM.MDI]
* BUG: When browsing actions, do not try to load an icon for actions that
  do not have one.

[GB.GTK]
* NEW: Remove the Picture[] array accessor and the Picture.Flush() method.
  They are now implemented in the 'gb.gui.base' component.
  
[GB.GTK3]
* NEW: Remove the Picture[] array accessor and the Picture.Flush() method.
  They are now implemented in the 'gb.gui.base' component.
  
[GB.GUI.BASE]
* NEW: The Picture[] array accessor and the Picture.Flush() method are now 
  implemented in that component.
* NEW: Remove support for theme specific icons.
* NEW: Add support for right-to-left specific icons. For example, if an
  icon is named 'abc-ltr.png', then it will be considered as a 
  'left-to-right' icon, and the 'abc-rtl.png' icon will be used if the 
  current langauge is right-to-left written.
* NEW: Add support for dark theme specific icons. An icon named 
  'abc-dark.png' will be the dark theme version of the 'abc.png' icon.

[GB.QT4]
* NEW: Remove the Picture[] array accessor and the Picture.Flush() method.
  They are now implemented in the 'gb.gui.base' component.
* NEW: Message boxes do not support theme specific icons automatically 
  anymore.
  
[GB.QT5]
* NEW: Remove the Picture[] array accessor and the Picture.Flush() method.
  They are now implemented in the 'gb.gui.base' component.
* NEW: Message boxes do not support theme specific icons automatically 
  anymore.


git-svn-id: svn://localhost/gambas/trunk@7304 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2015-09-12 23:21:44 +00:00
Benoît Minisini
5dc1e1d4c6 [INTERPRETER]
* BUG: Finally fixed! LINE INPUT internal buffer is now correctly reset 
  when SEEK is used.


git-svn-id: svn://localhost/gambas/trunk@7176 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2015-07-09 14:39:38 +00:00
Benoît Minisini
3de004cff2 [INTERPRETER]
* BUG: Do not read ahead a ready to read file descriptor if we are in 
  direct mode and if the file is a not a regular file.


git-svn-id: svn://localhost/gambas/trunk@6994 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2015-03-19 23:23:47 +00:00
Benoît Minisini
0fbfdf5757 [INTERPRETER]
* BUG: Stream read ahead does not have to wait for the descriptor to be 
  ready for reading.


git-svn-id: svn://localhost/gambas/trunk@6993 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2015-03-19 13:50:35 +00:00
Benoît Minisini
a5f2cb1575 [FARM SERVER]
* NEW: Software screenshot can be deleted by the client.

[INTERPRETER]
* NEW: The little interpreter sleep is now done inside the watch file 
  descriptor read callback only. So no need to implement it in each
  component event loop.

[GB.SDL2]
* BUG: The SDL event loop now calls the interpreter event loop so that 
  timers and watched file descriptor are correctly handled.


git-svn-id: svn://localhost/gambas/trunk@6792 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2015-01-02 03:44:30 +00:00
Benoît Minisini
cc08725fe4 [INTERPRETER]
* NEW: Do not stop watching a file descriptor that is ready to read but has 
  no data.
* NEW: Sleep up to 10 ms if the event loop is called too often.


git-svn-id: svn://localhost/gambas/trunk@6791 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2015-01-02 02:22:22 +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
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
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
c9d541a8db [INTERPRETER]
* BUG: The stream available length function now correctly returns zero when 
  it fails.


git-svn-id: svn://localhost/gambas/trunk@6413 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-08-02 21:37:49 +00:00