mm_path.c revision cee0fb94c0d4227de0a00efc162fb2739844b641
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "mms_strapp.h"
#include "mms_trace.h"
#include "mm_path.h"
struct mm_name {
char **mm_name;
int mm_name_num;
};
typedef struct mm_pkey_list mm_pkey_list_t;
struct mm_pkey_list {
int mm_pkey_num;
};
typedef struct mm_path_list mm_path_list_t;
struct mm_path_list {
int mm_path_num;
};
typedef struct mm_user_data mm_user_data_t;
struct mm_user_data {
int mm_once;
int mm_error;
int mm_level;
int mm_scan;
int mm_path_num;
int mm_path_index;
int mm_node_index;
int mm_att_index;
};
static void mm_parse_start_elements(void *xml_user_data,
static void mm_parse_end_elements(void *xml_user_data,
static char *mm_get_obj_ptr(char **obj);
static char *mm_get_att_ptr(char **att);
int
mm_init_paths(char *fn)
{
int i;
/*
* Zero data
*/
/*
* Allocate unique object and attribute strings
*/
return (1);
}
/* Sort unique object and attribute names */
/* Pre-allocate object pkey array */
return (1);
}
for (i = 0; i < mm_pkey_list.mm_pkey_num; i++) {
mm_pkey_list.mm_pkey[i] =
}
/* Pre-allocate paths array */
return (1);
}
for (i = 0; i < mm_path_list.mm_path_num; i++) {
sizeof (mm_path_t));
}
/*
* Build primary keys and paths using pre-allocated strings and arrays
*/
return (1);
}
/* Sort paths */
sizeof (mm_path_t *), mm_path_cmp);
}
{
/*
* Get path between object 1 and object 2
*/
return (NULL);
}
return (NULL);
}
return (NULL);
}
sizeof (mm_path_t **),
return (NULL);
}
return (*path);
}
void
{
int i, j;
char *buf;
return;
}
for (i = 0; i < path->mm_node_num; i++) {
}
}
} else {
}
}
}
}
}
static int
{
}
fn,
}
}
static void
{
int i;
int num;
char *str;
char *from;
char *to;
int index;
int nindex;
char *value;
char *to_value;
return;
}
}
return;
}
return;
}
return;
}
}
return;
}
} else {
} else {
}
}
return;
}
}
}
} else {
return;
}
}
user_data->mm_path_num++;
} else {
}
user_data->mm_node_index = 0;
}
return;
}
}
}
} else {
return;
}
}
mm_node_t **p;
mm_node_t **q;
return;
}
return;
}
return;
}
return;
}
user_data->mm_att_index = 0;
}
return;
}
}
}
} else {
return;
}
}
mm_att_t **p;
mm_att_t **q;
return;
}
return;
}
return;
}
if (to_value) {
return;
}
}
}
return;
}
}
static void
{
return;
}
return;
}
return;
}
return;
}
return;
}
}
static void
{
int i;
int found;
char **p;
found = 0;
found = 1;
}
}
if (!found) {
return;
}
return;
}
name->mm_name_num++;
}
}
static int
{
}
static char *
mm_get_obj_ptr(char **obj)
{
char **objname;
sizeof (char **), mm_name_cmp)) == NULL) {
return (NULL);
}
return (*objname);
}
static char *
mm_get_att_ptr(char **att)
{
char **attname;
sizeof (char **), mm_name_cmp)) == NULL) {
return (NULL);
}
return (*attname);
}
static int
{
}
static int
{
}
mm_get_pkey(char *obj)
{
return (NULL);
}
mm_pkey_cmp)) == NULL) {
return (NULL);
}
return (*pkey);
}