home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!not-for-mail
- From: ren@function.mps.ohio-state.edu (Liming Ren)
- Newsgroups: comp.lang.c
- Subject: Qusetions about UC Berkerley header file. Help!
- Date: 27 Dec 1992 22:15:41 -0500
- Organization: Department of Mathematics, The Ohio State University
- Lines: 34
- Distribution: world
- Message-ID: <1hlrgtINNs0e@function.mps.ohio-state.edu>
- NNTP-Posting-Host: function.mps.ohio-state.edu
-
- This question bugs me all the day. I hope it makes sense.
-
- I am reading two header files distributed by UC Berkley. One is search.h
- and the other one is db.h (they are about hashing, Btree etc).
-
- (1) In search.h, there are several lines such as:
-
- int hcreate __P((unsigned int));
- void hdestroy __P((void));
- ENTRY *hsearch __P((ENTRY, ACTION));
-
- I don't understand this. It seems __P is a function returns ....(confused
- here). What are hcreate , hdestroy etc anyway?
-
- (2) In db.h, there is a definition for DB:
-
- typedef struct __db {
- DBTYPE type; /* underlying db type */
- int (*close) __P((struct __db *));
- int (*del) __P((const struct __db *, const DBT *, unsigned int));
- int (*get) __P((const struct __db *, const DBT *, DBT *,
- unsigned int));
- int (*put) __P((const struct __db *, const DBT *, const DBT *,
- unsigned int));
- int (*seq) __P((const struct __db *, DBT *, DBT *, unsigned int));
- int (*sync) __P((const struct __db *));
- void *internal; /* access method private */
- } DB;
-
- What is __P again? To my best knowledge, C does not support function
- overloading. BUT what is this?
-
- Many thanks!
-
-