Ver código fonte

vcc: remove .gitignore: it ignores some file that cannot be ignored

intirain 4 anos atrás
pai
commit
d1ed1409fb
3 arquivos alterados com 60 adições e 3 exclusões
  1. 0 3
      .gitignore
  2. 1 0
      include/vcc/defserv.h
  3. 59 0
      include/vcc/plugin.h

+ 0 - 3
.gitignore

@@ -1,3 +0,0 @@
-.vscode
-*.o
-vcc

+ 1 - 0
include/vcc/defserv.h

@@ -0,0 +1 @@
+#define VCC_DEFSERV "39.104.27.216 "

+ 59 - 0
include/vcc/plugin.h

@@ -0,0 +1,59 @@
+/* vcc/include/vcc/plugin.h 
+ * 
+ * This file is part of vcc. 
+ * 
+ * vcc is free software: you can redistribute it and/or modify 
+ * it under the terms of the GNU General Public License as published by 
+ * the Free Software Foundation, either version 3 of the License, or 
+ * (at your option) any later version. 
+ * 
+ * vcc is distributed in the hope that it will be useful, 
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of 
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+ * GNU General Public License for more details. 
+ * 
+ * You should have received a copy of the GNU General Public License 
+ * along with vcc. If not, see <https://www.gnu.org/licenses/>
+ */ 
+
+
+
+
+#ifndef __VCC_PLUGIN_H
+#define __VCC_PLUGIN_H
+
+#include <sys/types.h>
+#include <vcc/vcc.h>
+
+/* a plugin can define their own commands in cmd.c, and must check 
+ * it inserted, and abort command execution if it doesn't. */
+
+struct cmdtable {
+	char 			*cmd;
+	int 			(* do_cmd) (char *);
+	char 			*help;
+};
+
+struct plugin {
+#define PLG_INSERTED 		1
+	int 			state;
+	/* name of the plugin */
+	char 			*name;
+	/* short description */
+	char 			*descr;
+	struct cmdtable 	*cmdtab;
+};
+
+/* plugin.c */
+extern struct plugin *plugins[];
+
+#define plg_check_enabled() ({	\
+	if (this_plg->state != PLG_INSERTED) { \
+		fprintf(stderr, "*** this plugin didn't inserte. " \
+				"please insert it by -pins and try it again. \n"); \
+		return 1; \
+	} \
+})
+
+#endif
+