static nomask int restore_object( string name, varargs int flag ) { stderr(" ~ restore_object: " + name + "\n"); // DGD always set to zero all variables, so // the mudos flag is ignored here return ::restore_object(name); }
static nomask object clone_object(mixed what) { if (stringp(what)) { object blueprint; stderr(" - clone_object from \"" + what + "\"\n"); blueprint = load_object(what); if (blueprint) return ::clone_object(blueprint); return nil; } if (objectp(what)) stderr(" - clone_object from <" + object_name(what) + ">\n"); return ::clone_object(what); }
void Process::check_error(QVariantMap const &error_info) { if (!rc()) return; QVariantMap err = {{"msg", "Process error"} , {"cmd", ps->program()} , {"args", QVariant(ps->arguments())} , {"rc", rc()} , {"stderr", stderr()} , {"stdout", stdout()} , {"info", errorInfo()}}; err.unite(error_info); error::raise(err); }
void NXClientLib::processParseStderr() { QString message = nxsshProcess.readAllStandardError().data(); cerr << message.toStdString(); if (proxyData.encrypted && isFinished && message.contains("NX> 999 Bye")) { QString returnMessage; returnMessage = "NX> 299 Switching connection to: "; returnMessage += proxyData.proxyIP + ":" + QString::number(proxyData.port) + " cookie: " + proxyData.cookie + "\n"; write(returnMessage); } else if (message.contains("NX> 287 Redirected I/O to channel descriptors")) emit callbackWrite(tr("The session has been started successfully")); emit stderr(message); }
int alsa_send_dacs(void) { #ifdef DEBUG_ALSA_XFER static int xferno = 0; static int callno = 0; #endif static double timenow; double timelast; t_sample *fp, *fp1, *fp2; int i, j, k, err, iodev, result, ch; int chansintogo, chansouttogo; unsigned int transfersize; if (alsa_usemmap) return (alsamm_send_dacs()); if (!alsa_nindev && !alsa_noutdev) return (SENDDACS_NO); chansintogo = sys_inchannels; chansouttogo = sys_outchannels; transfersize = DEFDACBLKSIZE; timelast = timenow; timenow = sys_getrealtime(); #ifdef DEBUG_ALSA_XFER if (timenow - timelast > 0.050) fprintf(stderr, "(%d)", (int)(1000 * (timenow - timelast))), fflush(stderr); callno++; #endif alsa_checkiosync(); /* check I/O are in sync and data not late */ for (iodev = 0; iodev < alsa_nindev; iodev++) { snd_pcm_status(alsa_indev[iodev].a_handle, alsa_status); if (snd_pcm_status_get_avail(alsa_status) < transfersize) return SENDDACS_NO; } for (iodev = 0; iodev < alsa_noutdev; iodev++) { snd_pcm_status(alsa_outdev[iodev].a_handle, alsa_status); if (snd_pcm_status_get_avail(alsa_status) < transfersize) return SENDDACS_NO; } /* do output */ for (iodev = 0, fp1 = sys_soundout, ch = 0; iodev < alsa_noutdev; iodev++) { int thisdevchans = alsa_outdev[iodev].a_channels; int chans = (chansouttogo < thisdevchans ? chansouttogo : thisdevchans); chansouttogo -= chans; if (alsa_outdev[iodev].a_sampwidth == 4) { for (i = 0; i < chans; i++, ch++, fp1 += DEFDACBLKSIZE) for (j = i, k = DEFDACBLKSIZE, fp2 = fp1; k--; j += thisdevchans, fp2++) { float s1 = *fp2 * INT32_MAX; ((t_alsa_sample32 *)alsa_snd_buf)[j] = CLIP32(s1); } for (; i < thisdevchans; i++, ch++) for (j = i, k = DEFDACBLKSIZE; k--; j += thisdevchans) ((t_alsa_sample32 *)alsa_snd_buf)[j] = 0; } else if (alsa_outdev[iodev].a_sampwidth == 3) { for (i = 0; i < chans; i++, ch++, fp1 += DEFDACBLKSIZE) for (j = i, k = DEFDACBLKSIZE, fp2 = fp1; k--; j += thisdevchans, fp2++) { int s = *fp2 * 8388352.; if (s > 8388351) s = 8388351; else if (s < -8388351) s = -8388351; #if BYTE_ORDER == LITTLE_ENDIAN ((char *)(alsa_snd_buf))[3*j] = (s & 255); ((char *)(alsa_snd_buf))[3*j+1] = ((s>>8) & 255); ((char *)(alsa_snd_buf))[3*j+2] = ((s>>16) & 255); #else fprintf(stderr("big endian 24-bit not supported"); #endif } for (; i < thisdevchans; i++, ch++) for (j = i, k = DEFDACBLKSIZE; k--; j += thisdevchans) ((char *)(alsa_snd_buf))[3*j] = ((char *)(alsa_snd_buf))[3*j+1] = ((char *)(alsa_snd_buf))[3*j+2] = 0; } else /* 16 bit samples */ { for (i = 0; i < chans; i++, ch++, fp1 += DEFDACBLKSIZE) for (j = ch, k = DEFDACBLKSIZE, fp2 = fp1; k--; j += thisdevchans, fp2++) { int s = *fp2 * 32767.; if (s > 32767) s = 32767; else if (s < -32767) s = -32767; ((t_alsa_sample16 *)alsa_snd_buf)[j] = s; } for (; i < thisdevchans; i++, ch++) for (j = ch, k = DEFDACBLKSIZE; k--; j += thisdevchans) ((t_alsa_sample16 *)alsa_snd_buf)[j] = 0; } result = snd_pcm_writei(alsa_outdev[iodev].a_handle, alsa_snd_buf, transfersize); if (result != (int)transfersize) { #ifdef DEBUG_ALSA_XFER if (result >= 0 || errno == EAGAIN) fprintf(stderr, "ALSA: write returned %d of %d\n", result, transfersize); else fprintf(stderr, "ALSA: write: %s\n", snd_strerror(errno)); fprintf(stderr, "inputcount %d, outputcount %d, outbufsize %d\n", inputcount, outputcount, (ALSA_EXTRABUFFER + sys_advance_samples) * alsa_outdev[iodev].a_sampwidth * outchannels); #endif sys_log_error(ERR_DACSLEPT); return (SENDDACS_NO); } /* zero out the output buffer */ memset(sys_soundout, 0, DEFDACBLKSIZE * sizeof(*sys_soundout) * sys_outchannels); if (sys_getrealtime() - timenow > 0.002) { #ifdef DEBUG_ALSA_XFER fprintf(stderr, "output %d took %d msec\n", callno, (int)(1000 * (timenow - timelast))), fflush(stderr); #endif timenow = sys_getrealtime(); sys_log_error(ERR_DACSLEPT); } }