| 1 |
/* do not edit automatically generated by mc from mcComment. */ |
| 2 |
/* mcComment.def provides a module to remember the comments. |
| 3 |
|
| 4 |
Copyright (C) 2015-2025 Free Software Foundation, Inc. |
| 5 |
Contributed by Gaius Mulley <[email protected]>. |
| 6 |
|
| 7 |
This file is part of GNU Modula-2. |
| 8 |
|
| 9 |
GNU Modula-2 is free software; you can redistribute it and/or modify |
| 10 |
it under the terms of the GNU General Public License as published by |
| 11 |
the Free Software Foundation; either version 3, or (at your option) |
| 12 |
any later version. |
| 13 |
|
| 14 |
GNU Modula-2 is distributed in the hope that it will be useful, but |
| 15 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 |
General Public License for more details. |
| 18 |
|
| 19 |
You should have received a copy of the GNU General Public License |
| 20 |
along with GNU Modula-2; see the file COPYING3. If not see |
| 21 |
<http://www.gnu.org/licenses/>. */ |
| 22 |
|
| 23 |
|
| 24 |
#if !defined (_mcComment_H) |
| 25 |
# define _mcComment_H |
| 26 |
|
| 27 |
#include "config.h" |
| 28 |
#include "system.h" |
| 29 |
# ifdef __cplusplus |
| 30 |
extern "C" { |
| 31 |
# endif |
| 32 |
#include <stdbool.h> |
| 33 |
# if !defined (PROC_D) |
| 34 |
# define PROC_D |
| 35 |
typedef void (*PROC_t) (void); |
| 36 |
typedef struct { PROC_t proc; } PROC; |
| 37 |
# endif |
| 38 |
|
| 39 |
# include "GSYSTEM.h" |
| 40 |
# include "GDynamicStrings.h" |
| 41 |
# include "GnameKey.h" |
| 42 |
|
| 43 |
# if defined (_mcComment_C) |
| 44 |
# define EXTERN |
| 45 |
# else |
| 46 |
# define EXTERN extern |
| 47 |
# endif |
| 48 |
|
| 49 |
#if !defined (mcComment_commentDesc_D) |
| 50 |
# define mcComment_commentDesc_D |
| 51 |
typedef void *mcComment_commentDesc; |
| 52 |
#endif |
| 53 |
|
| 54 |
|
| 55 |
/* |
| 56 |
initComment - the start of a new comment has been seen by the lexical analyser. |
| 57 |
A new comment block is created and all addText contents are placed |
| 58 |
in this block. onlySpaces indicates whether we have only seen |
| 59 |
spaces on this line. The new comment descriptor is returned. |
| 60 |
If onlySpaces is TRUE then an inbody comment is created. |
| 61 |
If onlySpaces is FALSE then an after statement comment is created. |
| 62 |
*/ |
| 63 |
|
| 64 |
EXTERN mcComment_commentDesc mcComment_initComment (bool onlySpaces); |
| 65 |
|
| 66 |
/* |
| 67 |
addText - cs is a C string (null terminated) which contains comment text. |
| 68 |
*/ |
| 69 |
|
| 70 |
EXTERN void mcComment_addText (mcComment_commentDesc cd, void * cs); |
| 71 |
|
| 72 |
/* |
| 73 |
getContent - returns the content of comment, cd. |
| 74 |
*/ |
| 75 |
|
| 76 |
EXTERN DynamicStrings_String mcComment_getContent (mcComment_commentDesc cd); |
| 77 |
|
| 78 |
/* |
| 79 |
getCommentCharStar - returns the contents of the comment, cd. |
| 80 |
*/ |
| 81 |
|
| 82 |
EXTERN void * mcComment_getCommentCharStar (mcComment_commentDesc cd); |
| 83 |
|
| 84 |
/* |
| 85 |
setProcedureComment - changes the type of comment, cd, to a |
| 86 |
procedure heading comment, |
| 87 |
providing it has the procname as the first word. |
| 88 |
*/ |
| 89 |
|
| 90 |
EXTERN void mcComment_setProcedureComment (mcComment_commentDesc cd, nameKey_Name procname); |
| 91 |
|
| 92 |
/* |
| 93 |
getProcedureComment - returns the procedure comment if available. |
| 94 |
*/ |
| 95 |
|
| 96 |
EXTERN DynamicStrings_String mcComment_getProcedureComment (mcComment_commentDesc cd); |
| 97 |
|
| 98 |
/* |
| 99 |
getAfterStatementComment - returns the after comment if available. |
| 100 |
*/ |
| 101 |
|
| 102 |
EXTERN DynamicStrings_String mcComment_getAfterStatementComment (mcComment_commentDesc cd); |
| 103 |
|
| 104 |
/* |
| 105 |
getInbodyStatementComment - returns the statement comment if available. |
| 106 |
*/ |
| 107 |
|
| 108 |
EXTERN DynamicStrings_String mcComment_getInbodyStatementComment (mcComment_commentDesc cd); |
| 109 |
|
| 110 |
/* |
| 111 |
isProcedureComment - returns TRUE if, cd, is a procedure comment. |
| 112 |
*/ |
| 113 |
|
| 114 |
EXTERN bool mcComment_isProcedureComment (mcComment_commentDesc cd); |
| 115 |
|
| 116 |
/* |
| 117 |
isBodyComment - returns TRUE if, cd, is a body comment. |
| 118 |
*/ |
| 119 |
|
| 120 |
EXTERN bool mcComment_isBodyComment (mcComment_commentDesc cd); |
| 121 |
|
| 122 |
/* |
| 123 |
isAfterComment - returns TRUE if, cd, is an after comment. |
| 124 |
*/ |
| 125 |
|
| 126 |
EXTERN bool mcComment_isAfterComment (mcComment_commentDesc cd); |
| 127 |
# ifdef __cplusplus |
| 128 |
} |
| 129 |
# endif |
| 130 |
|
| 131 |
# undef EXTERN |
| 132 |
#endif |