Пример #1
0
static PyObject*
Context_setxattr (Context *self, PyObject *args)
{
  int ret;
  char *uri = NULL;
  char *name = NULL;
  char *value = NULL;
  unsigned int flags;
  static smbc_setxattr_fn fn;


  if (!PyArg_ParseTuple (args, "sssi", &uri, &name, &value, &flags))
    {
      return NULL;
    }

  if (!value)
    {
      return NULL;
    }

  errno = 0;
  fn = smbc_getFunctionSetxattr (self->context);

  ret = (*fn)(self->context, uri, name, value, strlen (value), flags);

  if (ret < 0)
    {
      pysmbc_SetFromErrno ();
      return NULL;
    }

  return PyLong_FromLong (ret);
}
Пример #2
0
int
smbc_lsetxattr(const char *fname,
               const char *name,
               const void *value,
               size_t size,
               int flags)
{
        return smbc_getFunctionSetxattr(statcont)(statcont,
                                                  fname, name,
                                                  value, size, flags);
}
Пример #3
0
int
smbc_fsetxattr(int fd,
               const char *name,
               const void *value,
               size_t size,
               int flags)
{
	SMBCFILE * file = find_fd(fd);
	if (file == NULL) {
		errno = EBADF;
		return -1;
	}
        return smbc_getFunctionSetxattr(statcont)(statcont,
                                                  file->fname, name,
                                                  value, size, flags);
}