summaryrefslogtreecommitdiff
path: root/ccode
diff options
context:
space:
mode:
Diffstat (limited to 'ccode')
-rw-r--r--ccode/valaccodefile.vala14
1 files changed, 12 insertions, 2 deletions
diff --git a/ccode/valaccodefile.vala b/ccode/valaccodefile.vala
index cf4870267..a82eac5c0 100644
--- a/ccode/valaccodefile.vala
+++ b/ccode/valaccodefile.vala
@@ -22,7 +22,7 @@
public class Vala.CCodeFile {
- public bool is_header { get; set; }
+ public CCodeFileType cfile_type { get; set; }
public weak SourceFile? file { get; private set; }
@@ -41,6 +41,9 @@ public class Vala.CCodeFile {
public CCodeFile (SourceFile? source_file = null) {
file = source_file;
+ if (source_file != null) {
+ cfile_type = CCodeFileType.SOURCE;
+ }
}
public bool add_declaration (string name) {
@@ -151,7 +154,7 @@ public class Vala.CCodeFile {
return false;
}
- if (!is_header) {
+ if (cfile_type == CCodeFileType.SOURCE) {
writer.line_directives = line_directives;
comments.write (writer);
@@ -210,3 +213,10 @@ public class Vala.CCodeFile {
}
}
+[Flags]
+public enum CCodeFileType {
+ SOURCE,
+ PUBLIC_HEADER,
+ INTERNAL_HEADER,
+ HEADER = PUBLIC_HEADER | INTERNAL_HEADER
+}