---
name: "youbin_sub"
section: "3"
platform: "linux"
package: "youbin-dev"
version: "3.4-2"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/youbin_sub"
---

# youbin\_sub(3)

Communication library for client of youbin protocol

## NAME

youbin\_sub - Communication library for client of youbin protocol

## SYNOPSIS

```
#include <local/youbin.h>
```

```
youbin_sub(server_name, option_list, user_func, file_id)
char  ∗server_name;
char  ∗option_list;
void  (∗user_func)(size, date, mess);
int   file_id;
```

## DESCRITPTION

youbin\_sub is an interface for client program which communicates by the youbin protocol. Once this function is called, the control does not return to the call routine until the communication with the mail server terminates. youbin\_sub requests the connection with the user name to the host specified by server\_name. After the connection is established, the watch of user's mail spool starts. The state of the mail spool will be informed of from the server at change of the state and regular intervals of time. youbin\_sub informs the call routine of received information through user\_func. At this time, the first argument is the size of the spool, the second is the modified time of the spool, and the third is the content of a header and the first part of the arrival mail. The third argument is a pointer to the NULL string when the mail is read out or when the sever checks the spool periodically.  It is specified with option\_list whether information such as headers is necessary or not. Because user\_func is called even when there is no change in the size of the sool file, it is necessary to preserve size and date to examine whether the call is cause by the change of the spool state or by the periodic call.

To pass information to youbin\_sub after the control is passed to youbin\_sub, the caller writes some command to the file number specified with file\_id. The command "Update" demands re-check on the state of the spool. This command is prepared to inform the server of reading out from the spool. The server checks the current state of the spool. Another command, "Quit" is provided to inform of the termination of client program. Because the server removes the user name from the administration table if there is no response from clients within the fixed time, "Quit" need not be necessarily sent to terminate. If these information need not be sent to youbin\_sub, -1 will be specified for file\_id.

Being prepared as option are "Debug" and "Biff" at this moment. If both are specified, the notation is "Debug,Biff" ("Biff,Debug" is another notation)  If Debug is specified, the content of the packet from/to the server will be displayed. If Biff is specified, some information such as headers and a part of contents will be sent to user\_func as the third argument.

## RETURN VALUE

0 will be returned when youbin\_sub ends normally. Other values indicate error return.

```
ERR_USER    1  : Illegal user name
ERR_HOST    2  : No daemon at the specified server host.
ERR_SERVICE 3  : Service ("biff" in general) is not found.
ERR_SOCKET  4  : The socket cannot be opened.
ERR_BIND    5  : Can not bind with teh socket.
ERR_NAK     6  : The connection was refused by the server.
ERR_RTRY    7  : There is no response from the server.
RET_QUIT    91 : Receive of "Quit" from the server.
```

## SEE ALSO

**[youbin(1)](/youbin/1.md), youbind(1), [xyoubin(1)](/xyoubin/1.md)**

## AUTHORS

**Kiyoshi Agusa           agusa@nuie.nagoya-u.ac.jp**\
 **Shinichirou Yamamoto    yamamoto@nuie.nagoya-u.ac.jp**
