Parse4610Stream

 

int parse4610Stream(ubyte *stream_buff, uint stream_len, ubyte *last_cmd_buff,

         uint last_cmd_len, ubyte **cmd_buffp, uint *cmd_lenp,

         parse4610CommandInfo_t *cmdIp, parse4610ContinueInfo_t *cIp);

                       

Parameters

stream_buff

[in] Pointer to printer command stream.

stream_len

[in] Length of data in stream.

last_cmd_buff

[in] Pointer returned on last call. NULL if first call.

last_cmd_len

[in] Cmd len returned on last call. 0 if first call.

cmd_buffp,

[out] Return pointer - points to next command in the stream.

cmd_lenp

[in] Return command len - len of next command

cmdIp

[out] Pointer to structure containing additional info about the returned sub-command.

cIp

[in/out] Pointer to structure that keeps track of information about commands that require continuation data. Structure should be set to all 0’s at initialization

Return Value

Return values greater than or equal to zero: number of bytes remaining to be processed.

Values less than zero indicate an error.

Remarks

parse4610Streamis called iteratively on a 4610 command stream. A 4610 command stream is a buffer that contains one or more 4610 commands. Some commands span multiple streams and parse4610Streamhas the ability to handle these multi-stream commands. Examples of multi-stream commands include commands that store graphics data in the printer.

 

Example

Also see Parse4610Sample.

char *buffp;

int len_remain;

uint cmd_len;

parse4610CommandInfo_t cmdI;

parse4610ContinueInfo_t continuI;

 

len_remain = in_len;

buffp = in_buff;

cmd_len = 0;

while(len_remain > 0)

{

len_remain = parse4610Stream(in_buff, in_len, buffp, cmd_len, &buffp, &cmd_len, &cmdI, &continueI);

if (len_remain < 0)

break;

switch (cmdI.cmd_code)

{

}

}

 

Requirements

Header: Declared in pars4610.h; include pars4610.h, 4610cmds.h

 

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)