home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 18921 < prev    next >
Encoding:
Internet Message Format  |  1992-12-27  |  1.7 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!not-for-mail
  2. From: ren@function.mps.ohio-state.edu (Liming Ren)
  3. Newsgroups: comp.lang.c
  4. Subject: Qusetions about UC Berkerley header file. Help!
  5. Date: 27 Dec 1992 22:15:41 -0500
  6. Organization: Department of Mathematics, The Ohio State University
  7. Lines: 34
  8. Distribution: world
  9. Message-ID: <1hlrgtINNs0e@function.mps.ohio-state.edu>
  10. NNTP-Posting-Host: function.mps.ohio-state.edu
  11.  
  12. This question bugs me all the day. I hope it makes sense.
  13.  
  14. I am reading two header files distributed by UC Berkley. One is search.h
  15. and the other one is db.h (they are about hashing, Btree etc).
  16.  
  17. (1) In search.h, there are several lines such as:
  18.  
  19. int      hcreate __P((unsigned int));
  20. void     hdestroy __P((void));
  21. ENTRY   *hsearch __P((ENTRY, ACTION));
  22.  
  23. I don't understand this. It seems __P is a function returns ....(confused 
  24. here).  What are hcreate , hdestroy etc anyway?
  25.  
  26. (2) In db.h, there is a definition for  DB:
  27.  
  28. typedef struct __db {
  29.         DBTYPE type;                    /* underlying db type */
  30.         int (*close)    __P((struct __db *));
  31.         int (*del)      __P((const struct __db *, const DBT *, unsigned int));
  32.         int (*get)      __P((const struct __db *, const DBT *, DBT *,
  33.                             unsigned int));
  34.         int (*put)      __P((const struct __db *, const DBT *, const DBT *,
  35.                             unsigned int));
  36.         int (*seq)      __P((const struct __db *, DBT *, DBT *, unsigned int));
  37.         int (*sync)     __P((const struct __db *));
  38.         void *internal;                 /* access method private */
  39. } DB;
  40.  
  41. What is __P again? To my best knowledge, C does not support function
  42. overloading. BUT what is this? 
  43.  
  44. Many thanks!
  45.  
  46.