 /* 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 
prepare_cmd_parameters(const char * rsc_type, const char * op_type,			GHashTable * params_ht, RA_ARGV params_argv){	/* For lsb init scripts, no corresponding definite specification	 * But for lsb none-init scripts, maybe need it.	 */	int tmp_len;	int ht_size = 0;	if (params_ht) {		ht_size = g_hash_table_size(params_ht);	}	if ( ht_size+3 > MAX_PARAMETER_NUM ) {		cl_log(LOG_ERR, "Too many parameters");		return -1;	}	tmp_len = strnlen(rsc_type, 160) + 1;	params_argv[0] = g_new(gchar, tmp_len);	strncpy(params_argv[0], rsc_type, tmp_len);	tmp_len = strnlen(op_type, 160) + 1;	params_argv[1] = g_new(gchar, tmp_len);	strncpy(params_argv[1], op_type, tmp_len);	params_argv[ht_size+2] = NULL;	if (params_ht) {		g_hash_table_foreach(params_ht,				params_hash_to_argv, params_argv);	}	return 0;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/458e2540ce8975e74b68d89e0d8b214ea327c975/raexeclsb.c/buggy/lib/plugins/lrm/raexeclsb.c