Commit graph

104 commits

Author SHA1 Message Date
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
Benoît Minisini
73b2d0dd75 [GB.FORM]
* BUG: FileChooser: Fix an infinite loop when trying to initialize the path 
  with an unknown file.

[GB.MEDIA.FORM]
* NEW: New component based on gb.media that includes a full media player 
  widget with controls.

[GB.NET.SMTP]
* NEW: SmtpClient is now a virtual control.


git-svn-id: svn://localhost/gambas/trunk@6408 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-08-01 01:37:56 +00:00
Benoît Minisini
4963ce37d2 [INTERPRETER]
* BUG: When reading lines ending with a "Window" end-of-line sequence 
  (CR+LF), the LINE INPUT instruction could sometimes forget to remove the 
  first end-of-line character from the end of the line (CR).


git-svn-id: svn://localhost/gambas/trunk@6398 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-07-27 21:04:29 +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
7a9d649219 [INTERPRETER]
* BUG: Fix the CLOSE instruction when dealing with a string stream.
* NEW: Make WRITE behave the same way as READ on a memory stream. I.e. it 
  writes a null-terminated "C" string.


git-svn-id: svn://localhost/gambas/trunk@5942 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-11-04 18:16:26 +00:00
Benoît Minisini
407e74968b [INTERPRETER]
* BUG: Undo one change of last revision: reading a stream from a memory 
  stream is a special case. It reads a null-terminated C string, and not a
  serialized Gambas string.
* NEW: OPEN STRING is a new instruction that allows to use a string as a 
  stream. Writing to it appends the written data to the end of the string 
  at the moment.
* NEW: Closing a string stream returns the data written to the stream as a
  new string.

[COMPILER]
* NEW: New OPEN STRING instruction.
* NEW: OPEN MEMORY and OPEN PIPE are synonymous of the MEMORY and PIPE
  instructions alone.

[GB.EVAL]
* NEW: Highlight the new OPEN STRING instruction correctly.


git-svn-id: svn://localhost/gambas/trunk@5941 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-11-04 15:17:01 +00:00
Benoît Minisini
574745f34d [INTERPRETER]
* BUG: VarPtr() correctly works on method arguments.
* BUG: Reading a string from a memory stream now works correctly.


git-svn-id: svn://localhost/gambas/trunk@5940 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-11-04 02:54:00 +00:00
Benoît Minisini
a72e92ae47 [INTERPRETER]
* BUG: Fix a possible false error when using LINE INPUT on non-blocking 
  streams.

[GB.FORM]
* NEW: LCDLabel.Value is a new property that is a synonymous of the Text 
  property for numerical values.
 

git-svn-id: svn://localhost/gambas/trunk@5819 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-08-30 07:12:36 +00:00
Benoît Minisini
e182fbd2db [INTERPRETER]
* BUG: Continue on fixing "stop watching on end of file" algorithm...


git-svn-id: svn://localhost/gambas/trunk@5818 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-08-29 20:52:14 +00:00
Benoît Minisini
aa99eaa6bf [INTERPRETER]
* BUG: Fix "stop watching on end of file" algorithm again.


git-svn-id: svn://localhost/gambas/trunk@5817 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-08-29 20:21:20 +00:00
Benoît Minisini
ef8307793d [INTERPRETER]
* BUG: Do not stop watching when reading up to a specified number of bytes.


git-svn-id: svn://localhost/gambas/trunk@5816 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-08-29 19:15:14 +00:00
Benoît Minisini
4830af856b [INTERPRETER]
* BUG: Disable read watch when reading a stream fails for any reason: i/o
  error, end-of-file...


git-svn-id: svn://localhost/gambas/trunk@5811 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-08-19 21:45:13 +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
18c9b762fc [INTERPRETER]
* BUG: A stream redirected through the 'Begin' method checks that stream is
  ready for writing only when the 'Send' method is called. Between the 
  'Begin' and 'Send' calls, the PRINT and WRITE instructions will always
  succeed.


git-svn-id: svn://localhost/gambas/trunk@5723 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-07-06 19:00:41 +00:00
Benoît Minisini
0a5be7890d [INTERPRETER]
* BUG: Don't wait for a stream to be ready for reading if the stream has no
  underlying file descriptor.


git-svn-id: svn://localhost/gambas/trunk@5633 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-05-01 13:02:38 +00:00
Benoît Minisini
165be4a66a [INTERPRETER]
* NEW: Clean up object referencement macros.


git-svn-id: svn://localhost/gambas/trunk@5601 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-03-30 13:51:10 +00:00
Benoît Minisini
ca7856bf80 [INTERPRETER]
* NEW: Clean up allocation macros.

{GB.EVAL.HIGHLIGHT]
* NEW: Add 'transition' to the CSS keywords.


git-svn-id: svn://localhost/gambas/trunk@5599 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-03-29 23:33:01 +00:00
Benoît Minisini
53d4d9c752 [INTERPRETER]
* BUG: Fixes of bugs detected by Coverity Scan.
* BUG: Process output is correctly flushed at process exit now.

[COMPILER]
* BUG: Fixes of bugs detected by Coverity Scan.

[ARCHIVER]
* BUG: Fixes of bugs detected by Coverity Scan.

[INFORMER]
* BUG: Fixes of bugs detected by Coverity Scan.

[GB.COMPRESS]
* BUG: Fixes of bugs detected by Coverity Scan.

[GB.DEBUG]
* BUG: Fixes of bugs detected by Coverity Scan.

[GB.EVAL]
* BUG: Fixes of bugs detected by Coverity Scan.

[GB.IMAGE]
* BUG: Fixes of bugs detected by Coverity Scan.

[GB.IMAGE.EFFECT]
* BUG: Fixes of bugs detected by Coverity Scan.

[GB.VB]
* BUG: Fixes of bugs detected by Coverity Scan.


git-svn-id: svn://localhost/gambas/trunk@5493 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-01-06 16:13:31 +00:00
Benoît Minisini
1ab3b111c5 [INTERPRETER]
* BUG: Handle errors occuring while waiting for a process correctly now.
* NEW: Process.Wait() now can take an optional timeout argument, in 
  milliseconds.
* BUG: Handle errors occuring while waiting for a task correctly now.


git-svn-id: svn://localhost/gambas/trunk@5102 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-08-30 22:49:21 +00:00
Benoît Minisini
091b94b1ed [INTERPRETER]
* NEW: Allow components to access the interpreter API through a pointer and 
  not a full structure. It is a little bit slower (one more indirection),
  but it uses less memory: one pointer instead of about 180.

[GB.GTK]
* NEW: Use the indirect API access.

[GB.QT4]
* NEW: Use the indirect API access.

[GB.TASK]
* NEW: Use the indirect API access.
* NEW: Task now is now a stream that can read the standard output of the 
  background task.
* NEW: Task now raises the Read event when the background task has printed
  something on its standard output.
* NEW: Task now raises the Error event when the background task has printed
  something on its standard error output. The event handler receives the
  data in its first argument.

[GB.XML.RPC]
* BUG: Some english fixes in some error messages.


git-svn-id: svn://localhost/gambas/trunk@5077 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-08-25 15:13:39 +00:00
Emil Lenngren
c59b33e1bb [GB.JIT]
* BUG: Fixed some bugs.

[INTERPRETER]
* BUG: "Read ... As String"  now correctly returns a void string instead of null, if it read an empty string.



git-svn-id: svn://localhost/gambas/trunk@4839 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-06-16 23:45:57 +00:00
Benoît Minisini
9d6b4a0f0d [DEVELOPMENT ENVIRONMENT]
* BUG: Fix version requirements on components in the packager.

[INTERPRETER]
* OPT: A little optimization in LINE INPUT.

[GB.FORM]
* NEW: GridView: Setting the column width to -1 make it fit its contents.
* NEW: GridView: Double-clicking on the right limit of a column make it
  fit its contents.


git-svn-id: svn://localhost/gambas/trunk@4537 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-03-08 01:41:23 +00:00
Benoît Minisini
dd3b512daf [CONFIGURATION]
* NEW: Update copyrights.


git-svn-id: svn://localhost/gambas/trunk@4384 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2011-12-31 02:39:20 +00:00
Benoît Minisini
72c46b0820 [INTERPRETER]
* BUG: Correctly check how a system file descriptor is opened when 
  watching it.



git-svn-id: svn://localhost/gambas/trunk@4160 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2011-09-28 00:57:05 +00:00
Benoît Minisini
7a445217f2 [DEVELOPMENT ENVIRONMENT]
* NEW: Javascript compression now compress local variable names.
* BUG: Fix database manager field creation.

[GB.FORM.STOCK]
* BUG: Fix icons again.

[GB.QT4]
* BUG: Fix GridView Row and Column property.
* BUG: Fix GridView Change event in single selection mode.


git-svn-id: svn://localhost/gambas/trunk@4158 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2011-09-27 12:36:33 +00:00
Benoît Minisini
a3c4a852e3 [INTERPRETER]
* NEW: When opening an existing file descriptor, check that it is opened 
  with a compatible mode. Otherwise raise an "Access forbidden" error.


git-svn-id: svn://localhost/gambas/trunk@4133 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2011-09-18 15:36:30 +00:00
Benoît Minisini
3b5b881d5e [INTERPRETER]
* NEW: Split System and Application class implementation in tow different
  source files.
* NEW: A trick to watch existing file descriptors: opening ".XX" in direct
  mode, where "XX" is the file descritor value.


git-svn-id: svn://localhost/gambas/trunk@4132 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2011-09-18 15:21:11 +00:00
Benoît Minisini
3840aa7985 [INTERPRETER]
* OPT: Optimize some string functions by not using arguments passed by 
  reference.
* OPT: Integrate the "=" operator function into the main execution loop to
  save one function call.
* OPT: Optimize string comparison functions on x86 and x64_64 architectures
  by comparing eight bytes in one shot.


git-svn-id: svn://localhost/gambas/trunk@4104 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2011-09-07 12:38:29 +00:00
Benoît Minisini
9615d16694 [INTERPRETER]
* BUG: Write and Read instructions now deal with NULL values without crashing.


git-svn-id: svn://localhost/gambas/trunk@3946 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2011-07-24 09:45:44 +00:00