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