#ifndef PAGIN_H #define PAGIN_H #ifndef STDIO_H #include #endif #define PAG_FORMAT_NONE 0 #define PAG_FORMAT_PARA 1 #define PAG_FORMAT_QUOT 2 class PAGIN_V{ protected: int format; // Mode de formattage des paragraphe public: virtual void printf (const char *ctl, ...)=0; virtual void check (int nbline)=0; virtual void form (void)=0; virtual void nl (void)=0; virtual void format_paragraphe (char *buf)=0; virtual void format_titre (int niveau, const char *secnum, char *buf)=0; virtual void format_spec (const char *filespec, const char *buf)=0; virtual void format_fct (const char *fctname, int premiere)=0; virtual void format_ref (const char *ref)=0; /*~PROTOBEG~ PAGIN_V */ public: PAGIN_V (void); virtual void finsous (void); int get_format (void); virtual int set_format (int _format); virtual void soussection (void); virtual ~PAGIN_V (void); /*~PROTOEND~ PAGIN_V */ }; class PAGIN: public PAGIN_V { protected: int page; int line; int maxlin; int gauche; /* Marge de gauche */ int lenlin; /* Nombre de caractŠre par ligne */ FILE *fout; int doclose; /* Est-ce que pagin_close fait fclose de fout */ /*~PROTOBEG~ PAGIN */ public: PAGIN (void); void check (int nbline); void close (void); void form (void); void format_fct (const char *fct, int premiere); void format_paragraphe (char *buf); void format_ref (const char *); void format_spec (const char *filespec, const char *buf); void format_titre (int niveau, const char *secnum, char *buf); int getpage (void); void nl (void); int openerr (const char *fname, int quit, int _gauche, int _lenlin, int _linpag); int openfile (FILE *_fout, int _gauche, int _lenlin, int _linpag); void printf (const char *ctl, ...); ~PAGIN (void); /*~PROTOEND~ PAGIN */ }; class PAGIN_IDX: public PAGIN { PAGIN *pout; /*~PROTOBEG~ PAGIN_IDX */ public: PAGIN_IDX (PAGIN *_pout); void format_fct (const char *, int); void format_spec (const char *, const char *); void format_titre (int niveau, const char *secnum, char *buf); /*~PROTOEND~ PAGIN_IDX */ }; class PAGIN_HTML: public PAGIN_V { protected: FILE *fout; int sequence; char *basename; char *title; /*~PROTOBEG~ PAGIN_HTML */ public: PAGIN_HTML (void); void check (int); void close (void); void finsous (void); void form (void); void format_fct (const char *fct, int premiere); void format_paragraphe (char *buf); void format_ref (const char *ref); void format_spec (const char *filespec, const char *buf); void format_titre (int niveau, const char *secnum, char *buf); void fprintf (FILE *f, const char *ctl, ...); void fputs (const char *buf, FILE *fout); void nl (void); int openerr (const char *_basename, int quit); void printf (const char *ctl, ...); int set_format (int _format); void soussection (void); ~PAGIN_HTML (void); /*~PROTOEND~ PAGIN_HTML */ }; class PAGIN_HTML_IDX: public PAGIN_HTML { char *rel_path; // Path relatif du document // par rapport au HOME du serveur httpd int curniv; FILE *mainfout; /*~PROTOBEG~ PAGIN_HTML_IDX */ public: PAGIN_HTML_IDX (void); void finsous (void); void format_fct (const char *fct, int premiere); void format_spec (const char *filespec, const char *buf); void format_titre (int niveau, const char *secnum, char *buf); int openerr (const char *_basename, const char *_rel_path, int quit); void soussection (void); ~PAGIN_HTML_IDX (void); /*~PROTOEND~ PAGIN_HTML_IDX */ }; class PAGIN_TLMP: public PAGIN_V { protected: FILE *fout; int sequence; char *basename; char *title; bool level_first[100]; int level; /*~PROTOBEG~ PAGIN_TLMP */ public: PAGIN_TLMP (void); void check (int); void close (void); void finsous (void); void form (void); void format_fct (const char *fct, int premiere); void format_paragraphe (char *buf); void format_ref (const char *ref); void format_spec (const char *filespec, const char *buf); void format_titre (int niveau, const char *secnum, char *buf); void fprintf (FILE *f, const char *ctl, ...); void fputs (const char *buf, FILE *fout); void nl (void); int openerr (const char *_basename, int quit); void printf (const char *ctl, ...); int set_format (int _format); void soussection (void); ~PAGIN_TLMP (void); /*~PROTOEND~ PAGIN_TLMP */ }; class PAGIN_TLMP_IDX: public PAGIN_TLMP { /*~PROTOBEG~ PAGIN_TLMP_IDX */ public: PAGIN_TLMP_IDX (void); void finsous (void); void format_fct (const char *, int); void format_spec (const char *, const char *); void format_titre (int , const char *, char *); int openerr (const char *, int quit); void soussection (void); ~PAGIN_TLMP_IDX (void); /*~PROTOEND~ PAGIN_TLMP_IDX */ }; class PAGIN_SGML: public PAGIN_V{ bool sgml_aware; protected: FILE *fout; /*~PROTOBEG~ PAGIN_SGML */ public: PAGIN_SGML (void); void check (int); void close (void); void finsous (void); void form (void); void format_fct (const char *fct, int premiere); void format_paragraphe (char *buf); void format_ref (const char *ref); void format_spec (const char *filespec, const char *buf); void format_titre (int niveau, const char *secnum, char *buf); void fprintf (FILE *f, const char *ctl, ...); void fputs (const char *buf, FILE *fout); void nl (void); int openerr (const char *fname, const char *title, const char *author, int quit); void printf (const char *ctl, ...); int set_format (int _format); void soussection (void); ~PAGIN_SGML (void); /*~PROTOEND~ PAGIN_SGML */ }; class PAGIN_SGML_IDX: public PAGIN_SGML{ /*~PROTOBEG~ PAGIN_SGML_IDX */ public: PAGIN_SGML_IDX (void); void finsous (void); void format_fct (const char *, int); void format_spec (const char *, const char *); void format_titre (int , const char *, char *); int openerr (const char *, int quit); void soussection (void); ~PAGIN_SGML_IDX (void); /*~PROTOEND~ PAGIN_SGML_IDX */ }; #endif