log_strongmotionII()

Prototype: |
void log_strongmotionII( | SM_INFO * sm);
Source File: | src/libsrc/util/rw_strongmotionII.c
Description: | Writes the contents of a SM_INFO structure to an Earthworm log file.
RETURN CODE INFO
Return Type: | void
PARAMETER INFO
Parameter | Type | Description
sm | SM_INFO * | Pointer to an SM_INFO struct whose contents the function will log to a file.
Group: | EW_LIBSRC
Sub Group: | RW_STRONGMOTION_II
Language: | C
Location: | ./include/rw_strongmotionII.h

rd_strongmotionII()

Prototype: |
int rd_strongmotionII( | char * msg, int msglen, SM_INFO * sm);
Source File: | src/libsrc/util/rw_strongmotionII.c
Description: | This function reads an ascii TYPE_STRONGMOTION2 message and fills in a SM_INFO structure. It returns 0 on success, -1 on failure.
Note: | Example of a TYPE_STRONGMOTION2 message. SCNL: CMB.BHZ.BK. TIME: 2001/02/25 02:37:00.000 ALT: 2001/02/25 02:40:40.000 CODE: 1 PGA: 6.846210 TPGA: 2001/02/25 02:37:00.000 PGV: 0.140000 TPGV: 2001/02/25 02:37:00.000 PGD: 0.000000 TPGD: 2001/02/25 02:37:00.000 RSA: 3/0.30 4.415404/1.00 0.925639/3.00 0.297907 QID: 41059467 014024003:UCB
RETURN CODE INFO
Return Type: | int
Return Value | Description
0 | Success.
-1 | Failure. See logfile for details.
PARAMETER INFO
Parameter | Type | Description
msg | char * | The strong motion message. The first line of the message should be the SCNL line.
msglen | int | The length of the msg in bytes.
sm | SM_INFO * | A pointer to an SM_INFO struct allocated by the caller, where the function will result the SM_INFO struct derived from the message.
Group: | EW_LIBSRC
Sub Group: | RW_STRONGMOTION_II
Language: | C
Location: | ./include/rw_strongmotionII.h

wr_strongmotionII()

Prototype: |
int wr_strongmotionII( | SM_INFO * sm, char * buf, int buflen);
Source File: | src/libsrc/util/rw_strongmotionII.c
Description: | Reads a SM_INFO structure and writes an ascii TYPE_STRONGMOTION2 message (null terminated). It returns 0 on success, and -1 on failure. See rd_strongmotion for an example of a TYPE_STRONGMOTION2 message.
RETURN CODE INFO
Return Type: | int
Return Value | Description
0 | Success.
-1 | Failure. This is caused by a buffer overflow, where the caller's buffer was too small to hold the entire message generated by the function. If the caller believes their buffer should be adequately large, then one or more of the strings in the SM_INFO struct may not be properly terminated.
PARAMETER INFO
Parameter | Type | Description
sm | SM_INFO * | Pointer to an SM_INFO struct that the function will read to get the information for the TYPE_STRONGMOTION2 message.
buf | char * | Pointer to a buffer allocated by the caller where the function will write the TYPE_STRONGMOTION2 message.
buflen | int | The length of the caller's buffer(buf) in bytes.
Group: | EW_LIBSRC
Sub Group: | RW_STRONGMOTION_II
Language: | C
Location: | ./include/rw_strongmotionII.h