60 if (h->var != NULL) i++;
68 for (
int i = 0; v != NULL; v = (
vector *) v->
getNext (), i++) {
77 for (; p != NULL; p = p->
next) i++;
84 if (h->package != NULL)
return h->package;
91 char * n,
char * type) {
93 vec = citi_get_vector (p, i);
98 if (!strcmp (type,
"MAGANGLE")) {
99 for (
int i = 0; i < vec->
getSize (); i++) {
105 else if (!strcmp (type,
"DBANGLE")) {
106 for (
int i = 0; i < vec->
getSize (); i++) {
119 static int citi_vector_length (
strlist deps) {
125 for (
int i = 0; i < deps.
length(); i++) {
127 if (v != NULL) n *= v->
getSize ();
133 static int citi_check_dep_length (
vector * v,
strlist deps,
char * package) {
135 int dlength = citi_vector_length (deps);
136 if (rlength != dlength) {
138 "(%d != %d) in package `%s'\n", v->
getName (), rlength, dlength,
149 for (p = citi_root; p != NULL; p = pn) {
152 for (h = p->
head; h != NULL; h = hn) {
154 if (h->
var) free (h->
var);
161 for (v = p->
data; v != NULL; v = vn) {
182 int packages = citi_count_packages (p);
185 for (p = citi_root; p != NULL; p = p->
next) {
187 char *
package = citi_get_package (p);
192 int cvec = citi_count_vectors (p);
193 int cvar = citi_count_variables (p);
196 "no. of variables (%d) in package `%s'\n", cvec, cvar,
207 sprintf (opack,
"%s.", package);
211 for (h = p->
head; h != NULL; h = h->
next) {
213 if (h->
var != NULL) {
218 sprintf (txt,
"%s%s[%d,%d]", opack, h->
var, h->
i1, h->
i2);
219 v = citi_create_vector (p, n, txt, h->
type);
221 errors += citi_check_dep_length (v, deps, package);
225 sprintf (txt,
"%s%s[%d]", opack, h->
var, h->
i1);
226 v = citi_create_vector (p, n, txt, h->
type);
228 errors += citi_check_dep_length (v, deps, package);
232 }
else if (h->
n >= 0) {
234 sprintf (txt,
"%s%s", opack, h->
var);
235 v = citi_create_vector (p, n, txt, h->
type);
245 "does not equal defined length (%d) in package `%s'\n",
251 sprintf (txt,
"%s%s", opack, h->
var);
252 v = citi_create_vector (p, n, txt, h->
type);
254 errors += citi_check_dep_length (v, deps, package);
264 return errors ? -1 : 0;
269 if (citi_result != NULL) {
274 if (citi_root != NULL) {