Exemple #1
0
int main(int argc, char *argv[]) {
    arrXLen=sizeof(workField[0])/sizeof(char);
    arrYLen=(sizeof(workField)/sizeof(char))/arrXLen;

    fillRow();

    while(main) {
        system("clear");
        gen++;
        printf("Generation %d\n",gen);
        printField();
        copyField();
        calcField();
        sleep(1);
    }
}
Exemple #2
0
void CModList::setLocalModList(QVariantMap data)
{
	localModList = copyField(data, "version", "installedVersion");
}
Exemple #3
0
void CModList::addRepository(QVariantMap data)
{
	repositories.push_back(copyField(data, "version", "latestVersion"));
}
Exemple #4
0
ISC_STATUS API_ROUTINE isc_modify_user(ISC_STATUS* status, const USER_SEC_DATA* input_user_data)
{
/**************************************
 *
 *      i s c _ m o d i f y _ u s e r
 *
 **************************************
 *
 * Functional description
 *      Adds a user to the server's security
 *	database.
 *      Return 0 if the user was added
 *
 *	    Return > 0 if any error occurs.
 *
 **************************************/
	Auth::StackUserData userInfo;
	userInfo.op = Auth::MOD_OPER;
	Firebird::LocalStatus s;
	Firebird::CheckStatusWrapper statusWrapper(&s);

	if (input_user_data->user_name)
	{
		Firebird::string work = input_user_data->user_name;
		if (work.length() > USERNAME_LENGTH) {
			return user_error(status, isc_usrname_too_long);
		}

		Firebird::string::size_type l = work.find(' ');
		if (l != Firebird::string::npos) {
			work.resize(l);
		}

		userInfo.user.set(&statusWrapper, work.c_str());
		check(&statusWrapper);
		userInfo.user.setEntered(&statusWrapper, 1);
		check(&statusWrapper);
	}
	else {
		return user_error(status, isc_usrname_required);
	}

	if (input_user_data->password)
	{
		userInfo.pass.set(&statusWrapper, input_user_data->password);
		check(&statusWrapper);
		userInfo.pass.setEntered(&statusWrapper, 1);
		check(&statusWrapper);
	}
	else {
		return user_error(status, isc_password_required);
	}

	copyField(userInfo.u, input_user_data->uid, input_user_data->sec_flags & sec_uid_spec);
	copyField(userInfo.g, input_user_data->gid, input_user_data->sec_flags & sec_gid_spec);
	copyField(userInfo.group, input_user_data->group_name, input_user_data->sec_flags & sec_group_name_spec);
	copyField(userInfo.first, input_user_data->first_name, input_user_data->sec_flags & sec_first_name_spec);
	copyField(userInfo.middle, input_user_data->middle_name, input_user_data->sec_flags & sec_middle_name_spec);
	copyField(userInfo.last, input_user_data->last_name, input_user_data->sec_flags & sec_last_name_spec);

	return executeSecurityCommand(status, input_user_data, userInfo);
}