class SysVIPC::Sembuf

Public Class Methods

new(*args) click to toggle source
SWIGINTERN VALUE
_wrap_new_sembuf(int argc, VALUE *argv, VALUE self) {
  struct sembuf *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  result = (struct sembuf *)calloc(1, sizeof(struct sembuf));
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}
new(sem_num, sem_op, sem_flg = 0) click to toggle source

Create a new Sembuf object for semaphore number sem_num, operation sem_op, and flags sem_flg. See semop(2).

    # File lib/SysVIPC.rb
177 def initialize(sem_num, sem_op, sem_flg = 0)
178   orig_initialize
179   self.sem_num = sem_num
180   self.sem_op = sem_op
181   self.sem_flg = sem_flg
182 end
Also aliased as: orig_initialize

Public Instance Methods

orig_initialize(sem_num, sem_op, sem_flg = 0)
Alias for: new
sem_flg(*args) click to toggle source
SWIGINTERN VALUE
_wrap_sembuf_sem_flg_get(int argc, VALUE *argv, VALUE self) {
  struct sembuf *arg1 = (struct sembuf *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  short result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_sembuf, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct sembuf *","sem_flg", 1, self )); 
  }
  arg1 = (struct sembuf *)(argp1);
  result = (short) ((arg1)->sem_flg);
  vresult = SWIG_From_short((short)(result));
  return vresult;
fail:
  return Qnil;
}
sem_flg=(*args) click to toggle source
SWIGINTERN VALUE
_wrap_sembuf_sem_flg_set(int argc, VALUE *argv, VALUE self) {
  struct sembuf *arg1 = (struct sembuf *) 0 ;
  short arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  short val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_sembuf, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct sembuf *","sem_flg", 1, self )); 
  }
  arg1 = (struct sembuf *)(argp1);
  ecode2 = SWIG_AsVal_short(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "short","sem_flg", 2, argv[0] ));
  } 
  arg2 = (short)(val2);
  if (arg1) (arg1)->sem_flg = arg2;
  return Qnil;
fail:
  return Qnil;
}
sem_num(*args) click to toggle source
SWIGINTERN VALUE
_wrap_sembuf_sem_num_get(int argc, VALUE *argv, VALUE self) {
  struct sembuf *arg1 = (struct sembuf *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned short result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_sembuf, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct sembuf *","sem_num", 1, self )); 
  }
  arg1 = (struct sembuf *)(argp1);
  result = (unsigned short) ((arg1)->sem_num);
  vresult = SWIG_From_unsigned_SS_short((unsigned short)(result));
  return vresult;
fail:
  return Qnil;
}
sem_num=(*args) click to toggle source
SWIGINTERN VALUE
_wrap_sembuf_sem_num_set(int argc, VALUE *argv, VALUE self) {
  struct sembuf *arg1 = (struct sembuf *) 0 ;
  unsigned short arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned short val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_sembuf, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct sembuf *","sem_num", 1, self )); 
  }
  arg1 = (struct sembuf *)(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_short(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned short","sem_num", 2, argv[0] ));
  } 
  arg2 = (unsigned short)(val2);
  if (arg1) (arg1)->sem_num = arg2;
  return Qnil;
fail:
  return Qnil;
}
sem_op(*args) click to toggle source
SWIGINTERN VALUE
_wrap_sembuf_sem_op_get(int argc, VALUE *argv, VALUE self) {
  struct sembuf *arg1 = (struct sembuf *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  short result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_sembuf, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct sembuf *","sem_op", 1, self )); 
  }
  arg1 = (struct sembuf *)(argp1);
  result = (short) ((arg1)->sem_op);
  vresult = SWIG_From_short((short)(result));
  return vresult;
fail:
  return Qnil;
}
sem_op=(*args) click to toggle source
SWIGINTERN VALUE
_wrap_sembuf_sem_op_set(int argc, VALUE *argv, VALUE self) {
  struct sembuf *arg1 = (struct sembuf *) 0 ;
  short arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  short val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_sembuf, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct sembuf *","sem_op", 1, self )); 
  }
  arg1 = (struct sembuf *)(argp1);
  ecode2 = SWIG_AsVal_short(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "short","sem_op", 2, argv[0] ));
  } 
  arg2 = (short)(val2);
  if (arg1) (arg1)->sem_op = arg2;
  return Qnil;
fail:
  return Qnil;
}