strtoq.c revision 101912
1200581Srdivacky/*-
2200581Srdivacky * Copyright (c) 1992, 1993
3200581Srdivacky *	The Regents of the University of California.  All rights reserved.
4200581Srdivacky *
5200581Srdivacky * Redistribution and use in source and binary forms, with or without
6200581Srdivacky * modification, are permitted provided that the following conditions
7200581Srdivacky * are met:
8200581Srdivacky * 1. Redistributions of source code must retain the above copyright
9200581Srdivacky *    notice, this list of conditions and the following disclaimer.
10200581Srdivacky * 2. Redistributions in binary form must reproduce the above copyright
11200581Srdivacky *    notice, this list of conditions and the following disclaimer in the
12200581Srdivacky *    documentation and/or other materials provided with the distribution.
13200581Srdivacky * 3. All advertising materials mentioning features or use of this software
14200581Srdivacky *    must display the following acknowledgement:
15200581Srdivacky *	This product includes software developed by the University of
16200581Srdivacky *	California, Berkeley and its contributors.
17243830Sdim * 4. Neither the name of the University nor the names of its contributors
18243830Sdim *    may be used to endorse or promote products derived from this software
19200581Srdivacky *    without specific prior written permission.
20200581Srdivacky *
21200581Srdivacky * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22200581Srdivacky * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23200581Srdivacky * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24200581Srdivacky * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25200581Srdivacky * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26200581Srdivacky * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27200581Srdivacky * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28208599Srdivacky * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29207618Srdivacky * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30200581Srdivacky * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31200581Srdivacky * SUCH DAMAGE.
32200581Srdivacky */
33200581Srdivacky
34200581Srdivacky#if defined(LIBC_SCCS) && !defined(lint)
35200581Srdivackystatic char sccsid[] = "@(#)strtoq.c	8.1 (Berkeley) 6/4/93";
36208599Srdivacky#endif /* LIBC_SCCS and not lint */
37207618Srdivacky#include <sys/cdefs.h>
38207618Srdivacky__FBSDID("$FreeBSD: head/lib/libc/stdlib/strtoq.c 101912 2002-08-15 09:25:04Z robert $");
39200581Srdivacky
40200581Srdivacky#include <sys/types.h>
41200581Srdivacky
42200581Srdivacky#include <stdlib.h>
43200581Srdivacky
44200581Srdivacky/*
45200581Srdivacky * Convert a string to a quad integer.
46200581Srdivacky */
47200581Srdivackyquad_t
48200581Srdivackystrtoq(const char *nptr, char **endptr, int base)
49200581Srdivacky{
50200581Srdivacky
51200581Srdivacky	return strtoll(nptr, endptr, base);
52200581Srdivacky}
53200581Srdivacky