params_argv[2] = NULL;
prepare_cmd_parameters(const char * rsc_type, const char * op_type,			GHashTable * params_ht, RA_ARGV params_argv){	int tmp_len;	int ht_size = 0;#if 0	/* Reserve it for possible furture use */	int index;	void * value_tmp = NULL;	char buf_tmp[20];#endif	if (params_ht) {		ht_size = g_hash_table_size(params_ht);	}		/* Need 3 additonal spaces for accomodating: 	 * argv[0] = RA_file_name(RA_TYPE)	 * argv[1] = operation	 * a terminal NULL	 */	if ( ht_size+3 > MAX_PARAMETER_NUM ) {		cl_log(LOG_ERR, "Too many parameters");		return -1;	}	tmp_len = strnlen(rsc_type, MAX_LENGTH_OF_RSCNAME);	params_argv[0] = g_strndup(rsc_type, tmp_len);	/* Add operation code as the first argument */	tmp_len = strnlen(op_type, MAX_LENGTH_OF_OPNAME);	params_argv[1] = g_strndup(op_type, tmp_len);	/* Add the teminating NULL pointer */	params_argv[ht_size+2] = NULL;	/* No actual arguments except op_type */	if (ht_size != 0) {		/* Too strict? maybe */		cl_log(LOG_ERR, "For LSB init script, no parameter needed.");		return -1;	}/* Actually comment the following code, but I still think it may be used * in the future for LSB none-initial scripts, so reserver it. */#if 0	/* Now suppose the parameter formate stored in Hashtabe is like	 * key="1", value="-Wl,soname=test"	 * Moreover, the key is supposed as a string transfered from an integer.	 * It may be changed in the future.	 */	for (index = 1; index <= ht_size; index++ ) {		snprintf(buf_tmp, sizeof(buf_tmp), "%d", index);		value_tmp = g_hash_table_lookup(params_ht, buf_tmp);		/* suppose the key is consecutive */		if ( value_tmp == NULL ) {			cl_log(LOG_ERR, "Parameter ordering error in"\				"prepare_cmd_parameters, raexeclsb.c");			return -1;		}		params_argv[index+1] = g_strdup((char *)value_tmp);	}#endif	return 0;}