]> git.ozlabs.org Git - ccan/blob - ccan/nfs/_info
base64: fix for unsigned chars (e.g. ARM).
[ccan] / ccan / nfs / _info
1 #include "config.h"
2 #include <string.h>
3 #include <stdio.h>
4
5 /**
6  * nfs - nfs client library
7  *
8  * This code offers a POSIX-like interface directly to an NFS server.
9  *
10  * Note: various files are generated from the XDR descriptions in the rpc/
11  * directory using rpcgen.
12  *
13  * Author: Ronnie Sahlberg <ronniesahlberg@gmail.com>
14  * License: GPL
15  *
16  * Example:
17  * #include <ccan/nfs/nfs.h>
18  * #include <err.h>
19  * #include <stdio.h>
20  * #include <sys/types.h>
21  * #include <sys/stat.h>
22  * #include <unistd.h>
23  *
24  * int main(int argc, char *argv[])
25  * {
26  *      struct nfs_context *nfs;
27  *      struct stat st;
28  *
29  *      if (argc != 4)
30  *              errx(1, "Usage: %s <serveraddr> <export> <filename>", argv[0]);
31  *      nfs = nfs_init_context();
32  *      if (!nfs)
33  *              err(1, "Initializing nfs context");
34  *
35  *      if (nfs_mount_sync(nfs, argv[1], argv[2]) != 0)
36  *              errx(1, "Failed to mount nfs share: %s", nfs_get_error(nfs));
37  *
38  *      if (nfs_stat_sync(nfs, argv[3], &st) != 0)
39  *              errx(1, "Failed to stat(%s): %s", argv[3], nfs_get_error(nfs));
40  *
41  *      printf("Mode %04o\n", st.st_mode);
42  *      printf("Size %u\n", (int)st.st_size);
43  *      printf("Inode %u\n", (int)st.st_ino);
44  *
45  *      nfs_destroy_context(nfs);
46  *      printf("nfsclient finished\n");
47  *      return 0;
48  *}
49  */
50 int main(int argc, char *argv[])
51 {
52         /* Expect exactly one argument */
53         if (argc != 2)
54                 return 1;
55
56         if (strcmp(argv[1], "depends") == 0) {
57                 printf("ccan/compiler\n");
58                 return 0;
59         }
60
61         return 1;
62 }