*/\r
\r
#include "imports.h"\r
-#include "slang_utility.h"\r
#include "slang_export.h"\r
\r
/*\r
return &self->entries[n];\r
}\r
\r
+/*\r
+ * slang_export_code_entry\r
+ */\r
+\r
+static GLvoid slang_export_code_entry_ctr (slang_export_code_entry *self)\r
+{\r
+ self->name = SLANG_ATOM_NULL;\r
+ self->address = ~0;\r
+}\r
+\r
+static GLvoid slang_export_code_entry_dtr (slang_export_code_entry *self)\r
+{\r
+}\r
+\r
+/*\r
+ * slang_export_code_table\r
+ */\r
+\r
+GLvoid slang_export_code_table_ctr (slang_export_code_table *self)\r
+{\r
+ self->entries = NULL;\r
+ self->count = 0;\r
+ self->atoms = NULL;\r
+}\r
+\r
+GLvoid slang_export_code_table_dtr (slang_export_code_table *self)\r
+{\r
+ if (self->entries != NULL)\r
+ {\r
+ GLuint i;\r
+\r
+ for (i = 0; i < self->count; i++)\r
+ slang_export_code_entry_dtr (&self->entries[i]);\r
+ slang_alloc_free (self->entries);\r
+ }\r
+}\r
+\r
+slang_export_code_entry *slang_export_code_table_add (slang_export_code_table *self)\r
+{\r
+ const GLuint n = self->count;\r
+\r
+ self->entries = (slang_export_code_entry *) slang_alloc_realloc (self->entries,\r
+ n * sizeof (slang_export_code_entry), (n + 1) * sizeof (slang_export_code_entry));\r
+ if (self->entries == NULL)\r
+ return NULL;\r
+ slang_export_code_entry_ctr (&self->entries[n]);\r
+ self->count++;\r
+ return &self->entries[n];\r
+}\r
+\r
/*\r
* _slang_find_exported_data()\r
*/\r
{\r
GLuint i;\r
\r
- if (name[0] >= 'a' && name[0] <= 'z' || name[0] >= 'A' && name[0] <= 'Z' || name[0] == '_')\r
+ if ((name[0] >= 'a' && name[0] <= 'z') || (name[0] >= 'A' && name[0] <= 'Z') || name[0] == '_')\r
{\r
parsed[0] = name[0];\r
\r
for (i = 1; i < EXTRACT_MAXLEN; i++)\r
{\r
- if (name[i] >= 'a' && name[i] <= 'z' || name[i] >= 'A' && name[i] <= 'Z' ||\r
- name[i] >= '0' && name[i] <= '9' || name[0] == '_')\r
+ if ((name[i] >= 'a' && name[i] <= 'z') || (name[i] >= 'A' && name[i] <= 'Z') ||\r
+ (name[i] >= '0' && name[i] <= '9') || name[0] == '_')\r
{\r
parsed[i] = name[i];\r
}\r