Esempio n. 1
0
void
test_msqrt(void)
{
	int i;
	unsigned int *n, *x, *y;
	logout("testing msqrt\n");
	for (i = 0; i < 1000000; i++) {
		n = mint(i);
		x = msqrt(n);
		y = mint((int) (sqrt((double) i) + 1e-10));
		if (mcmp(x, y) != 0) {
			sprintf(logbuf, "failed for %d got %u\n", i, x[0]);
			logout(logbuf);
			errout();
		}
		mfree(n);
		mfree(x);
		mfree(y);
	}
	logout("ok\n");
}
Esempio n. 2
0
static int vdi_probe(const uint8_t *buf, int buf_size, const char *filename)
{
    const VdiHeader *header = (const VdiHeader *)buf;
    int result = 0;

    logout("\n");

    if (buf_size < sizeof(*header)) {
        /* Header too small, no VDI. */
    } else if (le32_to_cpu(header->signature) == VDI_SIGNATURE) {
        result = 100;
    }

    if (result == 0) {
        logout("no vdi image\n");
    } else {
        logout("%s", header->text);
    }

    return result;
}
void FTPClientSession::close()
{
	try { logout(); }
	catch (...) {}
	_serverReady = false;
	if (_pControlSocket)
	{
		_pControlSocket->close();
		delete _pControlSocket;
		_pControlSocket = 0;
	}
}
void TeachingLoginDialog::createActions()
{
    connect(ui->submitBtn,SIGNAL(clicked()),this,SLOT(checkUser()));
    connect(showMainWinAction,SIGNAL(triggered()),this,SLOT(showMainWin()));
    connect(quitAction,SIGNAL(triggered()),mainWin,SLOT(quitApp()));
    connect(sysTray,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this,SLOT(dbClickTray(QSystemTrayIcon::ActivationReason)));
    connect(this,SIGNAL(quitApp()),qApp,SLOT(quit()));
    connect(logoutAction,SIGNAL(triggered()),this,SLOT(showLoginDialog()));
    connect(ui->settingBtn,SIGNAL(clicked()),settingserverdialog,SLOT(exec()));
    //signals from mainwindow
    connect(mainWin,SIGNAL(logout()),this,SLOT(showLoginDialog()));
    connect(mainWin,SIGNAL(logout()),ui->passWord,SLOT(setFocus()));
    connect(mainWin,SIGNAL(minMe()),this,SLOT(showTrayMessage()));
    connect(mainWin,SIGNAL(refreshOnTrayMessage()),this,SLOT(refreshOnTrayMessage()));
    //signal from settingdbserver dialog
    connect(settingserverdialog,SIGNAL(imClosed()),ui->passWord,SLOT(setFocus()));
    //global shortcut
    connect(mainWin,SIGNAL(showMe()),this,SLOT(showMainWin()));
    //getserverconnectinfo
    connect(getInfo,SIGNAL(timeout()),this,SLOT(getServerConnectInfo()));
}
Esempio n. 5
0
static int coroutine_fn vdi_co_check(BlockDriverState *bs, BdrvCheckResult *res,
                                     BdrvCheckMode fix)
{
    /* TODO: additional checks possible. */
    BDRVVdiState *s = (BDRVVdiState *)bs->opaque;
    uint32_t blocks_allocated = 0;
    uint32_t block;
    uint32_t *bmap;
    logout("\n");

    if (fix) {
        return -ENOTSUP;
    }

    bmap = g_try_new(uint32_t, s->header.blocks_in_image);
    if (s->header.blocks_in_image && bmap == NULL) {
        res->check_errors++;
        return -ENOMEM;
    }

    memset(bmap, 0xff, s->header.blocks_in_image * sizeof(uint32_t));

    /* Check block map and value of blocks_allocated. */
    for (block = 0; block < s->header.blocks_in_image; block++) {
        uint32_t bmap_entry = le32_to_cpu(s->bmap[block]);
        if (VDI_IS_ALLOCATED(bmap_entry)) {
            if (bmap_entry < s->header.blocks_in_image) {
                blocks_allocated++;
                if (!VDI_IS_ALLOCATED(bmap[bmap_entry])) {
                    bmap[bmap_entry] = bmap_entry;
                } else {
                    fprintf(stderr, "ERROR: block index %" PRIu32
                            " also used by %" PRIu32 "\n", bmap[bmap_entry], bmap_entry);
                    res->corruptions++;
                }
            } else {
                fprintf(stderr, "ERROR: block index %" PRIu32
                        " too large, is %" PRIu32 "\n", block, bmap_entry);
                res->corruptions++;
            }
        }
    }
    if (blocks_allocated != s->header.blocks_allocated) {
        fprintf(stderr, "ERROR: allocated blocks mismatch, is %" PRIu32
               ", should be %" PRIu32 "\n",
               blocks_allocated, s->header.blocks_allocated);
        res->corruptions++;
    }

    g_free(bmap);

    return 0;
}
Esempio n. 6
0
/**
* Adds header margin (top margin and 1 row of left margin) to the decoder buffer
* Returns the amount of bytes written to OutBuffer
*/
uint32_t CImageBuffer::PushHeaderMargin(uint8_t *OutBuffer, const uint32_t OutBufferSize)
{

	//Note: Adds starting position - (1 left and 1 right margin) because in PushWithBounds() for the first byte (left+right margin) will be added.
	//So the first copied byte will be at the right position.
	const uint32_t iTotalWidth = m_imageWidth + m_rightMargin;
	const uint32_t iMarginBytes = m_topMargin*iTotalWidth/* - m_rightMargin*/;

	#ifdef _TRACE_ADD_MARGINS_
	logout("-------------------\n");
	logout("AddHeaderMargin:\n");
	logout("OutAddr=0x%x\n", &OutBuffer[0]);
	logout("iMarginBytes=%d\n", iMarginBytes);
	logout("-------------------\n");
	#endif

	#ifdef _DO_ERROR_CHECKS_
	if(OutBufferSize<iMarginBytes)
	{
		logout("ERROR:  BufferOverflowException(9)\n");
		exit(0);
	}
	#endif

	//memset(OutBuffer, 0, iMarginBytes);
	miTotalIndex=0;	//Position in the overall data buffer
	return iMarginBytes;
}
Esempio n. 7
0
Gui_Admin::Gui_Admin(QWidget* parent): QWidget(parent), db(new LinkedDB){
    this->setWindowTitle("Welcome to LinQedIn Admin");
    this->resize(QDesktopWidget().availableGeometry(this).size() * 0.5);
    this->setFixedSize(this->size());

    QHBoxLayout* adminLayout = new QHBoxLayout();

    QVBoxLayout* firstCol = new QVBoxLayout();
    usersList = new QListWidget(this);
    for(std::list<SmartUser>::const_iterator it = db->begin(); it != db->end(); ++it) {
        QListWidgetItem* user = new QListWidgetItem(QString::fromStdString((*it)->account()->username().getLogin()));
        usersList->insertItem(usersList->count(),user);
    }
    usersList->setCurrentRow(0);
    usersList->setFixedHeight(this->height()/1.75);
    usersList->setFixedWidth(200);
    filterSearch = new QLineEdit();
    filterSearch->setPlaceholderText("filter users by username");
    filterSearch->setFixedWidth(200);
    connect(filterSearch, SIGNAL(textEdited(QString)), this, SLOT(filterUsers(QString)));
    firstCol->addSpacing(50);
    firstCol->addWidget(filterSearch, 0, Qt::AlignCenter);
    firstCol->addWidget(usersList,0, Qt::AlignCenter);
    firstCol->addSpacing(50);

    QVBoxLayout* secCol = new QVBoxLayout();
    QPushButton* adduserB = new QPushButton("add new user");
    adduserB->setFixedSize(160,30);
    connect(adduserB, SIGNAL(clicked()), this, SLOT(openAddUser()));
    QPushButton* removeuserB = new QPushButton("remove user");
    removeuserB->setFixedSize(160,30);
    connect(removeuserB, SIGNAL(clicked()), this, SLOT(removeUser()));
    QPushButton* changesubuserB = new QPushButton("change Subscription");
    changesubuserB->setFixedSize(160,30);
    connect(changesubuserB, SIGNAL(clicked()), this, SLOT(openChangeSubType()));
    QPushButton* logoutB = new QPushButton("Logout");
    logoutB->setFixedSize(160,30);
    connect(logoutB, SIGNAL(clicked()), this, SLOT(logout()));

    secCol->setSpacing(10);
    secCol->addSpacing(50);
    secCol->addWidget(adduserB,0, Qt::AlignLeft);
    secCol->addWidget(removeuserB,0, Qt::AlignLeft);
    secCol->addWidget(changesubuserB,0, Qt::AlignLeft);
    secCol->addWidget(logoutB, 0, Qt::AlignLeft);
    secCol->addSpacing(50);


    adminLayout->addLayout(firstCol);
    adminLayout->addLayout(secCol);
    setLayout(adminLayout);
}
Esempio n. 8
0
MainWindow::MainWindow()
{
    ui.setupUi( this );

    setWindowTitle( tr( "Last.fm Fingerprinter" ) );
    setStatusBar( 0 );
    setAcceptDrops(true);
    
    resize( Settings().size() );
    move( Settings().position() );
    
    #ifndef Q_WS_MAC
        QMenu* fileMenu = new QMenu( tr( "&File" ), this );
        QAction* exitAction = fileMenu->addAction( tr( "E&xit" ), this, SLOT( close() ) );
    #ifdef Q_WS_X11
        exitAction->setShortcut( tr( "CTRL+Q" ) );
        exitAction->setText( tr("&Quit") );
    #endif
        menuBar()->insertMenu( menuBar()->actions().at( 0 ), fileMenu );
    #endif
    
    // Help shortcut
    #ifdef Q_WS_MAC
        ui.actionFAQ->setShortcut( tr( "Ctrl+?" ) );
    #else
        ui.actionFAQ->setShortcut( tr( "F1") );
    #endif
    
    QString info = tr(
        "<ol>"
        "<li>Select the folders containing the tracks that you wish to fingerprint."
        "<li>Press the Fingerprint button at the bottom to start."
        "</ol>"
        "This operation will not modify your files in any way, it will only analyse them "
        "and post a unique ID (fingerprint) to Last.fm."
        "<p>Please note that you can stop at any time; the app will remember how far it got, "
        "and automatically resume from that point the next time." );
    ui.informationLabel->setText( info );

    connect( ui.actionFAQ, SIGNAL( triggered() ),
             this, SLOT( showFAQ() ) );
             
    connect( ui.actionAbout, SIGNAL( triggered() ),
             this, SLOT( aboutDialog() ) );
    
    connect( ui.actionLogout, SIGNAL( triggered() ),
             this, SIGNAL( logout() ) );
             
    connect( ui.fingerprintButton, SIGNAL( clicked() ),
             this, SLOT( fingerprintButtonClicked() ) );
    
}
Esempio n. 9
0
/**
 * Waits for this server to finish sending pending items from its queue.
 */
void
server_shutdown(server *s)
{
	int i;
	size_t failures;
	size_t inqueue;
	int err;

	/* this function should only be called once for each server */
	assert(s->tid != 0);

	if (s->secondariescnt > 0) {
		/* if we have a working connection, or we still have stuff in
		 * our queue, wait for our secondaries, as they might need us,
		 * or we need them */
		do {
			failures = 0;
			inqueue = 0;
			for (i = 0; i < s->secondariescnt; i++) {
				if (s->secondaries[i]->failure)
					failures++;
				if (s->secondaries[i]->running)
					inqueue += queue_len(s->secondaries[i]->queue);
			}
			/* loop until we all failed, or nothing is in the queues */
		} while (failures != s->secondariescnt &&
				inqueue != 0 &&
				logout("any_of cluster pending %zu metrics "
					"(with %zu failed nodes)\n", inqueue, failures) >= -1 &&
				usleep((200 + (rand() % 100)) * 1000) <= 0);
		/* shut down entire cluster */
		for (i = 0; i < s->secondariescnt; i++)
			s->secondaries[i]->keep_running = 0;
		/* to pretend to be dead for above loop (just in case) */
		if (inqueue != 0)
			for (i = 0; i < s->secondariescnt; i++)
				s->secondaries[i]->failure = 1;
	}

	s->keep_running = 0;
	if ((err = pthread_join(s->tid, NULL)) != 0)
		logerr("%s:%u: failed to join server thread: %s\n",
				s->ip, s->port, strerror(err));
	s->tid = 0;

	if (s->ctype == CON_TCP) {
		size_t qlen = queue_len(s->queue);
		if (qlen > 0)
			logerr("dropping %zu metrics for %s:%u\n",
					qlen, s->ip, s->port);
	}
}
Esempio n. 10
0
int main(int argc, char ** argv)
{
    LOG_DISABLE_LEVEL(LOG_LEVEL_DEBUG);

    int rv;
    std::string machine;
    std::string username;
    std::string password;

    if(argc != 4) {
        LOG_INFO("Usage: %s <machine> <username> <password>\n", argv[0]);
        LOG_INFO("Example: %s C1 syncWbTestCaseA password", argv[0]);
        return -1;
    }

    machine.assign(argv[1]);
    username.assign(argv[2]);
    password.assign(argv[3]);

    LOG_INFO("Client:%s Username:%s Password:%s\n", machine.c_str(), username.c_str(), password.c_str());


    // Launch ccd process
    launchCcd();

    VPLThread_Sleep(VPLTIME_FROM_MILLISEC(1000));

    // Test app waiting for CCD to be ready
    waitCcd();


    u64 userId_out;
    rv = login(username, password, userId_out);
    if(rv != 0) {
        LOG_ERROR("Login failed:%d", rv);
        goto out;
    }

    rv = ownershipSync();
    if(rv != 0) {
        LOG_ERROR("CCD sync failed: %d", rv);
    }

    rv = logout(userId_out);
    if(rv != 0) {
        LOG_ERROR("Logout failed:%d", rv);
    }

out:
    shutdownCcd();
    return 0;
}
static uint8_t tnetw1130_read0b(pci_tnetw1130_t * d, target_phys_addr_t addr)
{
    tnetw1130_t *s = &d->tnetw1130;
    uint8_t value = 0;
    if (addr < TNETW1130_MEM0_SIZE) {
        value = s->mem0[addr];
    } else {
        UNEXPECTED();
    }
    //~ } else if (addr -= 0x20000, addr == TNETW1130_SOFT_RESET) {
    TRACE(TNETW, logout("addr %s = 0x%02x\n", tnetw1130_regname(addr), value));
    return value;
}
/**
  relogin
  used when forced to remove cache
  **/
void SpotifySession::relogin()
{
    qDebug() << Q_FUNC_INFO;
    if( sp_session_connectionstate(m_session) != SP_CONNECTION_STATE_LOGGED_OUT || m_loggedIn)
    {
        qDebug() << Q_FUNC_INFO << "SpotifySession asked to relog in! Logging out";
        delete m_SpotifyPlaylists;
        m_SpotifyPlaylists = new SpotifyPlaylists( this );
        m_relogin = true;
        logout( true );
        return;
    }
}
Esempio n. 13
0
/**
* Adds footer margin (bottom margin and 1 row of right margin) to the decoder buffer
* Returns the amount of bytes written to OutBuffer
*/
uint32_t CImageBuffer::PushFooterMargin(uint8_t *OutBuffer, const uint32_t OutBufferSize)
{
	const uint32_t iTotalWidth = m_imageWidth + m_rightMargin;
	const uint32_t iMarginBytes = m_bottomMargin*iTotalWidth /*+ m_rightMargin*/;

	#ifdef _TRACE_ADD_MARGINS_
	logout("AddFooterMargin:\n");
	logout("OutAddr=0x%x\n", &OutBuffer[0]);
	logout("iMarginBytes=%d\n", iMarginBytes);
	logout("-------------------\n");
	#endif

	#ifdef _DO_ERROR_CHECKS_
	if(OutBufferSize<iMarginBytes)
	{
		logout("ERROR:  BufferOverflowException(10)\n");
		exit(0);
	}
	#endif

	return iMarginBytes;
}
Esempio n. 14
0
void exec_ssd(process_message_t* p_msg)
{
	const uint8_T *Tvec = p_msg->info.Tvec;
	const uint8_T *Rvec = p_msg->info.Rvec;
	#ifdef _TRACE_OUTPUT_
	logout("TOffset=%d, ROffset=%d\n", p_msg->info.TOffset, p_msg->info.ROffset);
	#endif

	//Cache invalidate image data if necessary
	CacheInvalImageData(p_msg);

	//Execute calculation on the assigned DSP core
	real32_T result = ssd_on_core(p_msg->info.w, p_msg->info.BoundBox, p_msg->info.MarginAddon, p_msg->info.DSPRange, Tvec, p_msg->info.TOffset, Rvec, p_msg->info.ROffset,
		p_msg->info.d, p_msg->info.i_from, p_msg->info.i_to);

	#ifdef _TRACE_MC_
	logout("[core_%u] SSD = %f\n", p_msg->core_id, (double)result);
	#endif

    //Write back calculation result to message answer
    p_msg->info.out_SSD = result;
}
Esempio n. 15
0
void MainWindow::createActions() {
    startAction = new QAction(tr("&Start"), this);
    connect(startAction, SIGNAL(triggered()), this, SLOT(startTrack()));

    stopAction = new QAction(tr("S&top"), this);
    connect(stopAction, SIGNAL(triggered()), this, SLOT(stopTrack()));

    logoutAction = new QAction(tr("Log&out"), this);
    connect(logoutAction, SIGNAL(triggered()), this, SLOT(logout()));

    exitAction = new QAction(tr("E&xit"), this);
    connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
}
Esempio n. 16
0
 /// Skip all unit tests if ICat server is down
 bool skipTests()
 {
   Mantid::Kernel::ConfigService::Instance().setString("default.facility", "ISIS");
   if (!login())
   {
     std::cerr << "ICat server seems to be down. Skipping tests" << std::endl;
     return true;
   }
   else {
     logout();
     return false;
   }
 }
Esempio n. 17
0
static int nbd_establish_connection(BlockDriverState *bs)
{
    BDRVNBDState *s = bs->opaque;
    int sock;
    int ret;
    off_t size;
    size_t blocksize;

    if (s->host_spec[0] == '/') {
        sock = unix_socket_outgoing(s->host_spec);
    } else {
        sock = tcp_socket_outgoing_spec(s->host_spec);
    }

    /* Failed to establish connection */
    if (sock == -1) {
        logout("Failed to establish connection to NBD server\n");
        return -errno;
    }

    /* NBD handshake */
    ret = nbd_receive_negotiate(sock, s->export_name, &s->nbdflags, &size,
                                &blocksize);
    if (ret == -1) {
        logout("Failed to negotiate with the NBD server\n");
        closesocket(sock);
        return -errno;
    }

    /* Now that we're connected, set the socket to be non-blocking */
    socket_set_nonblock(sock);

    s->sock = sock;
    s->size = size;
    s->blocksize = blocksize;

    logout("Established connection with NBD server\n");
    return 0;
}
Esempio n. 18
0
void Posture::logout()
{
	g_umUserManager.Logout();
	models.clear();
	modelList.clear();
	CloseCurrentWindow();
	m_lwLogWin = new LogWindow(this,LOG);
	this->setCentralWidget(m_lwLogWin);
	connect(m_lwLogWin, SIGNAL(wait()), this, SLOT(message()));
	connect(m_lwLogWin, SIGNAL(regSuccess()), this, SLOT(logout()));
	m_wtCurrentWin = LOG;
	this->setFixedSize(LOGWINDOW_W*xscale, LOGWINDOW_H*yscale);
}
Esempio n. 19
0
void VisibilityManager::clearVisibility(CreatureObject* creature) {
	Reference<PlayerObject*> ghost = creature->getSlottedObject("ghost").castTo<PlayerObject*>();

	if (ghost != NULL && !ghost->isPrivileged()) {
		//info("Clearing visibility for player " + String::valueOf(creature->getObjectID()), true);

		Locker locker(ghost);
		ghost->setVisibility(0);
		locker.release();

		logout(creature);
	}
}
Esempio n. 20
0
File: vdi.c Progetto: Aakriti/qemu
static int vdi_open(BlockDriverState *bs, QDict *options, int flags,
                    Error **errp)
{
    BDRVVdiState *s = bs->opaque;
    VdiHeader header;
    size_t bmap_size;
    int ret;

    logout("\n");

    ret = bdrv_read(bs->file, 0, (uint8_t *)&header, 1);
    if (ret < 0) {
        goto fail;
    }

    vdi_header_to_cpu(&header);
#if defined(CONFIG_VDI_DEBUG)
    vdi_header_print(&header);
#endif

    if (header.disk_size % SECTOR_SIZE != 0) {
        /* 'VBoxManage convertfromraw' can create images with odd disk sizes.
           We accept them but round the disk size to the next multiple of
           SECTOR_SIZE. */
        logout("odd disk size %" PRIu64 " B, round up\n", header.disk_size);
        header.disk_size += SECTOR_SIZE - 1;
        header.disk_size &= ~(SECTOR_SIZE - 1);
    }

    if (header.signature != VDI_SIGNATURE) {
        logout("bad vdi signature %08x\n", header.signature);
        ret = -EMEDIUMTYPE;
        goto fail;
    } else if (header.version != VDI_VERSION_1_1) {
        logout("unsupported version %u.%u\n",
               header.version >> 16, header.version & 0xffff);
        ret = -ENOTSUP;
        goto fail;
    } else if (header.offset_bmap % SECTOR_SIZE != 0) {
bool AuthenticationDialog::run(NetworkAuthenticationManager &mgr) {
	std::string errorMessage;
	UserList userList;
	while (true) {
		std::string password;
		if (!runDialog(mgr, userList, errorMessage, password)) {
			LogOutRunnable logout(mgr);
			logout.executeWithUI();
			return false;
		}

		if (mgr.UserNameOption.value().empty()) {
			const ZLResource &resource = ZLResource::resource("dialog")["AuthenticationDialog"];
			errorMessage = resource["loginIsEmpty"].value();
			continue;
		}

		AuthoriseRunnable authoriser(mgr, password);
		authoriser.executeWithUI();
		if (authoriser.hasErrors()) {
			errorMessage = authoriser.errorMessage();
			LogOutRunnable logout(mgr);
			logout.executeWithUI();
			continue;
		}
		if (mgr.needsInitialization()) {
			InitializeAuthenticationManagerRunnable initializer(mgr);
			initializer.executeWithUI();
			if (initializer.hasErrors()) {
				errorMessage = initializer.errorMessage();
				LogOutRunnable logout(mgr);
				logout.executeWithUI();
				continue;
			}
		}
		userList.saveUser(mgr.currentUserName());
		return true;
	}
}
Esempio n. 22
0
void LoginManager::onTryLoginError(const QString& error)
      {
      Q_UNUSED(error);
      disconnect(this, SIGNAL(getUserSuccess()), this, SLOT(onTryLoginSuccess()));
      disconnect(this, SIGNAL(getUserError(QString)), this, SLOT(onTryLoginError(QString)));
      connect(this, SIGNAL(loginSuccess()), this, SLOT(tryLogin()));
      logout();
#ifdef USE_WEBENGINE
      loginInteractive();
#else
      mscore->showLoginDialog();
#endif
      }
Esempio n. 23
0
void MainController::sendPresence(boost::shared_ptr<Presence> presence) {
	rosterController_->getWindow()->setMyStatusType(presence->getShow());
	rosterController_->getWindow()->setMyStatusText(presence->getStatus());
	systemTrayController_->setMyStatusType(presence->getShow());
	notifier_->setTemporarilyDisabled(presence->getShow() == StatusShow::DND);

	// Add information and send
	presence->updatePayload(boost::make_shared<VCardUpdate>(vCardPhotoHash_));
	client_->getPresenceSender()->sendPresence(presence);
	if (presence->getType() == Presence::Unavailable) {
		logout();
	}
}
Esempio n. 24
0
int Disconnected (Stream)
{
	struct UserInfo * user = NULL;
	ChatCIRCUIT * conn;
	int n;
	char Msg[255];
	int len;
	struct _EXCEPTION_POINTERS exinfo;

	for (n = 0; n <= NumberofChatStreams-1; n++)
	{
		conn=&ChatConnections[n];

		if (Stream == conn->BPQStream)
		{
			if (conn->Active == FALSE)
			{
				return 0;
			}

			ChatClearQueue(conn);

			conn->Active = FALSE;
			RefreshMainWindow();

			if (conn->Flags & CHATMODE)
			{
				if (conn->Flags & CHATLINK)
				{
					len=sprintf_s(Msg, sizeof(Msg), "Chat Node %s Disconnected", conn->u.link->call);
					WriteLogLine(conn, '|',Msg, len, LOG_CHAT);
					__try {link_drop(conn);} My__except_Routine("link_drop");
				}
				else
				{
					len=sprintf_s(Msg, sizeof(Msg), "Chat User %s Disconnected", conn->Callsign);
					WriteLogLine(conn, '|',Msg, len, LOG_CHAT);
					__try
					{
						logout(conn);
					}
					#define EXCEPTMSG "logout"
					#include "StdExcept.c"
					}
				}

				conn->Flags = 0;
				conn->u.link = NULL;
				conn->UserPointer = NULL;	
				return 0;
			}
Esempio n. 25
0
mainWindow::mainWindow(QWidget *parent,int mode)
    : QMainWindow(parent)
{
    //db=Προδιαγραφες   ----                db1=Production
	db = QSqlDatabase::addDatabase("QTDS");
	db.setDatabaseName(DB_EXT);
	db.setUserName(USER);
	db.setPassword(PASS);
	db.setHostName(HOST);
    qDebug()<<HOST;
    qDebug()<<DB_EXT;

	db1 = QSqlDatabase::addDatabase("QTDS","kef");
	db1.setDatabaseName(DB_KEF);
	db1.setUserName(USER);
	db1.setPassword(PASS);
	db1.setHostName(HOST);
    qDebug()<<HOST;
    qDebug()<<DB_KEF;
	db = QSqlDatabase::database();
	db1 = QSqlDatabase::database("kef");

	ui.setupUi(this);
	QHostAddress addr((QString)SVR_HOST);
	client = new QTcpSocket;
	client->connectToHost(addr, 8889);


	qDebug()<<"UI:"<<&ui;
	connect(ui.action, SIGNAL(triggered()), this, SLOT(labels()));
	qDebug()<<"ACTION:"<<&(ui.action_2);
	connect(ui.action_2, SIGNAL(triggered()), this, SLOT(logout()));
	connect(ui.actionProduction, SIGNAL(triggered()), this, SLOT(production_rep()));
	connect(ui.action3A, SIGNAL(triggered()), this, SLOT(rep_3A()));
	connect(ui.actionK_T, SIGNAL(triggered()), this, SLOT(rep_KT()));
	qDebug()<<"UI1:"<<&ui;

	if (mode==1)
		{


			ui.action3A->setVisible(FALSE);
			ui.actionK_T->setVisible(FALSE);

			labels();
		}
    qDebug()<<"db:"<<db.isOpen();
    qDebug()<<"db1:"<<db1.isOpen();

    //connect(ui.actionK_T, SIGNAL(triggered()), this, SLOT(rep_KT()));
}
Esempio n. 26
0
/*
 * LCP has terminated the link; go to the Dead phase and take the
 * physical layer down.
 */
void
link_terminated(int unit)
{
  AUTHDEBUG((LOG_INFO, "link_terminated: %d\n", unit));
  if (lcp_phase[unit] == PHASE_DEAD) {
    return;
  }
  if (logged_in) {
    logout();
  }
  lcp_phase[unit] = PHASE_DEAD;
  AUTHDEBUG((LOG_NOTICE, "Connection terminated.\n"));
  pppLinkTerminated(unit);
}
Esempio n. 27
0
// interacter thread
int interacter()
{
    char input;
    char tmp[100];
    
    printf(HELPINFO);

    while (1) {
        printf("ipmsg~> ");
/*        if (fflush(stdin) != 0) {
            gets(stdin);
        }
*/
        fgets(tmp, 100, stdin);
        input = *tmp;
        switch(input) {
            case 'h':
                printf(HELPINFO);
                break;
            case 'l':
                pthread_mutex_lock(&user_lock);
                list_users();
                pthread_mutex_unlock(&user_lock);
                break;
            case 'r':
                login();
                pthread_mutex_lock(&user_lock);
                list_users();
                pthread_mutex_unlock(&user_lock);
                break;
            case 't':
                talkto_user();
                break;
            case 's':
                send_files();
                break;
            case 'q':
                logout();
                printf("Bye!!!\n");
                exit(0);
            case 10:
                break;
            default:
                printf("Input error command, please input again.\n");
                break;
        }
    }

    return 0;
}
Esempio n. 28
0
void Kiosek::switchToIntro()
{
    logout();
    intro_switch=true;
    screen->unload();
    openQml("Intro.qml");

    head->resize(300,300);
    int h=height();
    int w=width();
    int x=(w-300)/2;
    int y=(h-300)/2;
    head->setPosition(x,y);
}
Esempio n. 29
0
static uint64_t s3c24xx_serial_read(void *opaque, hwaddr addr,
                                    unsigned size)
{
    s3c24xx_serial_dev *s = opaque;
    int reg = addr & 0x3f;

    logout("0x" TARGET_FMT_plx "\n", addr);

    switch (reg) {
    case S3C_SERIAL_ULCON:
        return s->ulcon;

    case S3C_SERIAL_UCON:
        return s->ucon;

    case S3C_SERIAL_UFCON:
        return s->ufcon & ~0x8; /* bit 3 is reserved, must be zero */

    case S3C_SERIAL_UMCON:
        return s->umcon & 0x11; /* Rest are reserved, must be zero */

    case S3C_SERIAL_UTRSTAT:
        return 6 | s->rx_available; /* TX always clear, RX when available */

    case S3C_SERIAL_UERSTAT:
        return 0; /* Later, break detect comes in here */

    case S3C_SERIAL_UFSTAT:
        return s->rx_available; /* TXFIFO, always empty, RXFIFO 0 or 1 bytes */

    case S3C_SERIAL_UMSTAT:
        return 0;

    case S3C_SERIAL_UTXH:
        return 0;

    case S3C_SERIAL_URXH:
        s->rx_available = 0;
        if (s->ucon & 1<<8) {
            qemu_set_irq(s->rx_level, 0);
        }
        return s->rx_byte;

    case S3C_SERIAL_UBRDIV:
        return s->ubrdiv;

    default:
        return 0;
    };
}
Esempio n. 30
0
PAM_EXTERN int
pam_sm_close_session(pam_handle_t *pamh, int flags, int argc, const char **argv)
{
	int status;
	char *tty;

	status = pam_get_item(pamh, PAM_TTY, (void *)&tty);
	if( status != PAM_SUCCESS )
		return status;
	if( logout(tty) != 0 )
		return PAM_SYSTEM_ERR;

	return PAM_SUCCESS;
}