Example #1
0
static char translate_key(unsigned char modifiers, unsigned char key)
{
	unsigned char r;
	r = get_base_key(key);
	if((modifiers & 0x02)||(modifiers & 0x20)) {
		if((r >= 'a') && (r <= 'z'))
			r -= 'a' - 'A';
		if(r == '-')
			r = '_';
	}
	return r;
}
Example #2
0
int osi_get_os_info(char ***osinfo)
{
    char **info=NULL, **ret=NULL;
    char *key = NULL, *value = NULL;
    int i=0;
    info = (char **)rll_get_value_strings(rghandle, win_keys[0].key, win_keys[0].recursive);
    
    //allocate buffer to return;
    //TODO: max key-value pair 128
    ret = (char **) calloc(256, sizeof(char *)); 
   
    while(info && info[i])
    {
        key = get_base_key(info[i]);
        value = get_value(info[i]);
        ret[i*2]=key;
        ret[i*2+1]=value;
        //fprintf(stderr, "\t\t%s : %s \n", key, value);
        i++;
    }

    *osinfo = ret;
    return 0;
}
 void change_password( const std::string& old_password, const std::string& new_password )
 {
    set_keys( get_keys( old_password ), new_password );
    set_base_key( get_base_key( old_password ), new_password );
 }