I've recently created a C program that uses the remedy api from bmc to open a trouble ticket. Since I am a complete C newbie(This is literally the first time I've coded C), I'm not sure if I'm going to have memory problems down the road(spoiled by languages that manage memory for me). The script works, and does what I want it to do, but it's going to be running several hundred times a day, so I don't want to eat up all the memory.
Also, I'd like to store the fields,values in a text file(hard coded right now) in the following format:
I was able to accomplish this using strtok, but if I came across this:
fieldname="the return code is = 12"
I would only get "the return code is" for the value. How do I grab the rest of the information behind the delimiter?
Thanks for all your help.
ctrl.cacheId = 0;
ctrl.sessionId = 0;
if(ARInitialization(&ctrl, &status) >= AR_RETURN_ERROR)
fields.numItems = 30;
fields.fieldValueList = malloc(30*sizeof(ARFieldValueStruct));
field = fields.fieldValueList;
/* this marks the beginning of the items */
/* fieldID and charVal are the values I need to pull from a text file */
field.fieldId = 700000000;
field.value.dataType = AR_DATA_TYPE_CHAR;
field.value.u.charVal = "Tivoli Event ID";
/* repeat about 30 times ... snip */
if(ARCreateEntry(&ctrl, schema, &fields, entryID, &status) >= AR_RETURN_