In addition to the basic data types, D-Type Standard Engine also defines and utilizes the following structure types:
This structure type describes a single point using float-point coordinates.
/* Point */
typedef struct
{
DT_FLOAT x, y;
} DT_POINT_FLOAT;
This structure type describers a rectangle whose coordinates are expressed as 16-bit signed integers.
/* D-Type Rectangle (coordinates expressed as 16-bit signed integers) */
typedef struct
{
DT_SWORD xmn, ymn, xmx, ymx;
} DT_RECT_SWORD;
Here, xmn and ymn represent the minimum (x, y) coordinate of the rectangle (or its top left corner) while xmx and ymx represent the maximum (x, y) coordinate of the rectangle (or its bottom right corner).
This structure type describers a rectangle whose coordinates are expressed as 32-bit signed integers.
/* D-Type Rectangle (coordinates expressed as 32-bit signed integers) */
typedef struct
{
DT_SLONG xmn, ymn, xmx, ymx;
} DT_RECT_SLONG;
Here, xmn and ymn represent the minimum (x, y) coordinate of the rectangle (or its top left corner) while xmx and ymx represent the maximum (x, y) coordinate of the rectangle (or its bottom right corner).
This structure type contains the horizontal and vertical origin, advance width and advance height of a glyph/character in font units.
/* D-Type's glyph/char origins and advances */ typedef struct { DT_SWORD x, y; /* horizontal and vertical origin in font units */ DT_UWORD w, h; /* advance width and height in font units */ } DT_ADVANCE;
Here, x and y represent the horizontal and vertical origin of the glyph/character while w and h represent its advance width and height.
This structure type provides style properties that are applied when D-Type renders an output primitive (glyph, character, shape, bitmap) to the output surface. The structure is utilized by the dtOutputSetStyleAttribs and dtOutputGetStyleAttribs functions.
The DT_STYLE_ATTRIBS structure is defined as follows:
/* D-Type Style */ typedef struct { DT_UBYTE ep[2]; /* Effect and effect parameter */ DT_UBYTE rgbt[4]; /* Color (Red, Green, Blue) and Transparency */ DT_SWORD reserved; /* Must be set to 0 */ const DT_UBYTE* palette; /* Either DV_NULL or a valid pointer to a 256-element array */ } DT_STYLE_ATTRIBS;
Here, ep represents EffectID and EffectParameter. See Appendix — Style Effects for a list of supported values. The rgbt parameter is simply the intensity of Red (R), Green (G) and Blue (B) and Transparency.
R — red component (R). Must be between 0 and 255.
G — green component (R). Must be between 0 and 255.
B — blue component (R). Must be between 0 and 255.
Transparency — An integer in the 0-255 range, where 0 indicates 0% transparency and 255 indicates 100% transparency. For example:
0 = not transparent — completely visible
127 = 50% transparent
250 = 98% transparent — hardly visible
255 = 100% transparent — invisible
The reserved parameter is reserved for future use and must be set to 0.
The palette parameter must be either DV_NULL or a pointer to an array containing exactly 256 elements. When rendering in true RGB mode, which is highly recommended, set this parameter to DV_NULL. When rendering in indexed color mode, which is an option when the output device is not capable of displaying RGB colors, the R, G, B and T parameters will be ignored and the array pointed by palette will be used instead. In that case, palette must be a valid pointer to an array containing exactly 256 elements. The array must exist at the address pointed by palette as long as the style structure is in use by D-Type Engine (in other words the array can be discarded or freed only after the style has been unloaded from D-Type Engine or replaced by another style). Each element in this array represents a color index of the corresponding gray-level. This provides rudimentary support for rendering in indexed color mode (with limited anti-aliasing and no alpha-blending capabilities). The interpretation of the supplied color indices is up to your application.
This structure type has the same purpose as DT_STYLE_ATTRIBS but is more sophisticated. It allows several style effects to be combined and applied to an output primitive (glyph, character, shape, bitmap) at the same time. It also allows certain style effects to use multiple effect parameters (e.g. Gaussian blur with a different amount of blur in the horizontal and vertical direction). The structure is utilized by the dtOutputSetStyleEffects and dtOutputGetStyleEffects functions.
The DT_STYLE_EFFECTS structure is defined as follows:
/* D-Type Style */ typedef struct { DT_SLONG effects_len; /* Number of effect values */ DT_SLONG effects_arr[64]; /* Array of effect values */ DT_UBYTE rgbt[4]; /* Color (Red, Green, Blue) and Transparency */ const DT_UBYTE* palette; /* Either DV_NULL or a valid pointer to a 256-element array */ } DT_STYLE_EFFECTS;
Here, effects_len is the actual number of elements in the effects_arr array and must not exceed 64. The effects_arr array is an array that contains one or more effect values. The maximum number of values this array can hold is 64. The array begins with the first EffectID, which is followed by the first set of n EffectParameter values. The array continues with the second EffectID, which is followed by the second set of n EffectParameter values. The array continues with the third EffectID, which is followed by the third set of n EffectParameter values. And so on. Once again, the total number of EffectID and EffectParameter values in the array cannot exceed 64.
The number of EffectParameter values in each set (n) depends on the actual EffectID in that set. Some EffectID values have no parameters, while others have 1 or 2 parameters. See Appendix — Style Effects for details.
The rgbt parameter is simply the intensity of Red (R), Green (G) and Blue (B) and Transparency.
R — red component (R). Must be between 0 and 255.
G — green component (R). Must be between 0 and 255.
B — blue component (R). Must be between 0 and 255.
Transparency — An integer in the 0-255 range, where 0 indicates 0% transparency and 255 indicates 100% transparency. For example:
0 = not transparent — completely visible
127 = 50% transparent
250 = 98% transparent — hardly visible
255 = 100% transparent — invisible
The palette parameter must be either DV_NULL or a pointer to an array containing exactly 256 elements. When rendering in true RGB mode, which is highly recommended, set this parameter to DV_NULL. When rendering in indexed color mode, which is an option when the output device is not capable of displaying RGB colors, the R, G, B and T parameters will be ignored and the array pointed by palette will be used instead. In that case, palette must be a valid pointer to an array containing exactly 256 elements. The array must exist at the address pointed by palette as long as the style structure is in use by D-Type Engine (in other words the array can be discarded or freed only after the style has been unloaded from D-Type Engine or replaced by another style). Each element in this array represents a color index of the corresponding gray-level. This provides rudimentary support for rendering in indexed color mode (with limited anti-aliasing and no alpha-blending capabilities). The interpretation of the supplied color indices is up to your application.
This structure type contains various line decoration parameters supported by D-Type that can be applied to output primitives (glyphs, characters, and shapes).
/* D-Type Line Decoration */ typedef struct { DT_SRAST_L thickness; /* 0=normal, >0=outline, <0=expansion */ DT_SRAST_L segment; /* Segment len - used for dashing when thickness<>0 */ DT_SRAST_L shift; /* Must be set to 0 */ DT_UWORD dash_size; /* Dash size as a percentage of the segment len (0=default, 65535=100%) */ DT_UBYTE flags; /* Must be set to 0 */ DT_ID_UBYTE scale_id; /* Multiplier ID for thickness, segment and shift (0=multiply by 256, 1=multiply by 100) */ } DT_LINEDECOR;
This structure consists of the following components:
thickness — When positive, this parameter represents the amount of outline thickness in pixels or fractions of pixels (as defined by the scale_id parameter). In this case the output primitive will be rendered outlined. When negative, this parameter represents the amount of outline expansion in pixels or fractions of pixels (as defined by the scale_id parameter). In this case the output primitive will be rendered dilated. If zero, the output primitive will be rendered in standard mode (without any outline effects).
segment — This parameter is used in conjunction with the thickness parameter. More precisely, when thickness is non-zero, then segment can be used to indicate that the outline should be subdivided into a number of smaller segments (each consisting of a dash and a gap) so that the overall appearance of the output primitive is dashed.
The value of the segment parameter indicates the desired length of a single segment, in pixels. Each segment consists of a dash and a gap. By default, the dash takes approximately two thirds of the segment's length, while the gap uses the remaining one third. Therefore, if segment is set to 30 pixels, then each dash will be approximately 20 pixels in length while each gap will be approximately 10 pixels in length. However, this default can be changed by setting the dash_size parameter accordingly.
At present the segment parameter must be non-negative. It should be set to zero if the segments are not desired or if thickness is set to zero. In this case the outline will appear solid and continuous.
shift — Reserved for future use. Must be set to 0.
dash_size — Dash size as a percentage of the segment len, where the value 65535 means 100%. The value 0 is special and means the default dash size. In this case, as noted above, the dash takes approximately two thirds of the segment's length, while the gap uses the remaining one third.
flags — Reserved for future use. Must be set to 0.
scale_id — Multiplier ID for thickness, segment and shift. The value 0 (DV_SCALE_256) means that these values are expressed in 1/256 pixel units, the value 1 (DV_SCALE_100) means that these values are expressed in 1/100 pixel units, while the value 2 (DV_SCALE_1) means that these values are expressed in pixels. Other values are reserved for future use.
This is a complex structure type that contains information about typographical properties of a glyph or character. The structure is utilized by the dtTypesetterSetTypeAttribs and dtTypesetterGetTypeAttribs functions.
The DT_TYPE_ATTRIBS structure is defined as follows:
/* Type (typographical properties of a glyph or character) */ typedef struct { DT_ID_SWORD font_index; /* Font index from Font Catalog */ DT_SRAST_L thickness; /* 0=normal, >0=outline, <0=expansion */ DT_SRAST_L segment; /* Used for dashing when thickness<>0 */ DT_UBYTE reserved; /* Must be set to 0 */ DT_ID_UBYTE descriptor; /* 0=transformation via raw params, 1=transformation via 2x2 matrix */ DT_TRANSFORM transform; } DT_TYPE_ATTRIBS;
This structure consists of the following components:
font_index — Uniquely identifies a font in the Font Catalog.
thickness — When positive, this parameter represents the amount of outline thickness in 1/100 pixels. In this case the glyph will be rendered outlined. When negative, this parameter represents the amount of outline expansion in 1/100 pixels. In this case the glyph will be rendered dilated. If zero, the glyph will be rendered in standard mode (without any outline effects).
segment — This parameter is used in conjunction with the thickness parameter. More precisely, when thickness is non-zero, then segment can be used to indicate that the outline should be subdivided into a number of smaller segments (each consisting of a dash and a gap) so that the overall glyph appearance is dashed.
The value of the segment parameter indicates the desired length of a single segment, in pixels. Each segment consists of a dash and a gap. The dash takes approximately two thirds of the segment's length, while the gap uses the remaining one third. Therefore, if segment is set to 30 pixels, then each dash will be approximately 20 pixels in length while each gap will be approximately 10 pixels in length.
At present this parameter must be non-negative. It should be set to zero if the segments are not desired or if thickness is set to zero. In this case the outline will appear solid and continuous.
reserved — Reserved for future use. Must be set to 0.
descriptor — Describes transform, which is a union that holds a transformation that is specified using raw transformation parameters or a 2x2 transformation matrix. If descriptor is set to 0, transform holds raw transformation parameters. If descriptor is set to 1, transform holds a 2x2 transformation matrix. At present, any other values are illegal.
transform — A union that holds a transformation to apply to a glyph or character. At present, this transformation can be specified using either raw transformation parameters or a 2x2 transformation matrix. This union is fully defined by the DT_TRANSFORM type.
This is a complex structure type that contains information about typographical properties of a glyph or character. The structure is utilized by the dtTypesetterSetTypeEffects, dtTypesetterSetTypeEffectsTransformed and dtTypesetterGetTypeEffects functions.
This structure type has the same purpose as DT_TYPE_ATTRIBS but is more powerful.
The DT_TYPE_EFFECTS structure is defined as follows:
/* Type (typographical properties of a glyph or character) */ typedef struct { DT_ID_SWORD font_index; /* Font index from Font Catalog */ DT_UBYTE reserved; /* Must be set to 0 */ DT_ID_UBYTE descriptor; /* 0=transformation via raw params, 1=transformation via 2x2 matrix */ DT_TRANSFORM transform; DT_LINEDECOR linedecor; } DT_TYPE_EFFECTS;
This structure consists of the following components:
font_index — Uniquely identifies a font in the Font Catalog.
reserved — Reserved for future use. Must be set to 0.
descriptor — Describes transform, which is a union that holds a transformation that is specified using raw transformation parameters or a 2x2 transformation matrix. If descriptor is set to 0, transform holds raw transformation parameters. If descriptor is set to 1, transform holds a 2x2 transformation matrix. At present, any other values are illegal.
transform — A union that holds a transformation to apply to a glyph or character. At present, this transformation can be specified using either raw transformation parameters or a 2x2 transformation matrix. This union is fully defined by the DT_TRANSFORM type.
linedecor — Line decoration parameters defined by the DT_LINEDECOR structure.
This is a union type that describes the transformation to be applied to a glyph or character. Currently, a transformation can be specified in two different ways:
Therefore, this union is defined as follows:
/* Transformation to be applied to a glyph or character */ typedef union { DT_TRANSFORM_PARAMS params; /* Transformation via raw params */ DT_TRANSFORM_MATRIX matrix; /* Transformation via 2x2 matrix */ } DT_TRANSFORM;
If the transformations is specified using raw transformation parameters, the following structure type is used:
/* Transformation specified using raw transformation parameters */ typedef struct { DT_SRAST_L size_h, size_v; /* Horizontal and vertical size in pixels (or subpixels) */ DT_SWORD skew_h, skew_v; /* Horizontal and vertical skew in degrees */ DT_SWORD rotation; /* Rotation in degrees, must be between 0 and 360 */ } DT_TRANSFORM_PARAMS;
This structure consists of the following components:
size_h — Font width in pixels (or subpixels). If negative, glyphs will be mirrored vertically. This value may be in subpixels (i.e. multiplied by an integer) to support fractional scaling in the horizontal direction. See dtTypesetterSetSizeSubscale for details.
size_v — Font height in pixels (or subpixels). If negative, glyphs will be mirrored horizontally. This value may be in subpixels (i.e. multiplied by an integer) to support fractional scaling in the vertical direction. See dtTypesetterSetSizeSubscale for details.
skew_h — Horizontal skew for the font in degrees. If the angle is positive, glyphs will be slanted to the left. If the angle is negative, glyphs will be slanted to the right. This value must be between -89 and 89 degrees. Values smaller than -45 degrees or larger than 45 degrees are not recommended and should be avoided.
skew_v — Vertical skew for the font in degrees. If the angle is positive, glyphs will be slanted downwards. If the angle is negative, glyphs will be slanted upwards. This value must be between -89 and 89 degrees. Values smaller than -45 degrees or larger than 45 degrees are not recommended and should be avoided.
rotation — Font rotation in degrees. Must be between 0 and 360.
If the transformations is specified using a 2x2 transformation matrix, the following structure type is used:
/* Transformation specified using a 2x2 transformation matrix */ typedef struct { DT_SRAST_L tm_00, tm_01; /* m[0][0] and m[0][1] multiplied by 262144 */ DT_SRAST_L tm_10, tm_11; /* m[1][0] and m[1][1] multiplied by 262144 */ } DT_TRANSFORM_MATRIX;
Here, the tm_00, tm_01, tm_10 and tm_11 are transformation parameters premultiplied by 262144 and expressed as 32-bit signed integers. In other words, the transformation parameters are 14.18 signed fractional values. Mathematically:
tm_00 = m[0][0] * 262144
tm_01 = m[0][1] * 262144
tm_10 = m[1][0] * 262144
tm_11 = m[1][1] * 262144
As with the DT_TM2X2 data type, the transformation is described by the following formula:
tx = m[0][0] * x + m[0][1] * y
ty = m[1][0] * x + m[1][1] * y
Again, in these equations x and y represent the original point coordinates, m[i][j] represent floating-point transformation parameters, and tx and ty represent the final (transformed) coordinates.
This structure type contains information about D-Type's memory (off-screen) surfaces.
/* D-Type's memory (off-screen) surface */ typedef struct { DT_SRAST_L w, h; /* Surface's dimensions in pixels */ DT_UBYTE* m; /* Pointer to surface's memory buffer */ DT_SLONG l; /* Length of the buffer in bytes (defines pitch) */ } DT_MDC;
The structure members have the following purpose:
w — width of the memory surface in pixels. This value must be positive.
h — height of the memory surface in pixels. D-Type supports bottom-to-top and top-to-bottom surfaces. A positive h value indicates a bottom-to-top surface; a negative h value indicates a top-to-bottom surface. The value 0 is illegal.
m — pointer to a memory buffer that stores the surface's pixels. Depending on the format of the surface, each pixel in the buffer is represented with 8, 16, 24 or 32 bits (i.e. 1, 2, 3 or 4 bytes per pixel).
l — length of the memory buffer in bytes; must equal pitch * abs(h)
In the above equation, pitch is the distance, in bytes, between two memory addresses in the buffer that represent the beginning of two neighbouring pixel rows. Each pixel row consists of precisely w * bytes per pixel bytes that represent the surface's pixels. Consequently, a valid pitch value must not be less than w * bytes per pixel. A pitch value that is exactly w * bytes per pixel bytes indicates that the pixel rows are contiguous; in other words there are no extra bytes between the neighbouring pixel rows. A pitch value that is larger than w * bytes per pixel bytes indicates that the pixel rows are non contiguous; in other words at the end of each row there are some extra bytes (the number of extra bytes is pitch - w * bytes per pixel). Note that when rendering to the memory surface D-Type never reads or writes these extra bytes.
Although not explicitly specified, pitch is an important value that has a direct impact on how D-Type renders pixels to your memory surface. To obtain the surface's pitch, D-Type divides the length of the memory buffer l by the absolute height of the memory surface h. For this reason, you must ensure that l is divisible by abs(h) and that the result of this division is not less than w * bytes per pixel. If these conditions are not met, your pitch value is not properly defined and D-Type will assume the value w * bytes per pixel instead.
This structure type contains information about D-Type's 8-bit grayscale memory bitmaps.
/* D-Type's 8-bit grayscale memory bitmap */ typedef struct { DT_SRAST_L x, y; /* Bitmap's origin point in pixels */ DT_SRAST_L w, h; /* Bitmap's dimensions in pixels */ DT_UBYTE* m; /* Pointer to bitmap's memory buffer */ DT_SLONG l; /* Length of the buffer in bytes */ } DT_BMP;
The structure members have the following purpose:
m — pointer to a memory buffer that stores the 8-bit grayscale bytes. In regular bitmaps (i.e. bitmaps that are neither LCD-optimized nor LCD2-optimized), each pixel is represented with 8 bits (1 byte), where 0 means black (fully opaque) and 255 means white (fully transparent). As a result, each scan-line in those bitmaps consists of exactly w bytes. In LCD-optimized bitmaps, each pixel is represented with 3 bytes: the first byte is for the R (or B) subpixel intensity, the second one is for the G subpixel intensity and the third one is for the B (or R) subpixel intensity. As a result, each scan-line in those bitmaps consists of exactly 3 * w bytes. Finally, In LCD2-optimized bitmaps, each pixel is represented with 2 bytes: the first byte is for the G subpixel intensity, the second one is for the combined BR (or RB) subpixel intensity. As a result, each scan-line in those bitmaps consists of exactly 2 * w bytes.
l — length of the memory buffer in bytes, calculated as follows:
w — width of the bitmap in pixels. Must be a positive value unless noted otherwise (e.g. in dtGlyphDoOutput). For best performance on all platforms, this value should be a multiple of 4.
h — height of the bitmap in pixels. Must be a positive value unless noted otherwise (e.g. in dtGlyphDoOutput).
x — difference between the bitmap's left edge and its origin in pixels
y — difference between the bitmap's origin and its top edge in pixels
This structure type provides additional initialization information to D-Type Engine and receives additional initialization information from D-Type Engine. For details, see the dtEngineIniViaStream function.
/* Additional initialization information */ typedef struct { DT_SLONG init_key; /* Initialization key (0=demo) */ DT_SWORD init_flag; /* Initialization flag (0=demo) */ DT_SWORD init_status; /* Set by D-Type Engine, provides extended initialization information */ DT_SWORD reserved1; /* Must be set to 0 */ DT_SWORD reserved2; /* Must be set to 0 */ void* reserved3; /* Must be set to DV_NULL */ void* reserved4; /* Must be set to DV_NULL */ } DT_INIT_INFO;
This structure type describes a stream. In D-Type API, a stream is an abstract object that represent a file in some location. Presently, this location can be disk (local or network), memory (RAM) or a local or remote web server (e.g. a Web server on the Internet or local network).
/* Stream structure */ typedef struct { DT_ID_UBYTE stream_id; DT_UBYTE flags; DT_UBYTE reserved1; DT_UBYTE reserved2; union { /* File Stream */ const DT_CHAR* file_name; /* used when stream_id=0 or stream_id=1, for reading and writing */ /* Memory Stream */ struct { const DT_UBYTE* addr; DT_SLONG len; } mem_r; /* used when stream_id=2, for reading */ struct { DT_UBYTE* addr; DT_SLONG len; } mem_w; /* used when stream_id=2, for writing */ /* URL, FURL and MURL Streams */ const DT_CHAR* url; /* used when stream_id=3, stream_id=5 or stream_id=6, for reading only */ /* File-Pointer Stream */ FILE* file_ptr; /* used when stream_id=4, for reading and writing */ } stream_locator; } DT_STREAM_DESC;
The structure members have the following purpose:
stream_id — This member identifies the stream type. At present, this member can have one of the following values:
stream_id = 0 — Default Stream Type. Same as stream_id = 1.
stream_id = 1 — File Stream. This stream type can be used for either reading or writing. In either case the file_name member of the stream_locator union is used. The file_name member is a valid pointer to the standard ANSI C/C++ string which contains the path of the file on disk (UTF-8 encoding is supported).
stream_id = 2 — Memory Stream. This stream type can be used for either reading or writing. The mem_r member of the stream_locator union is used when the stream is for reading; the mem_w member of the stream_locator union is used when the stream is for writing. Both members are defined as a structure that consists of two members: addr and len. The addr member is a pointer to the memory address at which the file begins while len is the size of the memory file, in bytes. When the stream is for reading, addr is defined as a pointer to const, which protects applications from accidentally writing to the memory address pointed by addr.
stream_id = 3 — URL Stream. This stream type can be used only for reading. In this case the url member of the stream_locator union is used. The url member is a valid pointer to the standard ANSI C/C++ string which contains the location (URL) of the file on a local or remote server (e.g. a Web server on the Internet or local network).
At present, URL can be used to identify a single transport protocol: the HTTP protocol version 1.1. As a result, the first seven characters of the string pointed by url must be "http://". Additionally, the Web server on which the referenced file resides must support partial content delivery via the HTTP 1.1 protocol (e.g. Microsoft Internet Information Server or Apache Server). This protocol provides truly random access to files over the Internet or local network (LAN). The older HTTP 1.0 protocol is not suitable for random file access and, therefore, not supported. Also, authenticated HTTP access and HTTP redirects are presently not supported.
Care must be taken when using this stream type. Accessing files that reside on a non-trusted server can have a negative or even damaging effect on your application. Also, this is inherently a slow access method. Accessing files from disk or memory is usually much faster. Ideally, use this stream type on a local network (LAN) and in a trusted environment.
The URL Stream is only available on platforms that support Berkeley sockets (e.g. Linux, macOS, Windows).
stream_id = 4 — File-Pointer Stream. This stream type can be used for either reading or writing. In either case the file_ptr member of the stream_locator union is used. However, this stream type is not presently documented.
stream_id = 5 — FURL Stream (also called File-Backed URL Stream). Same as the URL Stream (stream_id = 3), except that the entire remote file is first downloaded to local disk, and then read from there. This is a noticeably faster way to read a remote file compared to the URL Stream.
The url member is a valid pointer to the standard ANSI C/C++ string which contains the path prefix for the local file to be created (relative to the current working directory), followed by the '~' character, followed by the location (URL) of the file on a local or remote server (e.g. a Web server on the Internet or local network). The first seven characters after '~' must be "http://". For example:
system/tmp/www_~http://www.remotefontserver.com/config/dtype.inf
stream_id = 6 — MURL Stream (also called Memory-Backed URL Stream). Same as the URL Stream (stream_id = 3), except that the entire remote file is first downloaded to memory, and then read from there. This is the fastest way to read a remote file, however it requires the most memory.
The url member is a valid pointer to the standard ANSI C/C++ string which contains the location (URL) of the file on a local or remote server (e.g. a Web server on the Internet or local network). The first seven characters of the string pointed by url must be "http://".
flags — Must be set to 0.
reserved1 — Reserved for future use. Must be set to 0.
reserved2 — Reserved for future use. Must be set to 0.
stream_locator — This is a union that supplies the actual location of the stream. Depending on the value of the stream_id member variable, different union members are used. See above for details.
Rather than setting the members of the DT_STREAM_DESC structure one by one, applications can use the following stream macros to easily create streams that represent files on disk, files in memory (RAM) or files on a local or remote web server:
This macros declares the sd variable as a stream that represent a file on disk. The path of the file is _file_name. This macro has the same effect as the following code:
DT_STREAM_DESC sd; sd.stream_id=1; sd.flags=0; sd.reserved1=0; sd.reserved2=0; sd.stream_locator.file_name=_file_name;
This macros declares the sd variable as a stream that represent a file in memory. The file begins at memory address _mem_addr and its size is _mem_len bytes. This macro has the same effect as the following code:
DT_STREAM_DESC sd; sd.stream_id=2; sd.flags=0; sd.reserved1=0; sd.reserved2=0; sd.stream_locator.mem_r.addr=_mem_addr; sd.stream_locator.mem_r.len=_mem_len;
This macros declares the sd variable as a stream that represent a file on a web server. The URL of the file is _url. This macro has the same effect as the following code:
DT_STREAM_DESC sd; sd.stream_id=3; sd.flags=0; sd.reserved1=0; sd.reserved2=0; sd.stream_locator.url=_url;
This macros declares the sd variable as a stream that represent a file on a web server. The URL of the file is contained within _url (i.e. _url contains the path prefix for the local file to be created relative to the current working directory, followed by the '~' character, followed by the URL of the file). This macro has the same effect as the following code:
DT_STREAM_DESC sd; sd.stream_id=5; sd.flags=0; sd.reserved1=0; sd.reserved2=0; sd.stream_locator.url=_url;
This macros declares the sd variable as a stream that represent a file on a web server. The URL of the file is _url. This macro has the same effect as the following code:
DT_STREAM_DESC sd; sd.stream_id=6; sd.flags=0; sd.reserved1=0; sd.reserved2=0; sd.stream_locator.url=_url;
For details on how to use these stream macros, see the How To Use D-Type Streams And Stream Macros section of this manual.