10-22-2015
Do not include this file in more than one C file in the same program, this would either cause mass duplication of the data, or symbol errors on compilation due to it being defined repeatedly in every file you use.
10 More Discussions You Might Find Interesting
1. Linux
say i have these many file in a directory named exam.
1)/exam/newfolder/link.txt.
2)/exam/newfolder1/
and i create a tar say exam.tar
well the problem is,
when i read the tar file i dont find any metadata about the directories,as you cannot create a tar containig empty directories.
on the... (2 Replies)
Discussion started by: Tanvirk
2 Replies
2. Programming
Hello, I have a shell script I wrote in /bin/sh to backup my web sever. I am now on a host (someone reselling rackspace server hosting to me) and when setting up cron, it actually has a dropdown list of "command languages" that you have to choose from.
my options are:
ruby
php
perl... (0 Replies)
Discussion started by: jzacsh
0 Replies
3. UNIX for Dummies Questions & Answers
Can someone tell me how to do this?
Just a thought that entered my mind when learning about structs.
First thought was:
struct one
{
struct two;
}
struct two
{
three;
}
one->two->three
would this be how you would access "three"? (1 Reply)
Discussion started by: unbelievable21
1 Replies
4. Programming
Hello,
I found some code on line.
Is a python function that bring up an Internet interface, here the code:
# Get existing device flags
ifreq = struct.pack('16sh', 'wlan0', 0)
flags = struct.unpack('16sh', fcntl.ioctl(sockfd, SIOCGIFFLAGS, ifreq))
I'm starting... (1 Reply)
Discussion started by: Dedalus
1 Replies
5. Programming
Hi guys.
I have a header file including a structure like this:
typedef struct
{
int index = -1;
stack_node *head;
} stack;
But when compiling with cc it shows error at the assignment line (int index = -1):
error: expected ‘:', ‘,', ‘;', ‘}' or ‘__attribute__' before ‘=' token... (1 Reply)
Discussion started by: majid.merkava
1 Replies
6. Programming
Hi,
I have received an application that stores some properties in a file. The existing struct looks like this:
struct TData
{
UINT uSizeIncludingStrings;
// copy of Telnet data struct
UINT uSize;
// basic properties:
TCHAR szHost; //defined in Sshconfig
UINT iPortNr;
TCHAR... (2 Replies)
Discussion started by: Powerponken
2 Replies
7. Programming
hi everybody,
I need some help with some programming.
I need to write a file that can search in a text file and read the whole line into a struct.
the struct =
struct Transistor
{
char chType;
char chFabrikant;
float fPrijs;
enum Transistor_Behuizing { empty,TO18, TO39,... (8 Replies)
Discussion started by: metal005
8 Replies
8. Programming
Here i am having ".tmideg0"hidden file .
I have made programm but it doesnot work
#!/usr/bin/perl
$runDir = $ENV{"REGR_RUN_DIR"};
@files = (<*.tmideg0> <*.tmideg1>);
foreach $FILE (@files)
{
open (IN, $FILE) || die "Couldn't open $FILE for reading";
open (OUT,... (2 Replies)
Discussion started by: avi1991nash
2 Replies
9. Shell Programming and Scripting
Hello
I am facing a very unique problem and not able to understand why. I have written a function which will check header of the file. If header is present good else it will write the header on top
def writeHeaderOutputCSV(fileName):
# See if the file exist already
try:
... (0 Replies)
Discussion started by: radioactive9
0 Replies
10. Shell Programming and Scripting
I've been struggling with this one for quite a while and cannot seem to find a solution for this find/replace scenario. Perhaps I'm getting rusty.
I have a file that contains a number of metrics (exactly 3 fields per line) from a few appliances that are collected in parallel. To identify the... (3 Replies)
Discussion started by: verdepollo
3 Replies
dlsym(3) Library Functions Manual dlsym(3)
NAME
dlsym - Obtain the address of a symbol from a dlopen() object
SYNOPSIS
#include <dlfcn.h>
void *dlsym(void *handle, const char *name)
PARAMETERS
The value returned from a call to dlopen() (and which has not since been released by a call to dlclose()). The name (character string) of
the symbol being sought.
DESCRIPTION
The dlsym function allows a process to obtain the address of a symbol defined within an object made accessible by a dlopen() call.
The dlsym function will search for the named symbol in all objects loaded automatically as a result of loading the object referenced by
handle (see dlopen(3)). Load ordering is used in dlsym() operations upon the global symbol object. The symbol resolution algorithm used
will be in dependency order as described in dlopen().
RETURN VALUE
The dlsym() function will return NULL, if handle does not refer to a valid object opened by dlopen() or if the named symbol cannot be found
within any of the objects associated with handle. More detailed diagnostic information is available through dlerror().
ERRORS
No errors are defined.
EXAMPLES
The following example shows how one can use dlopen() and dlsym() to access either function or data objects. For simplicity, error checking
has been omitted.
void *handle;
int *iptr, (*fptr)(int);
/* open the needed object */
handle = dlopen("/usr/home/me/libfoo.so.1", RTLD_LAZY);
/* find the address of function and data objects */
fptr = (int (*)(int))dlsym(handle, "my_function");
iptr = (int *)dlsym(handle, "my_object");
/* invoke function, passing value of integer as a parameter */
(*fptr)(*iptr);
APPLICATION USAGE
Special-purpose values for handle are reserved for future use. These values and their meanings are: Specifies the next object after this
one that defines name. This one refers to the object containing the invocation of dlsym(). The next object is the one found upon the
application of a load order symbol resolution algorithm (see dlopen(3)). The next object is either one of global scope - because it was
introduced as part of the original process image or because it was added with a dlopen() operation including the RTLD_GLOBAL flag) - or an
object that was included in the same dlopen() operation that loaded this one. The RTLD_NEXT flag is useful to navigate an intentionally
created hierarchy of multiply defined symbols created through interposition. For example, if a program wished to create an implementation
of malloc() that embedded some statistics gathering about memory allocations, such an implementation could use the real malloc() definition
to perform the memory allocation - and itself only embed the necessary logic to implement the statistics gathering function.
NOTES
Use of the dlsym routine is the preferred mechanism for retrieving symbol addresses. This routine reliably returns the current address of
a symbol at any point in the program, while the dynamic symbol resolution described previously might not function as expected due to com-
piler optimizations. For example, the address of a symbol might be saved in a register prior to a dlopen call, and the saved address might
then be used after the dlopen call - even if the dlopen call changed the resolution of the symbol.
RELATED INFORMATION
dlclose(3), dlerror(3), dlopen(3). delim off
dlsym(3)