aboutsummaryrefslogtreecommitdiffstats
path: root/libasn1compiler/asn1c_misc.c
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2004-08-19 13:29:18 +0000
committerLev Walkin <vlm@lionet.info>2004-08-19 13:29:18 +0000
commit4b102255b52174eeb6051dc093245c36b83a6e6c (patch)
tree825d0e3ff7f03a9a0a788e4c262db6b764d3d1a5 /libasn1compiler/asn1c_misc.c
parentacd9f8b3668896d6d37f34965870ae04a989a4ff (diff)
moved around
Diffstat (limited to 'libasn1compiler/asn1c_misc.c')
-rw-r--r--libasn1compiler/asn1c_misc.c58
1 files changed, 0 insertions, 58 deletions
diff --git a/libasn1compiler/asn1c_misc.c b/libasn1compiler/asn1c_misc.c
index 257e02c5..ee436960 100644
--- a/libasn1compiler/asn1c_misc.c
+++ b/libasn1compiler/asn1c_misc.c
@@ -1,10 +1,6 @@
#include "asn1c_internal.h"
#include <asn1fix_export.h>
-#ifndef DEFFILEMODE /* Normally in <sys/stat.h> */
-#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
-#endif
-
/*
* Construct identifier from multiple parts.
* Convert unsafe characters to underscores.
@@ -85,60 +81,6 @@ asn1c_make_identifier(int unsafe_only_spaces, char *arg1, ...) {
return storage;
}
-FILE *
-asn1c_open_file(arg_t *arg, const char *name, const char *ext) {
- int created = 1;
- struct stat sb;
- char *fname;
- int len;
- FILE *fp;
- int fd;
-
- (void)arg; /* Unused argument */
-
- /*
- * Compute filenames.
- */
- len = strlen(name) + strlen(ext) + 1;
- fname = alloca(len);
- snprintf(fname, len, "%s%s", name, ext);
-
- /*
- * Create files.
- */
- fd = open(fname, O_CREAT | O_EXCL | O_WRONLY, DEFFILEMODE);
- if(fd == -1 && errno == EEXIST) {
- fd = open(fname, O_WRONLY, DEFFILEMODE);
- created = 0;
- }
- if(fd == -1) {
- perror(fname);
- return NULL;
- }
-
- /*
- * Check sanity.
- */
- if(fstat(fd, &sb) || !S_ISREG(sb.st_mode)) {
- fprintf(stderr, "%s: Not a regular file\n", fname);
- if(created) unlink(fname);
- close(fd);
- return NULL;
- }
-
- (void)ftruncate(fd, 0);
-
- /*
- * Convert file descriptor into file pointer.
- */
- fp = fdopen(fd, "w");
- if(fp == NULL) {
- if(created) unlink(fname);
- close(fd);
- }
- return fp;
-}
-
char *
asn1c_type_name(arg_t *arg, asn1p_expr_t *expr, enum tnfmt _format) {
char *typename;