* * $Log$ * *
Definiert in Datei utils.c.
gehe zum Quellcode dieser Datei
Makrodefinitionen | |
#define | MAX_HEADERLINE_SIZE 255 |
Funktionen | |
int | TcpHostConnect (TCPSOCKET *sock, CONST char *rhost, u_short port) |
Connect TCP host. | |
FILE * | TcpStreamAccept (TCPSOCKET *sock, u_short port, char *mode) |
int | TcpGetBuffer (TCPSOCKET *sock, char *buff, u_int size, u_int *status) |
Get a specified number of characters from TCP socket connection. | |
int | TcpGetTag (TCPSOCKET *sock, char *tag, int size) |
char * | LocateAttributeString (CONST char *tag, CONST char *name) |
int | TcpGetLine (TCPSOCKET *sock, char *line, u_short size) |
Get line from TCP socket connection. | |
int | TcpPutString (TCPSOCKET *sock, char *str) |
Send complete string via TCP. | |
int | TcpGetHeaderLines (TCPSOCKET *sock, char ***array) |
Get header line array from TCP socket connection. | |
void | TcpReleaseHeaderLines (char **array) |
Release previously allocated memory for the header lines. | |
void | HttpSchemeRelease (HTTP_SCHEME *schm) |
HTTP_SCHEME * | HttpSchemeParse (CONST char *uri) |
void | Led0 (int on) |
Switch LED0 on or off. | |
char * | strdup (CONST char *str) |
Create a copy of a string. |
#define MAX_HEADERLINE_SIZE 255 |
int TcpHostConnect | ( | TCPSOCKET * | sock, | |
CONST char * | rhost, | |||
u_short | port | |||
) |
Connect TCP host.
Definiert in Zeile 68 der Datei utils.c.
Wird benutzt von OpenTcpStream(), ShoutCastGetPlayList() und StationConnect().
FILE* TcpStreamAccept | ( | TCPSOCKET * | sock, | |
u_short | port, | |||
char * | mode | |||
) |
Definiert in Zeile 92 der Datei utils.c.
Wird benutzt von Service(), XmlCmdService() und XmlRepoService().
int TcpGetBuffer | ( | TCPSOCKET * | sock, | |
char * | buff, | |||
u_int | size, | |||
u_int * | status | |||
) |
Get a specified number of characters from TCP socket connection.
The low level NutTcpReceive() routine may return less than the number of bytes specified. This routine makes sure, that the complete buffer is filled. However, an additional pointer to a status is passed to this routine. If the status changes, the routine will be aborted.
Any TCP receive timeout is ignored, but required in order to detect status changes.
sock | Socket descriptor. This pointer must have been retrieved by calling NutTcpCreateSocket(). In addition a connection must have been established by calling NutTcpConnect() or NutTcpAccept(). | |
buff | Pointer to the buffer. | |
size | Size of the buffer. | |
status | Pointer to a status. |
Definiert in Zeile 143 der Datei utils.c.
Wird benutzt von ProcessMetaData().
char* LocateAttributeString | ( | CONST char * | tag, | |
CONST char * | name | |||
) |
int TcpGetLine | ( | TCPSOCKET * | sock, | |
char * | line, | |||
u_short | size | |||
) |
Get line from TCP socket connection.
ASCII codes below 32 or above 127 are discarded.
sock | Socket descriptor. This pointer must have been retrieved by calling NutTcpCreateSocket(). In addition a connection must have been established by calling NutTcpConnect() or NutTcpAccept(). | |
line | Pointer to the buffer that receives the string. | |
size | Size of the buffer. If the received line doesn't fit, then remaining characters will be discarded. |
Definiert in Zeile 261 der Datei utils.c.
Wird benutzt von ShoutCastGetPlayList() und TcpGetHeaderLines().
int TcpPutString | ( | TCPSOCKET * | sock, | |
char * | str | |||
) |
Send complete string via TCP.
The low level NutTcpSend() routine limits the number of bytes to the maximum segment size of the connection. This routine makes sure, that the complete string is transmitted.
sock | Socket descriptor. This pointer must have been retrieved by calling NutTcpCreateSocket(). In addition a connection must have been established by calling NutTcpConnect() or NutTcpAccept(). | |
str | Pointer to a buffer containing the string to send. |
Definiert in Zeile 301 der Datei utils.c.
Wird benutzt von ShoutCastGetPlayList() und StationConnect().
int TcpGetHeaderLines | ( | TCPSOCKET * | sock, | |
char *** | array | |||
) |
Get header line array from TCP socket connection.
Receives lines from a TCP stream until the first empty line appears and stores all lines in an array of strings. The empty line is not stored, but the last pointer of the array is set to NULL.
The routine allocates the array and all string. The caller should use TcpReleaseHeaderLines() to release all allocated memory.
sock | Socket descriptor. This pointer must have been retrieved by calling NutTcpCreateSocket(). In addition a connection must have been established by calling NutTcpConnect() or NutTcpAccept(). | |
array | Pointer to a string array pointer, which receives the address of the newly allocated string array. If no non-empty lines were received or if an error occured, then the string array pointer will be set to NULL. |
Definiert in Zeile 338 der Datei utils.c.
Wird benutzt von StationConnect().
void TcpReleaseHeaderLines | ( | char ** | array | ) |
Release previously allocated memory for the header lines.
Should be called to release all memory allocated by TcpGetHeaderLines().
array | String array to be released. |
Definiert in Zeile 428 der Datei utils.c.
Wird benutzt von StationDisconnect().
void HttpSchemeRelease | ( | HTTP_SCHEME * | schm | ) |
Definiert in Zeile 442 der Datei utils.c.
Wird benutzt von HttpSchemeParse(), ShoutCastAddStation(), ShoutCastGetGenreList(), ShoutCastGetPlayList(), ShoutCastGetStationList() und StationConnect().
HTTP_SCHEME* HttpSchemeParse | ( | CONST char * | uri | ) |
Definiert in Zeile 453 der Datei utils.c.
Wird benutzt von ShoutCastAddStation(), ShoutCastGetGenreList(), ShoutCastGetPlayList(), ShoutCastGetStationList() und StationConnect().
void Led0 | ( | int | on | ) |
char* strdup | ( | CONST char * | str | ) |
Create a copy of a string.
Allocates sufficient memory from heap for a copy of the string does the copy.
Missing Nut/OS function.
str | Pointer to the string to copy. |
Definiert in Zeile 541 der Datei utils.c.
Wird benutzt von FavListCopy(), FavListLoad(), FavListSet(), HttpSchemeParse() und ProcessMetaData().