/** BEGIN COPYRIGHT BLOCK * Copyright 2001 Sun Microsystems, Inc. * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. * All rights reserved. * END COPYRIGHT BLOCK **/ /* * ACL parser unit test program */ #include #include #include #include #include "../aclpriv.h" #include main(int argc, char **argv) { ACLListHandle_t *acllist; int ii; char filename[255]; ACLWrapper_t *wrap; ACLExprHandle_t *expr; if ( argc < 2 ) { fprintf(stderr, "usage: aclparse \n"); exit(1); } for (ii = 1; ii < argc; ii++ ) { acllist = ACL_ParseFile(NULL, argv[ii]); if ( acllist == NULL ) { printf("Failed to parse ACL.\n"); } else { for (wrap = acllist->acl_list_head; wrap; wrap = wrap->wrap_next) { for (expr=wrap->acl->expr_list_head; expr; expr = expr->expr_next ) { ACL_ExprDisplay(expr); } } } sprintf(filename, "%s.v30", argv[ii]); ACL_WriteFile(NULL, filename, acllist); ACL_ListDestroy( acllist ); } }