quota.h revision 1.6
11.1Sdholland/*-
21.1Sdholland * Copyright (c) 2011 The NetBSD Foundation, Inc.
31.1Sdholland * All rights reserved.
41.1Sdholland *
51.1Sdholland * This code is derived from software contributed to The NetBSD Foundation
61.1Sdholland * by David A. Holland.
71.1Sdholland *
81.1Sdholland * Redistribution and use in source and binary forms, with or without
91.1Sdholland * modification, are permitted provided that the following conditions
101.1Sdholland * are met:
111.1Sdholland * 1. Redistributions of source code must retain the above copyright
121.1Sdholland *    notice, this list of conditions and the following disclaimer.
131.1Sdholland * 2. Redistributions in binary form must reproduce the above copyright
141.1Sdholland *    notice, this list of conditions and the following disclaimer in the
151.1Sdholland *    documentation and/or other materials provided with the distribution.
161.1Sdholland *
171.1Sdholland * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
181.1Sdholland * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
191.1Sdholland * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
201.1Sdholland * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
211.1Sdholland * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
221.1Sdholland * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
231.1Sdholland * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
241.1Sdholland * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
251.1Sdholland * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
261.1Sdholland * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
271.1Sdholland * POSSIBILITY OF SUCH DAMAGE.
281.1Sdholland */
291.1Sdholland
301.1Sdholland#ifndef _QUOTA_H_
311.1Sdholland#define _QUOTA_H_
321.1Sdholland
331.1Sdholland#include <sys/types.h>
341.1Sdholland#include <sys/quota.h>
351.1Sdholland
361.1Sdhollandstruct quotahandle; /* Opaque. */
371.1Sdhollandstruct quotacursor; /* Opaque. */
381.1Sdholland
391.1Sdholland
401.1Sdhollandvoid quotaval_clear(struct quotaval *);
411.1Sdholland
421.1Sdhollandstruct quotahandle *quota_open(const char *);
431.1Sdhollandvoid quota_close(struct quotahandle *);
441.1Sdholland
451.1Sdhollandconst char *quota_getmountpoint(struct quotahandle *);
461.1Sdhollandconst char *quota_getmountdevice(struct quotahandle *);
471.1Sdholland
481.1Sdhollandconst char *quota_getimplname(struct quotahandle *);
491.4Sdhollandunsigned quota_getrestrictions(struct quotahandle *);
501.1Sdholland
511.6Sdhollandint quota_getnumidtypes(struct quotahandle *);
521.1Sdhollandconst char *quota_idtype_getname(struct quotahandle *, int /*idtype*/);
531.1Sdholland
541.6Sdhollandint quota_getnumobjtypes(struct quotahandle *);
551.1Sdhollandconst char *quota_objtype_getname(struct quotahandle *, int /*objtype*/);
561.1Sdhollandint quota_objtype_isbytes(struct quotahandle *, int /*objtype*/);
571.1Sdholland
581.5Sdhollandint quota_quotaon(struct quotahandle *, int /*idtype*/);
591.5Sdhollandint quota_quotaoff(struct quotahandle *, int /*idtype*/);
601.5Sdholland
611.1Sdhollandint quota_get(struct quotahandle *, const struct quotakey *,
621.1Sdholland	      struct quotaval *);
631.1Sdholland
641.1Sdhollandint quota_put(struct quotahandle *, const struct quotakey *,
651.1Sdholland	      const struct quotaval *);
661.1Sdholland
671.1Sdhollandint quota_delete(struct quotahandle *, const struct quotakey *);
681.1Sdholland
691.1Sdhollandstruct quotacursor *quota_opencursor(struct quotahandle *);
701.1Sdhollandvoid quotacursor_close(struct quotacursor *);
711.1Sdholland
721.6Sdhollandint quotacursor_skipidtype(struct quotacursor *, int /*idtype*/);
731.1Sdholland
741.1Sdhollandint quotacursor_get(struct quotacursor *, struct quotakey *,
751.1Sdholland		    struct quotaval *);
761.1Sdholland
771.1Sdhollandint quotacursor_getn(struct quotacursor *, struct quotakey *,
781.1Sdholland		     struct quotaval *, unsigned /*maxnum*/);
791.1Sdholland
801.1Sdhollandint quotacursor_atend(struct quotacursor *);
811.1Sdhollandint quotacursor_rewind(struct quotacursor *);
821.1Sdholland
831.1Sdholland#endif /* _QUOTA_H_ */
84