~ubuntu-branches/debian/experimental/nfs-utils/experimental

« back to all changes in this revision

Viewing changes to tools/rpcgen/rpc_cout.c

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar
  • Date: 2006-07-08 14:26:40 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060708142640-r171kjj2a13gy2kz
Tags: 1:1.0.9-1
* Updated co-mantainer mail address.
* New upstream release.
  - Added 'mount.nfs' utility which can be used as a mount helper
    to mount nfs filesystems. It does not yet support 'user' mounts.
  - Makefile/autoconf tidyups
  - No compiles with no warnings
  - deleted debian/* at request of debian maintainer
  - deleted assorted other unused files
  - mountd can be run multi-threaded for configurations with many hundreds
    of clients (mountd -t 20).  Default is single-threaded
  - Support for selection NFS version to be exported, and protocol to
    use.  This requires kernel patches that should be in linux 2.6.19.
  - Use 65534 rather than -2 for default anon.  This makes no difference in many
    cases, but is important in some.
  - New utility 'rpcdebug' for controlled kernel 'debug' options for nfs and nfsd.
  - nfsstat reports NFSv4 operation statistics that should be available in
    linux 2.6.18.
  - assorted other fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 * Mountain View, California  94043
29
29
 */
30
30
 
31
 
#ifndef lint
 
31
#if 0
32
32
static char sccsid[] = "@(#)rpc_cout.c 1.13 89/02/22 (C) 1987 SMI";
33
33
#endif
34
34
 
164
164
 
165
165
        if (Inline == 0)
166
166
                return;
167
 
        /* May cause lint to complain. but  ... */
168
 
        f_print(fout, "\t register int32_t *buf;\n\n");
169
167
}
170
168
 
171
169
static void
266
264
                        } else {
267
265
                                print_ifopen(indent, "array");
268
266
                        }
269
 
                        print_ifarg("(char **)");
 
267
                        /* The (void*) avoids a gcc-4.1 warning */
 
268
                        print_ifarg("(char **)(void*)");
270
269
                        if (*objname == '&') {
271
270
                                f_print(fout, "%s.%s_val, (u_int *)%s.%s_len",
272
271
                                        objname, name, objname, name);
390
389
        char           *sizestr, *plus;
391
390
        char            ptemp[256];
392
391
        int             can_inline;
 
392
        const char      *buf_declaration;
393
393
 
394
394
 
395
395
        if (Inline == 0) {
396
396
                for (dl = def->def.st.decls; dl != NULL; dl = dl->next)
397
397
                        print_stat(1, &dl->decl);
398
398
        } else {
399
 
 
400
 
                for (dl = def->def.st.decls; dl != NULL; dl = dl->next)
401
 
                        if (dl->decl.rel == REL_VECTOR) {
402
 
                                f_print(fout, "\t int i;\n");
403
 
                                break;
404
 
                        }
405
399
                size = 0;
406
400
                can_inline = 0;
407
401
                for (dl = def->def.st.decls; dl != NULL; dl = dl->next)
444
438
                        i = 0;
445
439
                        size = 0;
446
440
                        sizestr = NULL;
 
441
                        buf_declaration = "int32_t *";
447
442
                        for (dl = def->def.st.decls; dl != NULL; dl = dl->next) {       /* xxx */
448
443
 
449
444
                                /* now walk down the list and check for basic types */
497
492
 
498
493
                                                        /* were already looking at a xdr_inlineable structure */
499
494
                                                        if (sizestr == NULL)
500
 
                                                                f_print(fout, "\t buf = XDR_INLINE(xdrs,%d * BYTES_PER_XDR_UNIT);",
501
 
                                                                        size);
 
495
                                                                f_print(fout, "\t %sbuf = XDR_INLINE(xdrs,%d * BYTES_PER_XDR_UNIT);",
 
496
                                                                        buf_declaration, size);
502
497
                                                        else if (size == 0)
503
498
                                                                f_print(fout,
504
 
                                                                        "\t buf = XDR_INLINE(xdrs,%s * BYTES_PER_XDR_UNIT);",
505
 
                                                                        sizestr);
 
499
                                                                        "\t %sbuf = XDR_INLINE(xdrs,%s * BYTES_PER_XDR_UNIT);",
 
500
                                                                        buf_declaration, sizestr);
506
501
                                                        else
507
502
                                                                f_print(fout,
508
 
                                                                        "\t buf = XDR_INLINE(xdrs,(%d + %s)* BYTES_PER_XDR_UNIT);",
509
 
                                                                        size, sizestr);
 
503
                                                                        "\t %sbuf = XDR_INLINE(xdrs,(%d + %s)* BYTES_PER_XDR_UNIT);",
 
504
                                                                        buf_declaration, size, sizestr);
 
505
                                                        buf_declaration = "";
510
506
 
511
507
                                                        f_print(fout, "\n\t   if (buf == NULL) {\n");
512
508
 
546
542
 
547
543
                                        /* were already looking at a xdr_inlineable structure */
548
544
                                        if (sizestr == NULL)
549
 
                                                f_print(fout, "\t\tbuf = XDR_INLINE(xdrs,%d * BYTES_PER_XDR_UNIT);",
550
 
                                                        size);
 
545
                                                f_print(fout, "\t\t%sbuf = XDR_INLINE(xdrs,%d * BYTES_PER_XDR_UNIT);",
 
546
                                                        buf_declaration, size);
551
547
                                        else if (size == 0)
552
548
                                                f_print(fout,
553
 
                                                        "\t\tbuf = XDR_INLINE(xdrs,%s * BYTES_PER_XDR_UNIT);",
554
 
                                                        sizestr);
 
549
                                                        "\t\t%sbuf = XDR_INLINE(xdrs,%s * BYTES_PER_XDR_UNIT);",
 
550
                                                        buf_declaration, sizestr);
555
551
                                        else
556
552
                                                f_print(fout,
557
 
                                                        "\t\tbuf = XDR_INLINE(xdrs,(%d + %s)* BYTES_PER_XDR_UNIT);",
558
 
                                                        size, sizestr);
 
553
                                                        "\t\t%sbuf = XDR_INLINE(xdrs,(%d + %s)* BYTES_PER_XDR_UNIT);",
 
554
                                                        buf_declaration, size, sizestr);
 
555
                                        buf_declaration = "";
559
556
 
560
557
                                        f_print(fout, "\n\t\tif (buf == NULL) {\n");
561
558
 
632
629
                break;
633
630
        case REL_VECTOR:
634
631
                f_print(fout, "\t\t{ register %s *genp; \n", decl->type);
 
632
                f_print(fout, "\t\t  int i;\n");
635
633
                f_print(fout, "\t\t  for ( i = 0,genp=objp->%s;\n \t\t\ti < %s; i++){\n\t\t",
636
634
                        decl->name, decl->array_max);
637
635
                emit_single_in_line(decl, flag, REL_VECTOR);
649
647
        int freed=0;
650
648
 
651
649
        if(flag == PUT)
652
 
                f_print(fout,"\t\t IXDR_PUT_");
 
650
                f_print(fout,"\t\t (void) IXDR_PUT_");
653
651
        else    
654
652
                if(rel== REL_ALIAS)
655
653
                        f_print(fout,"\t\t objp->%s = IXDR_GET_",decl->name);