int gnat_argc = 0;
char **gnat_argv = NULL;
-/* It used to be the case that users were required to forward the envp
- parameter of main to the variable below when using a non-Ada main. The
- consequences for failing to meet the requirement was improper operation of
- Ada.Command_Line.Environment.
-
- Today, users are not required to do anything with gnat_envp and
- Ada.Command_Line.Environment does not use it anymore. In fact it's not used
- by anything, but we keep its definition so that programs that obey the old
- requirement keep linking. */
-char **gnat_envp = NULL;
-
int
__gnat_arg_count (void)
{
memcpy (a, gnat_argv[i], strlen (gnat_argv[i]));
}
-int
-__gnat_env_count (void)
-{
- int i;
- char **envp = __gnat_environ();
-
- for (i = 0; envp[i]; i++)
- ;
- return i;
-}
-
-int
-__gnat_len_env (int env_num)
-{
- char **envp = __gnat_environ();
-
- if (envp != NULL)
- return strlen (envp[env_num]);
- else
- return 0;
-}
-
-void
-__gnat_fill_env (char *a, int i)
-{
- char **envp = __gnat_environ();
-
- if (envp != NULL)
- memcpy (a, envp[i], strlen (envp[i]));
-}
-
#ifdef __cplusplus
}
#endif
#endif
}
+/* It used to be the case that users were required to forward the envp
+ parameter of main to the variable below when using a non-Ada main. The
+ consequences for failing to meet the requirement was improper operation of
+ Ada.Command_Line.Environment.
+
+ Nowadays, users are not required to do anything with gnat_envp and
+ Ada.Command_Line.Environment does not use it anymore. In fact it's not used
+ by anything, but we keep its definition so that programs that obey the old
+ requirement keep linking. */
+char **gnat_envp = NULL;
+
+int
+__gnat_env_count (void)
+{
+ int i;
+ char **envp = __gnat_environ();
+
+ for (i = 0; envp[i]; i++)
+ ;
+ return i;
+}
+
+int
+__gnat_len_env (int env_num)
+{
+ char **envp = __gnat_environ();
+
+ if (envp != NULL)
+ return strlen (envp[env_num]);
+ else
+ return 0;
+}
+
+void
+__gnat_fill_env (char *a, int i)
+{
+ char **envp = __gnat_environ();
+
+ if (envp != NULL)
+ memcpy (a, envp[i], strlen (envp[i]));
+}
+
#ifdef __cplusplus
}
#endif