pike.git / src / modules / _Stdio / socket.c

version» Context lines:

pike.git/src/modules/_Stdio/socket.c:246:    */   static void port_bind(INT32 args)   {    struct port *p = THIS;    PIKE_SOCKADDR addr;    int addr_len,fd,tmp;       do_close(p);       if(args < 1) -  SIMPLE_TOO_FEW_ARGS_ERROR("Port->bind", 1); +  SIMPLE_TOO_FEW_ARGS_ERROR("bind", 1);       if(TYPEOF(Pike_sp[-args]) != PIKE_T_INT &&    (TYPEOF(Pike_sp[-args]) != PIKE_T_STRING ||    Pike_sp[-args].u.string->size_shift)) -  SIMPLE_BAD_ARG_ERROR("Port->bind", 1, "int|string (8bit)"); +  SIMPLE_BAD_ARG_ERROR("bind", 1, "int|string(8bit)");       addr_len = get_inet_addr(&addr, (args > 2 && TYPEOF(Pike_sp[2-args])==PIKE_T_STRING?    Pike_sp[2-args].u.string->str : NULL),    (TYPEOF(Pike_sp[-args]) == PIKE_T_STRING?    Pike_sp[-args].u.string->str : NULL),    (TYPEOF(Pike_sp[-args]) == PIKE_T_INT?    Pike_sp[-args].u.integer : -1), 0);    INVALIDATE_CURRENT_TIME();       fd=fd_socket(SOCKADDR_FAMILY(addr), SOCK_STREAM, 0);
pike.git/src/modules/_Stdio/socket.c:482:    (TYPEOF(Pike_sp[-args]) == PIKE_T_STRING &&    (Pike_sp[-args].u.string->len != 5 ||    strcmp("stdin",Pike_sp[-args].u.string->str))))    {    port_bind(args); /* pops stack */    return;    }else{    struct port *p = THIS;       if(TYPEOF(Pike_sp[-args]) != PIKE_T_STRING) -  SIMPLE_TOO_FEW_ARGS_ERROR("Port->create", 1); +  SIMPLE_TOO_FEW_ARGS_ERROR("create", 1);       /* FIXME: Check that the argument is "stdin". */       do_close(p);    change_fd_for_box (&p->box, 0);       if(fd_listen(p->box.fd, 16384) < 0)    {    p->my_errno=errno;    }else{
pike.git/src/modules/_Stdio/socket.c:659:    *!    *! @seealso    *! @[query_backend]    */   static void port_set_backend (INT32 args)   {    struct port *p = THIS;    struct Backend_struct *backend;       if (!args) -  SIMPLE_TOO_FEW_ARGS_ERROR ("Stdio.Port->set_backend", 1); +  SIMPLE_TOO_FEW_ARGS_ERROR ("set_backend", 1);    if (TYPEOF(Pike_sp[-args]) != PIKE_T_OBJECT) -  SIMPLE_BAD_ARG_ERROR ("Stdio.Port->set_backend", 1, "object(Pike.Backend)"); +  SIMPLE_BAD_ARG_ERROR ("set_backend", 1, "object(Pike.Backend)");    backend = get_storage (Pike_sp[-args].u.object, Backend_program);    if (!backend) -  SIMPLE_BAD_ARG_ERROR ("Stdio.Port->set_backend", 1, "object(Pike.Backend)"); +  SIMPLE_BAD_ARG_ERROR ("set_backend", 1, "object(Pike.Backend)");       if (p->box.backend)    change_backend_for_box (&p->box, backend);    else    INIT_FD_CALLBACK_BOX (&p->box, backend, p->box.ref_obj,    p->box.fd, 0, got_port_event, 0);       pop_n_elems (args - 1);   }