Пример #1
0
/**
 * @brief
 *      Converts <value> into a Data-is-Strings unsigned integer and sends
 *      it to <stream>.
 *
 * @param[in] stream    socket fd
 * @param[in] value     value to be converted
 *
 * @return      int
 * @retval      DIS_SUCCESS     success
 * @retval      error code      error
 *
 */
int
diswui(int stream, unsigned value)
{
	int		retval;

	assert(disw_commit != NULL);

	retval = diswui_(stream, value);
	return (((*disw_commit)(stream, retval == DIS_SUCCESS) < 0) ?
		DIS_NOCOMMIT : retval);
}
Пример #2
0
int diswui(
    
  struct tcp_chan *chan,
  unsigned value)

  {
  int  retval;

  retval = diswui_(chan, value);
  return ((tcp_wcommit(chan, retval == DIS_SUCCESS) < 0) ?
          DIS_NOCOMMIT : retval);
  }
Пример #3
0
/**
 * @brief
 *	Converts a counted string in *<value> into a Data-is-Strings character
 *      string and sends it to <stream>.
 *
 * @param[in] stream - pointer to data stream
 * @param[in] value - value to be converted
 * @param[in] nchars - size of chars
 *
 * @return	int
 * @return	DIS_SUCCESS	success
 * @retval	error code	error
 *
 */
int
diswcs(int stream, const char *value, size_t nchars)
{
	int		retval;

	assert(disw_commit != NULL);
	assert(dis_puts != NULL);
	assert(nchars <= UINT_MAX);

	retval = diswui_(stream, (unsigned)nchars);
	if (retval == DIS_SUCCESS && nchars > 0 &&
		(*dis_puts)(stream, value, nchars) != nchars)
		retval = DIS_PROTO;
	return (((*disw_commit)(stream, retval == DIS_SUCCESS) < 0) ?
		DIS_NOCOMMIT : retval);
}
Пример #4
0
int diswcs(

    struct tcp_chan *chan,
    const char      *value,
    size_t           nchars)

{
    int retval;

    retval = diswui_(chan, (unsigned)nchars);

    if ((retval == DIS_SUCCESS) &&
            (nchars > 0) &&
            (tcp_puts(chan, value, nchars) != (int)nchars))
    {
        retval = DIS_PROTO;
    }

    return ((tcp_wcommit(chan, retval == DIS_SUCCESS) < 0) ?  DIS_NOCOMMIT : retval);
}
Пример #5
0
int diswcs(

  int          stream,
  const char  *value,
  size_t       nchars)

  {
  int retval;

  assert(disw_commit != NULL);
  assert(dis_puts != NULL);

  retval = diswui_(stream, (unsigned)nchars);

  if ((retval == DIS_SUCCESS) &&
      (nchars > 0) &&
      ((*dis_puts)(stream, value, nchars) != (int)nchars))
    {
    retval = DIS_PROTO;
    }

  return (((*disw_commit)(stream, retval == DIS_SUCCESS) < 0) ?  DIS_NOCOMMIT : retval);
  }