PERFORCE change 77760 for review
Robert Watson
rwatson at FreeBSD.org
Tue May 31 10:44:26 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=77760
Change 77760 by rwatson at rwatson_paprika on 2005/05/31 10:44:06
Converge on BSD style(9).
Affected files ...
.. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#13 edit
Differences ...
==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#13 (text+ko) ====
@@ -53,16 +53,14 @@
#include <libbsm.h>
-#define READ_TOKEN_BYTES(buf, len, dest, size, bytesread, err) \
- do {\
- if(bytesread + size > len) {\
- err = 1;\
- }\
- else {\
- memcpy(dest, buf + bytesread, size);\
- bytesread += size;\
- }\
- } while(0)
+#define READ_TOKEN_BYTES(buf, len, dest, size, bytesread, err) do { \
+ if (bytesread + size > len) { \
+ err = 1; \
+ } else { \
+ memcpy(dest, buf + bytesread, size); \
+ bytesread += size; \
+ } \
+} while (0)
#define READ_TOKEN_U_CHAR(buf, len, dest, bytesread, err) do { \
if (bytesread + sizeof(u_char) <= len) { \
@@ -96,199 +94,197 @@
err = 1; \
} while (0)
-#define SET_PTR(buf, len, ptr, size, bytesread, err) \
- do {\
- if(bytesread + size > len) {\
- err = 1;\
- }\
- else {\
- ptr = buf + bytesread;\
- bytesread += size;\
- }\
- } while(0)
+#define SET_PTR(buf, len, ptr, size, bytesread, err) do { \
+ if (bytesread + size > len) \
+ err = 1; \
+ else { \
+ ptr = buf + bytesread; \
+ bytesread += size; \
+ } \
+} while (0)
/*
- * Prints the delimiter string
+ * Prints the delimiter string.
*/
-static void print_delim(FILE *fp, char *del)
+static void
+print_delim(FILE *fp, char *del)
{
+
fprintf(fp, "%s", del);
}
/*
- * Prints a single byte in the given format
+ * Prints a single byte in the given format.
*/
-static void print_1_byte(FILE *fp, u_char val, const char *format)
+static void
+print_1_byte(FILE *fp, u_char val, const char *format)
{
+
fprintf(fp, format, val);
}
/*
- * Print 2 bytes in the given format
+ * Print 2 bytes in the given format.
*/
-static void print_2_bytes(FILE *fp, u_int16_t val, const char *format)
+static void
+print_2_bytes(FILE *fp, u_int16_t val, const char *format)
{
+
fprintf(fp, format, val);
}
-
/*
- * Prints 4 bytes in the given format
+ * Prints 4 bytes in the given format.
*/
-static void print_4_bytes(FILE *fp, u_int32_t val, const char *format)
+static void
+print_4_bytes(FILE *fp, u_int32_t val, const char *format)
{
+
fprintf(fp, format, val);
}
/*
- * Prints 8 bytes in the given format
+ * Prints 8 bytes in the given format.
*/
-static void print_8_bytes(FILE *fp, u_int64_t val, const char *format)
+static void
+print_8_bytes(FILE *fp, u_int64_t val, const char *format)
{
+
fprintf(fp, format, val);
}
-
/*
- * Prints the given size of data bytes in hex
+ * Prints the given size of data bytes in hex.
*/
-static void print_mem(FILE *fp, u_char *data, size_t len)
+static void
+print_mem(FILE *fp, u_char *data, size_t len)
{
int i;
- if(len > 0) {
+ if (len > 0) {
fprintf(fp, "0x");
- for(i = 0; i < len; i++) {
- fprintf(fp, "%x", data[i]);
- }
+ for (i = 0; i < len; i++)
+ fprintf(fp, "%x", data[i]);
}
}
-
/*
- * Prints the given data bytes as a string
+ * Prints the given data bytes as a string.
*/
-static void print_string(FILE *fp, u_char *str, size_t len)
+static void
+print_string(FILE *fp, u_char *str, size_t len)
{
int i;
- if(len > 0) {
- for(i = 0; i < len; i++) {
- if(str[i] != '\0')
+
+ if (len > 0) {
+ for (i = 0; i < len; i++) {
+ if (str[i] != '\0')
fprintf(fp, "%c", str[i]);
}
}
}
+/*
+ * Prints the token type in either the raw or the default form.
+ */
+static void
+print_tok_type(FILE *fp, u_char type, const char *tokname, char raw)
+{
-
-/* Prints the token type in either the raw or the default form */
-static void print_tok_type(FILE *fp, u_char type, const char *tokname, char raw)
-{
- if(raw) {
+ if (raw)
fprintf(fp, "%u", type);
- }
- else {
+ else
fprintf(fp, "%s", tokname);
- }
}
-
/*
- * Prints a user value
+ * Prints a user value.
*/
-static void print_user(FILE *fp, u_int32_t usr, char raw)
+static void
+print_user(FILE *fp, u_int32_t usr, char raw)
{
struct passwd *pwent;
- if(raw) {
+
+ if (raw)
fprintf(fp, "%d", usr);
- }
else {
pwent = getpwuid(usr);
- if(pwent != NULL) {
+ if (pwent != NULL)
fprintf(fp, "%s", pwent->pw_name);
- }
- else {
+ else
fprintf(fp, "%d", usr);
- }
}
}
/*
- * Prints a group value
+ * Prints a group value.
*/
-static void print_group(FILE *fp, u_int32_t grp, char raw)
+static void
+print_group(FILE *fp, u_int32_t grp, char raw)
{
struct group *grpent;
- if(raw) {
+ if (raw)
fprintf(fp, "%d", grp);
- }
else {
grpent = getgrgid(grp);
- if(grpent != NULL) {
+ if (grpent != NULL)
fprintf(fp, "%s", grpent->gr_name);
- }
- else {
+ else
fprintf(fp, "%d", grp);
- }
}
}
-
/*
- * Prints the event from the header token in either
- * the short, default or raw form
+ * Prints the event from the header token in either the short, default or raw
+ * form.
*/
-static void print_event(FILE *fp, u_int16_t ev, char raw, char sfrm)
+static void
+print_event(FILE *fp, u_int16_t ev, char raw, char sfrm)
{
struct au_event_ent *e;
e = getauevnum(ev);
- if(e == NULL) {
+ if (e == NULL) {
fprintf(fp, "%u", ev);
return;
}
- if(raw) {
+ if (raw)
fprintf(fp, "%u", ev);
- }
- else if(sfrm) {
+ else if (sfrm)
fprintf(fp, "%s", e->ae_name);
- }
- else {
+ else
fprintf(fp, "%s", e->ae_desc);
- }
free_au_event_ent(e);
}
/*
- * Prints the event modifier from the header token in either
- * the default or raw form
+ * Prints the event modifier from the header token in either the default or
+ * raw form.
*/
-static void print_evmod(FILE *fp, u_int16_t evmod, char raw)
+static void
+print_evmod(FILE *fp, u_int16_t evmod, char raw)
{
- if(raw) {
+ if (raw)
fprintf(fp, "%u", evmod);
- }
- else {
+ else
fprintf(fp, "%u", evmod);
- }
}
-
/*
- * Prints seconds in the ctime format
+ * Prints seconds in the ctime format.
*/
-static void print_sec32(FILE *fp, u_int32_t sec, char raw)
+static void
+print_sec32(FILE *fp, u_int32_t sec, char raw)
{
time_t time;
char timestr[26];
- if(raw) {
+ if (raw)
fprintf(fp, "%u", sec);
- }
else {
time = (time_t)sec;
ctime_r(&time, timestr);
@@ -301,14 +297,14 @@
* XXXRW: 64-bit token streams make use of 64-bit time stamps; since we
* assume a 32-bit time_t, we simply truncate for now.
*/
-static void print_sec64(FILE *fp, u_int64_t sec, char raw)
+static void
+print_sec64(FILE *fp, u_int64_t sec, char raw)
{
time_t time;
char timestr[26];
- if(raw) {
+ if (raw)
fprintf(fp, "%u", (u_int32_t)sec);
- }
else {
time = (time_t)sec;
ctime_r(&time, timestr);
@@ -318,37 +314,37 @@
}
/*
- * Prints the excess milliseconds
+ * Prints the excess milliseconds.
*/
-static void print_msec32(FILE *fp, u_int32_t msec, char raw)
+static void
+print_msec32(FILE *fp, u_int32_t msec, char raw)
{
- if(raw) {
+ if (raw)
fprintf(fp, "%u", msec);
- }
- else {
+ else
fprintf(fp, " + %u msec", msec);
- }
}
/*
- * XXXRW: 64-bit token streams make use of 64-bit time stamps; since we
- * assume a 32-bit msec, we simply truncate for now.
+ * XXXRW: 64-bit token streams make use of 64-bit time stamps; since we assume
+ * a 32-bit msec, we simply truncate for now.
*/
-static void print_msec64(FILE *fp, u_int64_t msec, char raw)
+static void
+print_msec64(FILE *fp, u_int64_t msec, char raw)
{
msec &= 0xffffffff;
- if(raw) {
+ if (raw)
fprintf(fp, "%u", (u_int32_t)msec);
- }
- else {
+ else
fprintf(fp, " + %u msec", (u_int32_t)msec);
- }
}
-
-/* prints a dotted form for the IP addres */
-static void print_ip_address(FILE *fp, u_int32_t ip)
+/*
+ * Prints a dotted form for the IP address.
+ */
+static void
+print_ip_address(FILE *fp, u_int32_t ip)
{
struct in_addr ipaddr;
@@ -356,19 +352,21 @@
fprintf(fp, "%s", inet_ntoa(ipaddr));
}
-/* prints a string value for the given ip address */
-static void print_ip_ex_address(FILE *fp, u_int32_t type, u_int32_t *ipaddr)
+/*
+ * Prints a string value for the given ip address.
+ */
+static void
+print_ip_ex_address(FILE *fp, u_int32_t type, u_int32_t *ipaddr)
{
struct in_addr ipv4;
struct in6_addr ipv6;
char dst[INET6_ADDRSTRLEN];
const char *ret = NULL;
- if(type == AF_INET) {
+ if (type == AF_INET) {
ipv4.s_addr = (in_addr_t)(ipaddr[0]);
ret = inet_ntop(type, &ipv4, dst, INET6_ADDRSTRLEN);
- }
- else if(type == AF_INET6) {
+ } else if (type == AF_INET6) {
ipv6.__u6_addr.__u6_addr32[0] = ipaddr[0];
ipv6.__u6_addr.__u6_addr32[1] = ipaddr[1];
ipv6.__u6_addr.__u6_addr32[2] = ipaddr[2];
@@ -376,53 +374,55 @@
ret = inet_ntop(type, &ipv6, dst, INET6_ADDRSTRLEN);
}
- if(ret != NULL) {
+ if (ret != NULL) {
fprintf(fp, "%s", ret);
/* XXX Is ret heap memory? Leaked if so */
}
}
-/* Prints return value as success or failure */
-static void print_retval(FILE *fp, u_char status, char raw)
+/*
+ * Prints return value as success or failure.
+ */
+static void
+print_retval(FILE *fp, u_char status, char raw)
{
- if(raw) {
+ if (raw)
fprintf(fp, "%u", status);
- }
else {
- if(status == 0) {
+ if (status == 0)
fprintf(fp, "success");
- }
- else {
+ else
fprintf(fp, "failure : %s", strerror(status));
- }
}
}
-/* Prints the exit value */
-static void print_errval(FILE *fp, u_int32_t val)
+/*
+ * Prints the exit value.
+ */
+static void
+print_errval(FILE *fp, u_int32_t val)
{
+
fprintf(fp, "Error %u", val);
}
-/*prints IPC type */
-static void print_ipctype(FILE *fp, u_char type, char raw)
+/*
+ * Prints IPC type.
+ */
+static void
+print_ipctype(FILE *fp, u_char type, char raw)
{
- if(raw) {
+ if (raw)
fprintf(fp, "%u", type);
- }
else {
- if(type == AT_IPC_MSG) {
+ if (type == AT_IPC_MSG)
fprintf(fp, "Message IPC");
- }
- else if(type == AT_IPC_SEM) {
+ else if (type == AT_IPC_SEM)
fprintf(fp, "Semaphore IPC");
- }
- else if(type == AT_IPC_SHM) {
+ else if (type == AT_IPC_SHM)
fprintf(fp, "Shared Memory IPC");
- }
- else {
+ else
fprintf(fp, "%u", type);
- }
}
}
@@ -434,46 +434,42 @@
* seconds of time 4 bytes/8 bytes (32-bit/64-bit value)
* milliseconds of time 4 bytes/8 bytes (32-bit/64-bit value)
*/
-static int fetch_header32_tok(tokenstr_t *tok, char *buf, int len)
+static int
+fetch_header32_tok(tokenstr_t *tok, char *buf, int len)
{
int err = 0;
READ_TOKEN_U_INT32(buf, len, tok->tt.hdr32.size, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
READ_TOKEN_U_CHAR(buf, len, tok->tt.hdr32.version, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
READ_TOKEN_U_INT16(buf, len, tok->tt.hdr32.e_type, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
READ_TOKEN_U_INT16(buf, len, tok->tt.hdr32.e_mod, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
READ_TOKEN_U_INT32(buf, len, tok->tt.hdr32.s, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
READ_TOKEN_U_INT32(buf, len, tok->tt.hdr32.ms, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
- return 0;
+ return (0);
}
-static void print_header32_tok(FILE *fp, tokenstr_t *tok, char *del,
- char raw, char sfrm)
+static void
+print_header32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm)
{
+
print_tok_type(fp, tok->id, "header", raw);
print_delim(fp, del);
print_4_bytes(fp, tok->tt.hdr32.size, "%u");
@@ -497,46 +493,42 @@
* milliseconds of time 4 bytes/8 bytes (32-bit/64-bit value)
* version #
*/
-static int fetch_header64_tok(tokenstr_t *tok, char *buf, int len)
+static int
+fetch_header64_tok(tokenstr_t *tok, char *buf, int len)
{
int err = 0;
READ_TOKEN_U_INT32(buf, len, tok->tt.hdr64.size, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
READ_TOKEN_U_CHAR(buf, len, tok->tt.hdr64.version, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
READ_TOKEN_U_INT16(buf, len, tok->tt.hdr64.e_type, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
READ_TOKEN_U_INT16(buf, len, tok->tt.hdr64.e_mod, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
READ_TOKEN_U_INT64(buf, len, tok->tt.hdr64.s, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
READ_TOKEN_U_INT64(buf, len, tok->tt.hdr64.ms, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
- return 0;
+ return (0);
}
-static void print_header64_tok(FILE *fp, tokenstr_t *tok, char *del,
- char raw, char sfrm)
+static void
+print_header64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm)
{
+
print_tok_type(fp, tok->id, "header", raw);
print_delim(fp, del);
print_4_bytes(fp, tok->tt.hdr64.size, "%u");
@@ -556,26 +548,26 @@
* trailer magic 2 bytes
* record size 4 bytes
*/
-static int fetch_trailer_tok(tokenstr_t *tok, char *buf, int len)
+static int
+fetch_trailer_tok(tokenstr_t *tok, char *buf, int len)
{
int err = 0;
READ_TOKEN_U_INT16(buf, len, tok->tt.trail.magic, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
READ_TOKEN_U_INT32(buf, len, tok->tt.trail.count, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
- return 0;
+ return (0);
}
-static void print_trailer_tok(FILE *fp, tokenstr_t *tok, char *del,
- char raw, char sfrm)
+static void
+print_trailer_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm)
{
+
print_tok_type(fp, tok->id, "trailer", raw);
print_delim(fp, del);
print_4_bytes(fp, tok->tt.trail.count, "%u");
@@ -587,37 +579,35 @@
* text length 2 bytes
* text N bytes + 1 terminating NULL byte
*/
-static int fetch_arg32_tok(tokenstr_t *tok, char *buf, int len)
+static int
+fetch_arg32_tok(tokenstr_t *tok, char *buf, int len)
{
int err = 0;
READ_TOKEN_U_CHAR(buf, len, tok->tt.arg32.no, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
READ_TOKEN_U_INT32(buf, len, tok->tt.arg32.val, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
READ_TOKEN_U_INT16(buf, len, tok->tt.arg32.len, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
- SET_PTR(buf, len, tok->tt.arg32.text, tok->tt.arg32.len, tok->len, err);
- if(err) {
- return -1;
- }
+ SET_PTR(buf, len, tok->tt.arg32.text, tok->tt.arg32.len, tok->len,
+ err);
+ if (err)
+ return (-1);
- return 0;
+ return (0);
}
+static void
+print_arg32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm)
+{
-static void print_arg32_tok(FILE *fp, tokenstr_t *tok, char *del,
- char raw, char sfrm)
-{
print_tok_type(fp, tok->id, "argument", raw);
print_delim(fp, del);
print_1_byte(fp, tok->tt.arg32.no, "%u");
@@ -627,37 +617,35 @@
print_string(fp, tok->tt.arg32.text, tok->tt.arg32.len);
}
-static int fetch_arg64_tok(tokenstr_t *tok, char *buf, int len)
+static int
+fetch_arg64_tok(tokenstr_t *tok, char *buf, int len)
{
int err = 0;
READ_TOKEN_U_CHAR(buf, len, tok->tt.arg64.no, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
READ_TOKEN_U_INT64(buf, len, tok->tt.arg64.val, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
READ_TOKEN_U_INT16(buf, len, tok->tt.arg64.len, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
- SET_PTR(buf, len, tok->tt.arg64.text, tok->tt.arg64.len, tok->len, err);
- if(err) {
- return -1;
- }
+ SET_PTR(buf, len, tok->tt.arg64.text, tok->tt.arg64.len, tok->len,
+ err);
+ if (err)
+ return (-1);
- return 0;
+ return (0);
}
+static void
+print_arg64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm)
+{
-static void print_arg64_tok(FILE *fp, tokenstr_t *tok, char *del,
- char raw, char sfrm)
-{
print_tok_type(fp, tok->id, "argument", raw);
print_delim(fp, del);
print_1_byte(fp, tok->tt.arg64.no, "%u");
@@ -673,49 +661,54 @@
* unit count 1 byte
* data items (depends on basic unit)
*/
-static int fetch_arb_tok(tokenstr_t *tok, char *buf, int len)
+static int
+fetch_arb_tok(tokenstr_t *tok, char *buf, int len)
{
int err = 0;
int datasize;
READ_TOKEN_U_CHAR(buf, len, tok->tt.arb.howtopr, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
+
READ_TOKEN_U_CHAR(buf, len, tok->tt.arb.bu, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
+
READ_TOKEN_U_CHAR(buf, len, tok->tt.arb.uc, tok->len, err);
- if(err) {
- return -1;
- }
+ if (err)
+ return (-1);
- /* Determine the size of the basic unit */
+ /*
+ * Determine the size of the basic unit.
+ */
switch(tok->tt.arb.bu) {
- case AUR_BYTE: datasize = AUR_BYTE_SIZE;
- break;
+ case AUR_BYTE:
+ datasize = AUR_BYTE_SIZE;
+ break;
- case AUR_SHORT: datasize = AUR_SHORT_SIZE;
- break;
+ case AUR_SHORT:
+ datasize = AUR_SHORT_SIZE;
+ break;
- case AUR_LONG: datasize = AUR_LONG_SIZE;
- break;
+ case AUR_LONG:
+ datasize = AUR_LONG_SIZE;
+ break;
- default: return -1;
+ default:
+ return (-1);
}
- SET_PTR(buf, len, tok->tt.arb.data,
- datasize * tok->tt.arb.uc , tok->len, err);
- if(err) {
- return -1;
- }
+ SET_PTR(buf, len, tok->tt.arb.data, datasize * tok->tt.arb.uc,
+ tok->len, err);
+ if (err)
+ return (-1);
- return 0;
+ return (0);
}
-static void print_arb_tok(FILE *fp, tokenstr_t *tok, char *del,
- char raw, char sfrm)
+static void
+print_arb_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm)
{
char *str;
char *format;
@@ -724,78 +717,78 @@
print_tok_type(fp, tok->id, "arbitrary", raw);
print_delim(fp, del);
+
switch(tok->tt.arb.howtopr) {
- case AUP_BINARY:
- str = "binary";
- format = " %c";
- break;
+ case AUP_BINARY:
+ str = "binary";
+ format = " %c";
+ break;
- case AUP_OCTAL:
- str = "octal";
- format = " %o";
- break;
+ case AUP_OCTAL:
+ str = "octal";
+ format = " %o";
+ break;
- case AUP_DECIMAL:
- str = "decimal";
- format = " %d";
- break;
+ case AUP_DECIMAL:
+ str = "decimal";
+ format = " %d";
+ break;
- case AUP_HEX:
- str = "hex";
- format = " %x";
- break;
+ case AUP_HEX:
+ str = "hex";
+ format = " %x";
+ break;
- case AUP_STRING:
- str = "string";
- format = "%c";
- break;
+ case AUP_STRING:
+ str = "string";
+ format = "%c";
+ break;
- default:
- return;
+ default:
+ return;
}
+
print_string(fp, str, strlen(str));
print_delim(fp, del);
switch(tok->tt.arb.bu) {
- case AUR_BYTE:
- str = "byte";
- size = AUR_BYTE_SIZE;
- print_string(fp, str, strlen(str));
- print_delim(fp, del);
- print_1_byte(fp, tok->tt.arb.uc, "%u");
- print_delim(fp, del);
- for(i = 0; i<tok->tt.arb.uc; i++) {
- fprintf(fp, format, *(tok->tt.arb.data + (size * i)));
- }
- break;
+ case AUR_BYTE:
+ str = "byte";
+ size = AUR_BYTE_SIZE;
+ print_string(fp, str, strlen(str));
+ print_delim(fp, del);
+ print_1_byte(fp, tok->tt.arb.uc, "%u");
+ print_delim(fp, del);
+ for (i = 0; i<tok->tt.arb.uc; i++)
+ fprintf(fp, format, *(tok->tt.arb.data + (size * i)));
+ break;
- case AUR_SHORT:
- str = "short";
- size = AUR_SHORT_SIZE;
- print_string(fp, str, strlen(str));
- print_delim(fp, del);
- print_1_byte(fp, tok->tt.arb.uc, "%u");
- print_delim(fp, del);
- for(i = 0; i<tok->tt.arb.uc; i++) {
- fprintf(fp, format, *((u_int16_t *)(tok->tt.arb.data + (size * i))));
- }
- break;
+ case AUR_SHORT:
+ str = "short";
+ size = AUR_SHORT_SIZE;
+ print_string(fp, str, strlen(str));
+ print_delim(fp, del);
+ print_1_byte(fp, tok->tt.arb.uc, "%u");
+ print_delim(fp, del);
+ for (i = 0; i<tok->tt.arb.uc; i++)
+ fprintf(fp, format, *((u_int16_t *)(tok->tt.arb.data +
+ (size * i))));
+ break;
- case AUR_LONG:
- str = "int";
- size = AUR_LONG_SIZE;
- print_string(fp, str, strlen(str));
- print_delim(fp, del);
- print_1_byte(fp, tok->tt.arb.uc, "%u");
- print_delim(fp, del);
- for(i = 0; i<tok->tt.arb.uc; i++) {
- fprintf(fp, format, *((u_int32_t *)(tok->tt.arb.data + (size * i))));
- }
- break;
+ case AUR_LONG:
+ str = "int";
+ size = AUR_LONG_SIZE;
+ print_string(fp, str, strlen(str));
+ print_delim(fp, del);
+ print_1_byte(fp, tok->tt.arb.uc, "%u");
+ print_delim(fp, del);
+ for (i = 0; i<tok->tt.arb.uc; i++)
+ fprintf(fp, format, *((u_int32_t *)(tok->tt.arb.data +
+ (size * i))));
+ break;
- default:
- return;
+ default:
+ return;
}
-
}
/*
@@ -806,46 +799,42 @@
* node ID 8 bytes
* device 4 bytes/8 bytes (32-bit/64-bit)
*/
-static int fetch_attr32_tok(tokenstr_t *tok, char *buf, int len)
+static int
+fetch_attr32_tok(tokenstr_t *tok, char *buf, int len)
{
int err = 0;
READ_TOKEN_U_INT32(buf, len, tok->tt.attr32.mode, tok->len, err);
- if(err) {
>>> TRUNCATED FOR MAIL (1000 lines) <<<
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list