Advertisement
Guest User

employee.h

a guest
May 21st, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.02 KB | None | 0 0
  1. /*-
  2.  * Copyright (c) 2012 valsorym <[email protected]>.
  3.  * All rights reserved.
  4.  *
  5.  * Discussion on the forums.freebsd.org.
  6.  *  url: http://forums.freebsd.org/showthread.php?p=177208
  7.  */
  8.  
  9. /*
  10.  * Very simple class, for example OOD in ANSI C.
  11.  */
  12.  
  13. #ifndef EMPLOYEE_H
  14. #define EMPLOYEE_H
  15.  
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19.  
  20. #include "human.h"
  21.  
  22. /* Сlass of persons. */
  23. struct w_employee {
  24.     /* Private: */
  25.     struct w_human *human;
  26.     char *post;
  27. };
  28.  
  29. /* Class initializer. */
  30. extern const struct w_employee_vtable {
  31.     struct w_employee *(*create)(int , char *, char *);
  32.     void (*destroy)(struct w_employee *);
  33.    
  34.     char *(*setpost)(struct w_employee *, char *);
  35.     char *(*getpost)(struct w_employee *);
  36.  
  37.     /* w_human methods. */
  38.     int (*setage)(struct w_employee *, int );
  39.     int (*getage)(struct w_employee *);
  40.    
  41.     char *(*setname)(struct w_employee *, char *);
  42.     char *(*getname)(struct w_employee *);
  43. } w_employee;
  44.  
  45. #endif
  46.  
  47. /* The End. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement