| option.c (a13cf0991a605c7ff6a75987e8275bd64dd10596) | option.c (d0fa49b78d1f40d84ec76c363cdc38cf128511dd) |
|---|---|
| 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 5 unchanged lines hidden (view full) --- 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21/* | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 5 unchanged lines hidden (view full) --- 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21/* |
| 22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. | 22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. |
| 23 * Use is subject to license terms. 24 */ 25 | 23 * Use is subject to license terms. 24 */ 25 |
| 26#pragma ident "%Z%%M% %I% %E% SMI" | |
| 27 28/* 29 * Command line option processing for auditreduce. 30 * The entry point is process_options(), which is called by main(). 31 * Process_options() is the only function visible outside this module. 32 */ 33 34#include <locale.h> --- 264 unchanged lines hidden (view full) --- 299int 300proc_sid(char *optarg) 301{ 302 if (flags & M_SID) { 303 error_str = gettext("'s' option specified multiple times"); 304 return (-1); 305 } 306 flags |= M_SID; | 26 27/* 28 * Command line option processing for auditreduce. 29 * The entry point is process_options(), which is called by main(). 30 * Process_options() is the only function visible outside this module. 31 */ 32 33#include <locale.h> --- 264 unchanged lines hidden (view full) --- 298int 299proc_sid(char *optarg) 300{ 301 if (flags & M_SID) { 302 error_str = gettext("'s' option specified multiple times"); 303 return (-1); 304 } 305 flags |= M_SID; |
| 307 m_sid = atol(optarg); | 306 m_sid = (au_asid_t)atol(optarg); |
| 308 return (0); 309} 310 311int 312proc_object(char *optarg) 313{ 314 char *obj_str; 315 char *obj_val; --- 115 unchanged lines hidden (view full) --- 431{ 432 int i; 433 434 for (i = 0; i < sizeof (obj_tbl) / sizeof (obj_ent_t); i++) 435 if (strcmp(obj_str, obj_tbl[i].obj_str) == 0) 436 return (&obj_tbl[i]); 437 438 /* not in table */ | 307 return (0); 308} 309 310int 311proc_object(char *optarg) 312{ 313 char *obj_str; 314 char *obj_val; --- 115 unchanged lines hidden (view full) --- 430{ 431 int i; 432 433 for (i = 0; i < sizeof (obj_tbl) / sizeof (obj_ent_t); i++) 434 if (strcmp(obj_str, obj_tbl[i].obj_str) == 0) 435 return (&obj_tbl[i]); 436 437 /* not in table */ |
| 439 return ((obj_ent_t *)0); | 438 return (NULL); |
| 440} 441 442 443/* 444 * .func proc_type - process record type. 445 * .desc Process a record type. It is either as a number or a mnemonic. 446 * .call ret = proc_type(optstr). 447 * .arg optstr - ptr to name or number. --- 11 unchanged lines hidden (view full) --- 459 460 if (flags & M_TYPE) { 461 error_str = gettext("'m' option specified multiple times"); 462 return (-1); 463 } 464 flags |= M_TYPE; 465 m_type = 0; 466 if (a_isnum(optstr, TRUE)) { | 439} 440 441 442/* 443 * .func proc_type - process record type. 444 * .desc Process a record type. It is either as a number or a mnemonic. 445 * .call ret = proc_type(optstr). 446 * .arg optstr - ptr to name or number. --- 11 unchanged lines hidden (view full) --- 458 459 if (flags & M_TYPE) { 460 error_str = gettext("'m' option specified multiple times"); 461 return (-1); 462 } 463 flags |= M_TYPE; 464 m_type = 0; 465 if (a_isnum(optstr, TRUE)) { |
| 467 if ((aep = getauevnam(optstr)) != (struct au_event_ent *)NULL) | 466 if ((aep = getauevnam(optstr)) != NULL) |
| 468 m_type = aep->ae_number; 469 } else { 470 if ((aep = getauevnum((au_event_t)atoi(optstr))) != 471 (struct au_event_ent *)NULL) 472 m_type = aep->ae_number; 473 } 474 if ((m_type == 0)) { 475 (void) sprintf(errbuf, gettext("invalid event (%s)"), optstr); --- 830 unchanged lines hidden --- | 467 m_type = aep->ae_number; 468 } else { 469 if ((aep = getauevnum((au_event_t)atoi(optstr))) != 470 (struct au_event_ent *)NULL) 471 m_type = aep->ae_number; 472 } 473 if ((m_type == 0)) { 474 (void) sprintf(errbuf, gettext("invalid event (%s)"), optstr); --- 830 unchanged lines hidden --- |