ObjectivelyMVC
Object oriented MVC framework for SDL3 and GNU C
Loading...
Searching...
No Matches
Warning.c File Reference
#include <assert.h>
#include "Warning.h"

Go to the source code of this file.

Macros

#define _Class   _Warning
 

Functions

Class * _Warning (void)
 
static void dealloc (Object *self)
 
static void initialize (Class *clazz)
 
static WarninginitWithFormat (Warning *self, WarningType type, const char *fmt,...)
 
static WarninginitWithVaList (Warning *self, WarningType type, const char *fmt, va_list args)
 

Macro Definition Documentation

◆ _Class

#define _Class   _Warning

Definition at line 28 of file Warning.c.

Function Documentation

◆ _Warning()

Class * _Warning ( void  )

Definition at line 97 of file Warning.c.

97 {
98 static Class *clazz;
99 static Once once;
100
101 do_once(&once, {
102 clazz = _initialize(&(const ClassDef) {
103 .name = "Warning",
104 .superclass = _Object(),
105 .instanceSize = sizeof(Warning),
106 .interfaceOffset = offsetof(Warning, interface),
107 .interfaceSize = sizeof(WarningInterface),
109 });
110 });
111
112 return clazz;
113}
static void initialize(Class *clazz)
Definition Warning.c:85
The Warning type.
Definition Warning.h:50

◆ dealloc()

static void dealloc ( Object *  self)
static
See also
Object::dealloc(Object *)

Definition at line 35 of file Warning.c.

35 {
36
37 Warning *this = (Warning *) self;
38
39 release(this->message);
40
41 super(Object, self, dealloc);
42}
static void dealloc(Object *self)
Definition Warning.c:35

◆ initialize()

static void initialize ( Class *  clazz)
static
See also
Class::initialize(Class *)

Definition at line 85 of file Warning.c.

85 {
86
87 ((ObjectInterface *) clazz->interface)->dealloc = dealloc;
88
89 ((WarningInterface *) clazz->interface)->initWithFormat = initWithFormat;
90 ((WarningInterface *) clazz->interface)->initWithVaList = initWithVaList;
91}
static Warning * initWithFormat(Warning *self, WarningType type, const char *fmt,...)
Definition Warning.c:50
static Warning * initWithVaList(Warning *self, WarningType type, const char *fmt, va_list args)
Definition Warning.c:66
Warning * initWithVaList(Warning *self, WarningType type, const char *fmt, va_list args)
Initializes this Warning with the given type and format string.
Definition Warning.c:66

◆ initWithFormat()

static Warning * initWithFormat ( Warning self,
WarningType  type,
const char *  fmt,
  ... 
)
static

Definition at line 50 of file Warning.c.

50 {
51
52 va_list args;
53 va_start(args, fmt);
54
55 self = $(self, initWithVaList, type, fmt, args);
56
57 va_end(args);
58
59 return self;
60}

◆ initWithVaList()

static Warning * initWithVaList ( Warning self,
WarningType  type,
const char *  fmt,
va_list  args 
)
static

Definition at line 66 of file Warning.c.

66 {
67
68 self = (Warning *) super(Object, self, init);
69 if (self) {
70 self->type = type;
71 assert(self->type);
72
73 self->message = $(alloc(String), initWithVaList, fmt, args);
74 assert(self->message);
75 }
76
77 return self;
78}
static View * init(View *self)
Definition Box.c:67
String * message
The message.
Definition Warning.h:71
WarningType type
The WarningType.
Definition Warning.h:66