
human.h
By: a guest on
May 20th, 2012 | syntax:
C | size: 0.94 KB | hits: 14 | expires: Never
/*-
* Copyright (c) 2012 valsorym <valsorym.e@gmail.com>.
* All rights reserved.
*
* Discussion on the forums.freebsd.org.
* url: http://forums.freebsd.org/showthread.php?p=177208
*/
/*
* Very simple class, for example OOD in ANSI C.
*/
/* NEW TYPES */
/* ************************************************************************* */
#ifndef HUMAN_H
#define HUMAN_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* Сlass of persons. */
struct w_human {
/* Private: */
int age;
char *name;
/* Public: */
int (*setage)(struct w_human *, int );
int (*getage)(struct w_human *);
char *(*setname)(struct w_human *, char *);
char *(*getname)(struct w_human *);
};
/* Class initializer. */
extern const struct w_human_initializer {
struct w_human *(*create)(int , char *);
void (*destroy)(struct w_human *);
} w_human;
#endif
/* The End. */