Lines Matching refs:buffer

97 static char   **splitarray(const char *buffer, const char *buffend, char delim);
98 static int joinarray(char * const * argv, char *buffer, char delim);
99 static char *getfield(char **res, size_t reslen, char **buffer, char delim);
135 irp_marshall_pw(const struct passwd *pw, char **buffer, size_t *len) { in irp_marshall_pw() argument
183 if (buffer == NULL) { in irp_marshall_pw()
188 if (*buffer != NULL && need > *len) { in irp_marshall_pw()
193 if (*buffer == NULL) { in irp_marshall_pw()
195 *buffer = memget(need); in irp_marshall_pw()
196 if (*buffer == NULL) { in irp_marshall_pw()
204 strcpy(*buffer, pw->pw_name); strcat(*buffer, fieldsep); in irp_marshall_pw()
205 strcat(*buffer, pw->pw_passwd); strcat(*buffer, fieldsep); in irp_marshall_pw()
206 strcat(*buffer, pwUid); strcat(*buffer, fieldsep); in irp_marshall_pw()
207 strcat(*buffer, pwGid); strcat(*buffer, fieldsep); in irp_marshall_pw()
208 strcat(*buffer, pwClass); strcat(*buffer, fieldsep); in irp_marshall_pw()
209 strcat(*buffer, pwChange); strcat(*buffer, fieldsep); in irp_marshall_pw()
210 strcat(*buffer, pwExpire); strcat(*buffer, fieldsep); in irp_marshall_pw()
211 strcat(*buffer, pw->pw_gecos); strcat(*buffer, fieldsep); in irp_marshall_pw()
212 strcat(*buffer, pw->pw_dir); strcat(*buffer, fieldsep); in irp_marshall_pw()
213 strcat(*buffer, pw->pw_shell); strcat(*buffer, fieldsep); in irp_marshall_pw()
232 irp_unmarshall_pw(struct passwd *pw, char *buffer) { in irp_unmarshall_pw() argument
246 p = buffer; in irp_unmarshall_pw()
410 irp_marshall_gr(const struct group *gr, char **buffer, size_t *len) { in irp_marshall_gr() argument
431 if (buffer == NULL) { in irp_marshall_gr()
436 if (*buffer != NULL && need > *len) { in irp_marshall_gr()
441 if (*buffer == NULL) { in irp_marshall_gr()
443 *buffer = memget(need); in irp_marshall_gr()
444 if (*buffer == NULL) { in irp_marshall_gr()
452 strcpy(*buffer, gr->gr_name); strcat(*buffer, fieldsep); in irp_marshall_gr()
454 strcat(*buffer, gr->gr_passwd); in irp_marshall_gr()
456 strcat(*buffer, fieldsep); in irp_marshall_gr()
457 strcat(*buffer, grGid); strcat(*buffer, fieldsep); in irp_marshall_gr()
458 joinarray(gr->gr_mem, *buffer, COMMA) ; strcat(*buffer, fieldsep); in irp_marshall_gr()
477 irp_unmarshall_gr(struct group *gr, char *buffer) { in irp_unmarshall_gr() argument
489 if (gr == NULL || buffer == NULL) { in irp_unmarshall_gr()
494 p = buffer; in irp_unmarshall_gr()
579 irp_marshall_sv(const struct servent *sv, char **buffer, size_t *len) { in irp_marshall_sv() argument
600 if (buffer == NULL) { in irp_marshall_sv()
605 if (*buffer != NULL && need > *len) { in irp_marshall_sv()
610 if (*buffer == NULL) { in irp_marshall_sv()
612 *buffer = memget(need); in irp_marshall_sv()
613 if (*buffer == NULL) { in irp_marshall_sv()
621 strcpy(*buffer, sv->s_name); strcat(*buffer, fieldsep); in irp_marshall_sv()
622 joinarray(sv->s_aliases, *buffer, COMMA); strcat(*buffer, fieldsep); in irp_marshall_sv()
623 strcat(*buffer, svPort); strcat(*buffer, fieldsep); in irp_marshall_sv()
624 strcat(*buffer, sv->s_proto); strcat(*buffer, fieldsep); in irp_marshall_sv()
643 irp_unmarshall_sv(struct servent *sv, char *buffer) { in irp_unmarshall_sv() argument
655 if (sv == NULL || buffer == NULL) in irp_unmarshall_sv()
658 p = buffer; in irp_unmarshall_sv()
739 irp_marshall_pr(struct protoent *pr, char **buffer, size_t *len) { in irp_marshall_pr() argument
755 if (buffer == NULL) { in irp_marshall_pr()
760 if (*buffer != NULL && need > *len) { in irp_marshall_pr()
765 if (*buffer == NULL) { in irp_marshall_pr()
767 *buffer = memget(need); in irp_marshall_pr()
768 if (*buffer == NULL) { in irp_marshall_pr()
776 strcpy(*buffer, pr->p_name); strcat(*buffer, fieldsep); in irp_marshall_pr()
777 joinarray(pr->p_aliases, *buffer, COMMA); strcat(*buffer, fieldsep); in irp_marshall_pr()
778 strcat(*buffer, prProto); strcat(*buffer, fieldsep); in irp_marshall_pr()
797 int irp_unmarshall_pr(struct protoent *pr, char *buffer) { in irp_unmarshall_pr() argument
808 if (pr == NULL || buffer == NULL) { in irp_unmarshall_pr()
813 p = buffer; in irp_unmarshall_pr()
885 irp_marshall_ho(struct hostent *ho, char **buffer, size_t *len) { in irp_marshall_ho() argument
928 if (buffer == NULL) { in irp_marshall_ho()
933 if (*buffer != NULL && need > *len) { in irp_marshall_ho()
938 if (*buffer == NULL) { in irp_marshall_ho()
940 *buffer = memget(need); in irp_marshall_ho()
941 if (*buffer == NULL) { in irp_marshall_ho()
950 strcpy(*buffer, ho->h_name); strcat(*buffer, fieldsep); in irp_marshall_ho()
951 joinarray(ho->h_aliases, *buffer, COMMA); strcat(*buffer, fieldsep); in irp_marshall_ho()
952 strcat(*buffer, hoaddrtype); strcat(*buffer, fieldsep); in irp_marshall_ho()
953 strcat(*buffer, holength); strcat(*buffer, fieldsep); in irp_marshall_ho()
955 p = *buffer + strlen(*buffer); in irp_marshall_ho()
956 remlen = need - strlen(*buffer); in irp_marshall_ho()
966 strcat(*buffer, fieldsep); in irp_marshall_ho()
972 memput(*buffer, need); in irp_marshall_ho()
992 irp_unmarshall_ho(struct hostent *ho, char *buffer) { in irp_unmarshall_ho() argument
1008 if (ho == NULL || buffer == NULL) { in irp_unmarshall_ho()
1013 p = buffer; in irp_unmarshall_ho()
1148 char **buffer, size_t *len) { in irp_marshall_ng() argument
1162 if (buffer == NULL) { in irp_marshall_ng()
1165 } else if (*buffer != NULL && need > *len) { in irp_marshall_ng()
1170 if (*buffer == NULL) { in irp_marshall_ng()
1172 *buffer = memget(need); in irp_marshall_ng()
1173 if (*buffer == NULL) { in irp_marshall_ng()
1181 (*buffer)[0] = '('; in irp_marshall_ng()
1182 (*buffer)[1] = '\0'; in irp_marshall_ng()
1185 strcat(*buffer, host); in irp_marshall_ng()
1186 strcat(*buffer, fieldsep); in irp_marshall_ng()
1189 strcat(*buffer, user); in irp_marshall_ng()
1190 strcat(*buffer, fieldsep); in irp_marshall_ng()
1193 strcat(*buffer, domain); in irp_marshall_ng()
1194 strcat(*buffer, ")"); in irp_marshall_ng()
1220 char *buffer) in irp_unmarshall_ng() argument
1228 domainp == NULL || buffer == NULL) { in irp_unmarshall_ng()
1235 p = buffer; in irp_unmarshall_ng()
1314 irp_marshall_nw(struct nwent *ne, char **buffer, size_t *len) { in irp_marshall_nw() argument
1337 if (buffer == NULL) { in irp_marshall_nw()
1342 if (*buffer != NULL && need > *len) { in irp_marshall_nw()
1347 if (*buffer == NULL) { in irp_marshall_nw()
1349 *buffer = memget(need); in irp_marshall_nw()
1350 if (*buffer == NULL) { in irp_marshall_nw()
1358 strcpy(*buffer, ne->n_name); strcat(*buffer, fieldsep); in irp_marshall_nw()
1359 joinarray(ne->n_aliases, *buffer, COMMA) ; strcat(*buffer, fieldsep); in irp_marshall_nw()
1360 strcat(*buffer, nAddrType); strcat(*buffer, fieldsep); in irp_marshall_nw()
1361 strcat(*buffer, nNet); strcat(*buffer, fieldsep); in irp_marshall_nw()
1380 irp_unmarshall_nw(struct nwent *ne, char *buffer) { in irp_unmarshall_nw() argument
1392 if (ne == NULL || buffer == NULL) { in irp_unmarshall_nw()
1396 p = buffer; in irp_unmarshall_nw()
1488 irp_marshall_ne(struct netent *ne, char **buffer, size_t *len) { in irp_marshall_ne() argument
1511 if (buffer == NULL) { in irp_marshall_ne()
1516 if (*buffer != NULL && need > *len) { in irp_marshall_ne()
1521 if (*buffer == NULL) { in irp_marshall_ne()
1523 *buffer = memget(need); in irp_marshall_ne()
1524 if (*buffer == NULL) { in irp_marshall_ne()
1532 strcpy(*buffer, ne->n_name); strcat(*buffer, fieldsep); in irp_marshall_ne()
1533 joinarray(ne->n_aliases, *buffer, COMMA) ; strcat(*buffer, fieldsep); in irp_marshall_ne()
1534 strcat(*buffer, nAddrType); strcat(*buffer, fieldsep); in irp_marshall_ne()
1535 strcat(*buffer, nNet); strcat(*buffer, fieldsep); in irp_marshall_ne()
1554 irp_unmarshall_ne(struct netent *ne, char *buffer) { in irp_unmarshall_ne() argument
1566 if (ne == NULL || buffer == NULL) { in irp_unmarshall_ne()
1570 p = buffer; in irp_unmarshall_ne()
1660 splitarray(const char *buffer, const char *buffend, char delim) { in splitarray() argument
1666 if (buffend < buffer) in splitarray()
1668 else if (buffend > buffer && *buffer == delim) in splitarray()
1670 else if (buffend > buffer && *(buffend - 1) == delim) in splitarray()
1674 if (buffend > buffer + 1) { in splitarray()
1675 for (count = 1, q = buffer ; q != buffend ; q++) { in splitarray()
1677 if (q > buffer && (*(q - 1) == delim)) { in splitarray()
1695 for (p = buffer ; p < buffend ; p++) { in splitarray()
1758 joinarray(char * const *argv, char *buffer, char delim) { in joinarray() argument
1762 if (argv == NULL || buffer == NULL) { in joinarray()
1771 strcat(buffer, *p); in joinarray()
1773 strcat(buffer, sep); in joinarray()
1950 char buffer[1024]; in main() local
1951 char *b = &buffer[0]; in main()
1952 size_t len = sizeof buffer; in main()
2009 buffer, sizeof buffer); in main()
2010 printf("Net: \"%s\"\n", buffer); in main()
2013 buffer, sizeof buffer); in main()
2014 printf("Corrected Net: \"%s\"\n", buffer); in main()
2083 buffer, argv[1]); in main()
2144 buffer, sizeof buffer); in main()
2145 printf("\n\t\"%s\"\n", buffer); in main()
2150 if (strcmp(argv[1], buffer) != 0) { in main()
2152 buffer, argv[1]); in main()
2168 printf("success: \"%s\"\n", buffer); in main()
2187 if (strcmp(argv[1], buffer) != 0) { in main()
2189 buffer, argv[1]); in main()
2204 printf("success: \"%s\"\n", buffer); in main()
2222 if (strcmp(argv[1], buffer) != 0) { in main()
2224 buffer, argv[1]); in main()
2239 printf("success: \"%s\"\n", buffer); in main()
2267 if (strcmp(argv[1], buffer) != 0) { in main()
2269 buffer, argv[1]); in main()
2284 printf("success: \"%s\"\n", buffer); in main()