- minor fixes and improvements

This commit is contained in:
zolliker
2008-02-13 09:59:23 +00:00
parent 327f595fa6
commit 217de95b29
5 changed files with 294 additions and 499 deletions

14
ascon.h
View File

@ -10,7 +10,7 @@
/** \brief the asynchronous connection
*/
typedef struct Ascon *AsconPtr;
typedef struct Ascon Ascon;
/** \brief the possible results of AsconTask
*/
@ -29,18 +29,18 @@ typedef enum {
* are protocol specific, but argv[1] is usually host::port
* \return the created connection or NULL on failure
*/
AsconPtr AsconMake(SConnection *con, int argc, char *argv[]);
Ascon *AsconMake(SConnection *con, int argc, char *argv[]);
/** \brief kill function
* \param a the connection to be killed
*/
void AsconKill(AsconPtr a);
void AsconKill(Ascon *a);
/** \brief the task handler. To be called repeatedly.
* \param a the connection
* \return the state of the connection
*/
AsconStatus AsconTask(AsconPtr a);
AsconStatus AsconTask(Ascon *a);
/** \brief write to the connection. allowed only when the state is ascon_ready
* \param a the connection
@ -48,7 +48,7 @@ AsconStatus AsconTask(AsconPtr a);
* \param noResponse 0 normally, 1 if no reponse is expected
* \return 1 on success, 0 when not ready
*/
int AsconWrite(AsconPtr a, char *command, int noResponse);
int AsconWrite(Ascon *a, char *command, int noResponse);
/** \brief read from the connection. allowed only when a response is available
* \param a the connection
@ -58,12 +58,12 @@ int AsconWrite(AsconPtr a, char *command, int noResponse);
* The result is only valid until the next call to other AsconXxx functions
* and has to be duplicated if needed later.
*/
char *AsconRead(AsconPtr a);
char *AsconRead(Ascon *a);
/** \brief get the connections error list
* \return the error list
*/
ErrMsgList *AsconGetErrList(AsconPtr a);
ErrMsgList *AsconGetErrList(Ascon *a);
/** \brief a helper function
* \param argc the number of args