# statefile.c File Reference

`#include <stdio.h>`
`#include <errno.h>`
`#include <string.h>`
`#include "libdali.h"`

Include dependency graph for statefile.c:

## Functions
int | dl_savestate (DLCP *dlconn, const char *statefile)
| Save a DataLink connection state to a file.
int | dl_recoverstate (DLCP *dlconn, const char *statefile)
| Recover DataLink connection state from a file.

## Detailed Description

:

Routines to save and recover DataLink state information to/from a file.

Author:
  Chad Trabant, IRIS Data Management Center

modified: 2008.040

## Function Documentation

int dl_recoverstate | ( | DLCP * | dlconn,
|  | const char * | statefile |
| ) |  |  |

Recover DataLink connection state from a file.

Recover connection state from a state file and set the state parameters in a given DataLink Connection Paramters.

Parameters:

  | dlconn | DataLink Connection Parameters
  | statefile | File to recover state from

Return values:

  | -1 | Error
  | 0 | Completed successfully
  | 1 | File could not be opened (probably not found)

int dl_savestate | ( | DLCP * | dlconn,
|  | const char * | statefile |
| ) |  |  |

Save a DataLink connection state to a file.

Save the all the current the sequence numbers and time stamps into the given state file.

Parameters:

  | dlconn | DataLink Connection Parameters
  | statefile | File to save state to

Return values:

  | -1 | Error
  | 0 | Completed successfully