12-21-2012
It is at the top of your C file. A struct is a structure of data, and the file seems to be a pile of structures, except an empty structure is legal. The binary image has a structure count at the front, and then each structure has a length, and if it is zero, that structure is empty. There may be other flags in the structure to identify what is in the length. The confusing thing is all the #define type stuff in the structure definition, which is most of the file. I might be good to make a preprocessed file (cc -E) where that stuff is resolved. Once you have the C, you may find it is easier enough to get configuration from some other file type. XML is also popular for C++/JAVA to represent objects in collection objects ad infinitim.
Many fine C tutorials online for free, and gcc is free, too.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all,
I have a print control file (dflt) for Oracle which is in binary. As I am going to develope an application in Window environment, I would like to reference the dflt file. But it is in binary format and I cannot access it. Anyone can suggest me how to convert the file into text or... (5 Replies)
Discussion started by: user12345
5 Replies
2. Programming
Hi All,
Please suggest me how to read a binary file in text or ASCII format.
thanks
Nagendra (3 Replies)
Discussion started by: Nagendra
3 Replies
3. Programming
I'm in the Solaris environment. I want to write data to a file, but I don't want it to be easily read from the C shell. For example, here's my code:
main ()
{
FILE *fo;
fo = fopen ("filename", "w");
fprintf (fo, "This is a test.\n");
fclose (fo);
}
Anyone can open up... (3 Replies)
Discussion started by: serendipity1276
3 Replies
4. Shell Programming and Scripting
Dear guys;
I have a binary file and I need to convert its data to csv format ...appreciating your help.
Best Regards (14 Replies)
Discussion started by: ahmad.diab
14 Replies
5. UNIX for Dummies Questions & Answers
In Unix/Ksh, when I try to look inside a file it says that the file may be a binary file and if I want to see it anyway. When i say 'yes', it shows me the content filled with unreadable symbols (looks like binary). Is there a command that I can run from the Unix prompt to convert/translate that... (3 Replies)
Discussion started by: arthurs
3 Replies
6. UNIX for Dummies Questions & Answers
I would like to convert a .tr file to a binary file to use for trace purposes.
Can anyone provide any insight? (0 Replies)
Discussion started by: sparklezilla3
0 Replies
7. Shell Programming and Scripting
Hi Team,
Here's the requirement.
I have a image file in jpg format in unix.
Now I need to
i. convert the jpg format to binary format
ii. followed by loading the binary file to Oracle db.
Can anyone help me out?
Thanks
Krishnakanth Manivannan (4 Replies)
Discussion started by: kmanivan82
4 Replies
8. Shell Programming and Scripting
dHi,
I have the attached file(actual file can be extracted post unzipping it) & i am trying to use the following code for coversion to hex format.
Starting hex value is 84 which is start of the record & termination is done using 00 00 followed by 84(hex) which i can see in the dump clearly using... (14 Replies)
Discussion started by: siramitsharma
14 Replies
9. UNIX for Beginners Questions & Answers
Hello,
I have a binary csv file that was created on 'Red Hat Enterprise Linux Server release 6.6'. Now we have transferred all files on Ubuntu 16.04.2 LTS/xenial
On opening the file in Ubuntu, there are special characters
... (8 Replies)
Discussion started by: nans
8 Replies
10. Programming
Dear Team
We use DB2 v10.5 and using DBArtisan tool
Can someone please guide how to convert digits to binary numbers using db2 feature.
Ex> for number 9 , binary should be 1001 ( 8+1)
Any help appreciated. Thanks (2 Replies)
Discussion started by: Perlbaby
2 Replies
LEARN ABOUT ULTRIX
t_free
t_free(3xti) t_free(3xti)
Name
t_free - free a library structure
Syntax
#include <xti.h>
int t_free(ptr, struct_type)
char *ptr;
int struct_type;
Arguments
ptr Points to one of the seven structure types described for
struct_type
Identifies the type of that structure, which must be one of the following:
T_BIND_STR struct t_bind;
T_CALL_STR struct t_call
T_OPTMGMT_STR struct t_optmgmt
T_DIS_STR struct t_discon
T_UNITDATA_STR struct t_unitdata
T_UDERROR_STR struct t_uderr
T_INFO_STR struct t_info
Each of these structures is used as an argument to one or more transport functions.
Description
The function frees memory previously allocated by This function frees memory for the specified structure and also frees memory for buffers
referenced by the structure.
---------------------------------------
Parameters Before Call After Call
---------------------------------------
ptr x /
struct_type x /
---------------------------------------
The function checks the addr, opt, and udata fields of the given structure (as appropriate) and free the buffers pointed to by the buf
field of the netbuf structure. If buf is NULL, does not attempt to free memory. After all buffers are freed, frees the memory associated
with the structure pointed to by ptr.
Results are undefined if ptr or any of the buf pointers points to a block of memory not previously allocated by
Return Values
Upon successful completion, a value of 0 is returned. On failure, a value of -1 is returned, and t_errno is set to indicate the error.
Diagnostics
On failure, t_errno is set to one of the following:
[TNOTSUPPORT] This function is not supported by the current implementation of XTI.
[TSYSERR] A system error has occurred during execution of this function.
See Also
t_alloc(3xti)
t_free(3xti)