shithub: fc

Download patch

ref: 9396712b9d1e6f5e1e46d76c5050b7704f4e5a97
parent: 22c7b70edbd06cfb6c7d32ed3d5fc7aa371058da
author: glenda <glenda@krsna>
date: Tue Aug 19 09:52:10 EDT 2025

improvements

--- a/fc.c
+++ b/fc.c
@@ -8,9 +8,9 @@
 
 /* Designed in acme and for acme dev */
 
-#define CONFIG_FILE 						"/tmp/fc.conf"
-#define DEFAULT_CTL_FILE 					"/tmp/fc.ctl"
-#define DEFAULT_SAVE_PATH 					"/tmp/sheet.spr"
+#define CONFIG_FILE 						"/usr/glenda/fc/fc.conf"
+#define DEFAULT_CTL_FILE 					"/usr/glenda/fc/fc.ctl"
+#define DEFAULT_SAVE_PATH 					"/usr/glenda/fc/sheet.spr"
 #define DEFAULT_BANNER_HEIGHT 				25
 #define DEFAULT_STATUS_HEIGHT 				20
 #define DEFAULT_STATUS_MARGIN 				10
@@ -33,7 +33,7 @@
 #define DEFAULT_BOXHEIGHT 					32
 
 #define MAXFORMULA 					256
-#define MAXCONTENT 					384
+#define MAXCONTENT 					300
 #define MAXBOXES 					300
 
 
@@ -133,6 +133,22 @@
 	ulong color_formula;
 };
 
+typedef enum {
+	CFG_INT,
+	CFG_STRING,
+	CFG_COLOR,
+	CFG_BOOL
+} ConfigType;
+
+typedef struct ConfigField ConfigField;
+struct ConfigField {
+	char		*name;
+	ConfigType	type;
+	void		*ptr;
+	int 		maxlen;			
+	void		(*callback)(void);
+};
+
 typedef struct Box Box;
 struct Box {
 	Point		pos;
@@ -148,6 +164,14 @@
 	int			nrefs;
 };
 
+typedef struct BoxType BoxType;
+struct BoxType {
+	char	*name;
+	void	(*parse)(Box*);
+	void	(*eval)(Box*);
+	void	(*draw)(Box*, Image*);
+};
+
 typedef struct Sheet Sheet;
 struct Sheet {
 	Box		boxes[MAXBOXES];
@@ -170,19 +194,11 @@
 	int		gridsize;
 	int		emoji_pos;
 	int		emoji_frame;
-	int		emoji_dir;
+	int		emoji_dir; /* direction */
 	char	*emoji_frames[4];
 	int		emoji_enabled;
 };
 
-typedef struct BoxType BoxType;
-struct BoxType {
-	char	*name;
-	void	(*parse)(Box*);
-	void	(*eval)(Box*);
-	void	(*draw)(Box*, Image*);
-};
-
 typedef struct Token Token;
 struct Token {
 	int	type;
@@ -252,22 +268,7 @@
 	void	(*execute)(char **args, int nargs);
 };
 
-typedef enum {
-	CFG_INT,
-	CFG_STRING,
-	CFG_COLOR,
-	CFG_BOOL
-} ConfigType;
 
-typedef struct ConfigField ConfigField;
-struct ConfigField {
-	char		*name;
-	ConfigType	type;
-	void		*ptr;
-	int 		maxlen;			
-	void		(*callback)(void);
-};
-
 Image	*colors[6];
 Image	*boxbg;
 Image	*boxselected;
@@ -2942,8 +2943,8 @@
 		sheet.current_mode = 0;
 		sheet.needredraw = 1;
 	} else if(key == '\t') {
-		if(!strstr(sheet.filenamebuf, "/tmp/")) {
-			strcat(sheet.filenamebuf, "/tmp/");
+		if(!strstr(sheet.filenamebuf, "/usr/glenda/fc/")) {
+			strcat(sheet.filenamebuf, "/usr/glenda/fc/");
 			sheet.filenamepos = strlen(sheet.filenamebuf);
 			sheet.needredraw = 1;
 		}
--