Welcome, Guest. Please login or register.

Author Topic: How did datatypes work?  (Read 7150 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show only replies by sim085
How did datatypes work?
« on: September 09, 2010, 03:09:25 PM »
Hello, Is there a good explanation of how data types worked? Also was this the default way how files where handled/opened on workbench?
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: How did datatypes work?
« Reply #1 on: September 09, 2010, 03:40:53 PM »
Quote from: sim085;578477
Hello, Is there a good explanation of how data types worked?

http://en.wikipedia.org/wiki/Amiga_support_and_maintenance_software#Datatypes
Quote
Also was this the default way how files where handled/opened on workbench?

No
 

Offline LoadWB

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 2901
  • Country: 00
    • Show only replies by LoadWB
Re: How did datatypes work?
« Reply #2 on: September 09, 2010, 04:31:02 PM »
Quote from: Piru;578479
http://en.wikipedia.org/wiki/Amiga_support_and_maintenance_software#Datatypes


Woah, that page could use some English fix-up.  Good info, though; I never knew about Fireworks for MorphOS.
 

Offline kolla

Re: How did datatypes work?
« Reply #3 on: September 09, 2010, 04:38:30 PM »
Quote from: sim085;578477
Also was this the default way how files where handled/opened on workbench?


I always prefered to open application first, and then load files into them. I'm probably just being old fashioned now, huh?
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show only replies by sim085
Re: How did datatypes work?
« Reply #4 on: September 09, 2010, 05:30:40 PM »
Quote from: Piru;578479
http://en.wikipedia.org/wiki/Amiga_support_and_maintenance_software#Datatypes
Yes, but is there any documentation of how this worked internally and how I might develop a new datatype?
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: How did datatypes work?
« Reply #5 on: September 09, 2010, 05:53:14 PM »
Quote from: sim085;578506
Yes, but is there any documentation of how this worked internally
You should be more specific in your questions then. There most certainly is.

Quote
and how I might develop a new datatype?
Googling does help.

http://aminet.net/package/dev/c/C_V44-DT
 

Offline Franko

  • Hero Member
  • *****
  • Join Date: Jun 2010
  • Posts: 5707
    • Show only replies by Franko
Re: How did datatypes work?
« Reply #6 on: September 09, 2010, 06:13:38 PM »
Quote from: kolla;578489
I always prefered to open application first, and then load files into them. I'm probably just being old fashioned now, huh?


Im with you on that one Kolla, never liked datatypes and always removed them from my set ups, there are much better apps for viewing files/pics etc.. on the miggy. :)
 

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show only replies by sim085
Re: How did datatypes work?
« Reply #7 on: September 09, 2010, 07:19:52 PM »
Quote from: Piru;578509
http://aminet.net/package/dev/c/C_V44-DT


First of all thank you very much for your help.

Quote from: Piru;578509
You should be more specific in your questions then. There most certainly is.


Sorry for not being specific. What I am looking for is an explanation of how datatypes work. For example what happens when the user clicks on a file? How does the system know which datatype is responsable for which file? Does it loop through every installed datatype and each datatype opens the file (or part of the file) to determine if it is responsable for it?

I am not an experianced amiga user and therefore do not know where to look for this information. I will see the code of that datatype but not sure if I'll be able to understand it.

Thanks again.
 

Offline Thomas

Re: How did datatypes work?
« Reply #8 on: September 09, 2010, 09:25:49 PM »
Quote
What I am looking for is an explanation of how datatypes work. For example what happens when the user clicks on a file?


You are mixing datatypes with DefIcons. When a user clicks on a file, datatypes are not involved at all. Up to 3.1 the file to be clicked on is not even identified. All files without icons are assumed to be programs.

Only with NewIcons or OS 3.5 the DefIcons program was introduced. It lets Workbench examine the file to determine a better icon for it. But this is not done with datatypes.

Datatypes need to be used explicitely. Multiview for example uses datatypes to determine the file type and to load/display/play back the file.


Quote
How does the system know which datatype is responsable for which file?


You don't need to know this. It's internally to datatypes.library. You just use the functions of datatypes.library in your program, for example NewDTObject and GetDTAttrs.

Probably datatypes.library iterates through all available data types. The descriptors in devs/datatypes contain the information how to identify a file type. Usually the file is opened only once by datatypes.library and a small buffer is used for comparisons which contains the first few bytes of the file (64 bytes IIRC).

Most datatype descritors are held very simple, for example "compare the first 12 bytes with the pattern FORM????ILBM". The comparison is done by datatypes.library, there is no foreign code involved.

Only very few desctiptors actually contain code. In this code everything can be done, though. For example the code can close and reopen the file and read it entirely if needed. But this should not be done because identification needs to be very fast.

Once the file type is identified and the application wants to load the file, the class library from classes/datatypes is called. This library contains the code to decode the file contents and to make it available to datatypes.library.

Quote
I am not an experianced amiga user and therefore do not know where to look for this information.


Everything you need is contained on the Amiga Developer CD. This CD is a real treasure of information.

First you should learn about BOOPSI. If you understand BOOPSI, it's easy to understand datatypes, ReAction, MUI, ...

Offline scuzzb494

Re: How did datatypes work?
« Reply #9 on: September 09, 2010, 11:09:19 PM »
No idea where I got this from. Maybe the author lives here...

Most all the DataTypes can be found at Aminet:/util/dtype
(As of 1-24-95 the DataTypes were moved form /util/wb to
 /util/dtype , you also may check there)

Data
Type   Type of data                          Archive               Where
--------------------------------------------------------------------------
Amiga
Guide  HyperText Amiga Format                Comes with 3.xOS      OS
FTXT   Text                                  Comes with 3.xOS      OS
Binary Shows Binaries in Hex and ASCII       binarydt_39.11.lha    Aminet
c/c++  Highlights c/c++ keywords etc         cdt_39.15.lha         Aminet
CLI    Runs external CLI prog display Output clidt_39.2.lha        Aminet
DFA    Address tool for Amiga                dfadt-391.lha         Aminet
EXE    Shows hunk based-file as ASCII        exeDT394.lha          Aminet
FONT   Shows Amiga Fonts                     FontDT-1.1.lha        Aminet
MAN    Shows Unix Man Pages (nice!)          mandt_v39.4.lha       Aminet
TEXT   Patches text.datatype/support search  textdtptch39_2.lha    Aminet
 
8SVX   Amiga Sound                           Comes with 3.xOS      OS
ADPCM  Lossy sample compression IN:util/pack ADPCM_Package.lha     Aminet
AIFF   Audio Interchange File Format (1.11)  aiff_dtc.lha          Aminet
AIFC   AIFF Compressed (1.11)                aiff_dtc.lha          Aminet
AU     Sun audio (42.1)                      ams.lha               Aminet
MACSND Apple Macintosh Sound                 MacSND-dtc-107.lha    Aminet
MAUD   MAUD IFF Format 32Bit                 maudDTr1.lha          Aminet
VOC    VOC files with different frequencies  fpVOC_dt40.2.lha      Aminet³
WAV    Windows sound file                    fpWAV_dt40.2.lha      Aminet

ANIM   Amiga Animation                       Comes With 3.xOS      OS²
AOM    RAW data pics (Applied Optical Media) AOM_Raw_dt40.2.lha    Aminet
DEBOX  Images fromsome CDTV/CD32 CD-ROMS     DeBox_DT40.2.lha      Aminet
BMP    Windows Bitmap                        picdt_42_1.lha        Aminet
BMP    Windows Bitmap                        BMPdt404.lha          Aminet
CDXL   ~DataStream (mostly video)            Comes With 3.xOS      OS²
FAXX   Fax format                            Comes with TrapFax    TrapFax
GIF    Graphics Interchange Format 87a & 89a GIFdatatype-39.lha    Aminet
GIF    Graphics Interchange Format           ZGIFDataType.lha      Aminet
GIF    Graphics Interchange Format           ZGIFDType39.16.lha    Aminet
ICO    Windows Icon File                     picdt_42_1.lha        Aminet
ILBM   Amiga Format (IFF)                    Comes With 3.xOS      OS
INFO   Amiga Icon File                       infoDataType.lha      Aminet
INFO   Amiga Icon File                       infoDT39.1.lha        Aminet
INFO   Amiga Icon File                       icon_394.lha          Aminet
JPEG   JPEG datatype                         JpegDataType.lha      Aminet³
JPEG   New JFIF/JPEG datatype                jfif_dtc.lha          Aminet
JPEG   A fix for "jfif_dtc.lha"              jfif_FIX.lha          Aminet
PIC    MacPaint                              picdt_42_1.lha        Aminet
PCX    Z-Soft PC-PaintBrush File (39.2)      PCX.datatype.lha      Aminet
PCX    Z-Soft PC-PaintBrush File             picdt_42_1.lha        Aminet
PCX    Z-Soft PC-PaintBrush File (39.7)      TPD.lha               Aminet
PNG    Portable Network Graphics (43.1)      PNG_dt.lha            Aminet
PS     PostScript ¹ (39.0)                   PostScriptDT.lha      Aminet
QRT    POV Dump format (39.1)                QRT_DT.lha            Aminet
SVG    Superview-Library's graphics format   SVGDT402.lha          Aminet
TIFF   Tag Image File Format (40.5)          TIFFDT.lha            Aminet
XBM    X-Bitmap picture                      ams.lha               Aminet
SUN    Sun Raster picture                    SUNdt396.lha          Aminet
TGA    Targa graphical file format           TGAdt391.lha          Aminet
TGA    Targa or TGA images (39.2)            TargaDType.lha        Aminet
WPG    WordPerfect images (39.0)             WPGdtype.lha          Aminet

REKO   REKO cardsets / Klondike Deluxe AGA   REKOdt392.lha         Aminet
REKO   REKO cardsets / Klondike Deluxe AGA   MREKO-1.0.lha         Aminet
HNS    "MaxonMagic" Files                    fpHSN_dt40.1.lha      Aminet

Sample Vision -  MS-DOS computers (prg)      smpDTr1.lha           Aminet³
Yamaha TX16W  -  12bit sample by Yamaha      tx16wDTr2.lha         Aminet³


¹needs post.library, can be found in HWGPOSTbeta7.lha (Aminet:/text/print)
²Comes with 3.1OS
³Needs 68020 or higher

NOTE: Some of the DT files have been removed from Aminet for one reason
      or another. If you are looking for a file that is not currently on
      Aminet you might look on a older Aminet CDROM.

Offline kolla

Re: How did datatypes work?
« Reply #10 on: September 10, 2010, 01:02:34 PM »
Quote from: Franko;578511
Im with you on that one Kolla, never liked datatypes and always removed them from my set ups, there are much better apps for viewing files/pics etc.. on the miggy. :)


I don't follow the logic here, that I prefer to open apps first and then load files into them has nothing to do with datatypes. My comment was regarding "the default way how files where handled/opened on workbench", which again, has nothing to do with datatypes.
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline scuzzb494

Re: How did datatypes work?
« Reply #11 on: September 10, 2010, 02:08:17 PM »
Quote from: kolla;578626
I don't follow the logic here, that I prefer to open apps first and then load files into them has nothing to do with datatypes. My comment was regarding "the default way how files where handled/opened on workbench", which again, has nothing to do with datatypes.



He was probably refering to Multiview which truly was a dreadful application. I generally set all my files to be opened through Dopus. Much better.

I do recall each month getting AUI and Amiga Computing just to get the shed loads of new datatypes off the cover disks.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: How did datatypes work?
« Reply #12 on: September 10, 2010, 07:50:47 PM »
The only problem I have with datatypes is that they aren't really bidirectional. You can generally only save in IFF.

In my minds eye, the ideal implementation would allow each datatype superclass (picture.datatype, sound.datatype etc) to provide a list of all currently known sub-classes that support encoding. You'd then be able to pick one and encode data for that datatype and write it out to disk in that format.
int p; // A
 

Offline JimS

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 1155
    • Show only replies by JimS
Re: How did datatypes work?
« Reply #13 on: September 10, 2010, 08:26:59 PM »
Quote from: kolla;578489
I always prefered to open application first, and then load files into them. I'm probably just being old fashioned now, huh?


Interesting... I always preferred to launch data files with DirOpus, after configuring it to recognize file types from the file itself....  I still prefer to work that way on the peecee.
I guess I'm old and set in my ways. ;-)
Obsolescence is futile. You will be emulated. - Amigus of Borg
 

Offline scuzzb494

Re: How did datatypes work?
« Reply #14 on: September 10, 2010, 08:57:07 PM »
Quote from: JimS;578712
Interesting... I always preferred to launch data files with DirOpus, after configuring it to recognize file types from the file itself....  I still prefer to work that way on the peecee.
I guess I'm old and set in my ways. ;-)


I have to say that the day I found DOpus everything changed for me on the Amiga. It was like a massive door had just opened into a treasure vault I had never been in. I don`t think there has been another piece of software to match it. So much power from such a simple interface. Mastering DOpus was/is always interesting and a fun thing to do.