First replicant yay

This commit is contained in:
Sasha Koshka
2023-11-13 19:05:51 -05:00
parent 55dfca6341
commit a6fa746ef3
18 changed files with 299 additions and 78 deletions

10
libXmd/include/Xmd/Dir.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef _XmdDir_h
#define _XmdDir_h
#include <X11/Intrinsic.h>
/* XmdDirGetUser returns the location of the Xmd user directory, which is
located at $HOME/.Xmd */
String XmdDirGetUser ();
#endif

View File

@@ -0,0 +1,12 @@
#ifndef _XmdError_h
#define _XmdError_h
typedef enum {
XmdErrorNone,
XmdErrorOutOfMemory,
XmdErrorFileNotFound,
XmdErrorCantOpenFile,
XmdErrorBadSyntax
} XmdError;
#endif

View File

@@ -11,8 +11,11 @@
/* XmdReplicantState contains state information for a replicant instance. */
typedef struct _XmdReplicantState XmdReplicantState;
typedef int (*XmdReplicantVersion) ();
typedef Widget (*XmdReplicantCreate) (Widget parent, XmdReplicantState *state);
typedef int (*XmdReplicantFnVersion) ();
typedef void (*XmdReplicantFnConstruct) ();
typedef void (*XmdReplicantFnDestruct) ();
typedef Widget (*XmdReplicantFnCreate) (
Widget parent, XmdReplicantState *state);
/* XmdReplicantOpen opens a replicant from the file located at path. Replicant
files hold state and point to shared object files containing their code.
@@ -36,6 +39,12 @@ typedef Widget (*XmdReplicantCreate) (Widget parent, XmdReplicantState *state);
Version must return the value of XmdREPLICANT_VERSION. This is used to detect
the API version that the replicant was compiled with, and applications with a
different API version will refuse to load it.
void NAME_XmdReplicantConstruct ();
Construct is called when the shared object is loaded.
void NAME_XmdReplicantDestruct ();
Descruct is called before the shared object is unloaded.
Widget NAME_XmdReplicantCreate (Widget parent, XmdReplicantState *state);
Create instantiates a new widget representing the replicant given by state.