Programming :: Underscores In Standard Functions, An Example Section From Cat.c Is Included

Sep 4, 2010

From cat.c in GNU coreutils:

Code:
void
usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.

[Code]...

I don't remember ever seeing this in any examples I've ever seen, so I'm sure I've never seen an explanation of this.

View 1 Replies


ADVERTISEMENT

OpenSUSE Install :: Repositories - Packages Not Included In The Standard Repo

Aug 28, 2010

Come across these repositories when looking for packages not included in the standard repo.

Index of /repositories/security/openSUSE_11.3
Index of /repositories/openSUSE:/11.3:/Contrib/standard

what these repositories are for? Are they part of the official/maintained by openSUSE repository?

View 6 Replies View Related

Programming :: Replace Spaces With Underscores In File Names?

Jan 11, 2011

I often get files with many spaces as part of their names. I would like to automatically replace these spaces with underscores, but otherwise not change the file name. Is there a way to do this task with just the bash shell?

View 4 Replies View Related

Programming :: Define Functions Within Other Functions In C++?

Mar 11, 2010

Is it possible to define functions within other functions in C++? I know it is the case in other languages.

View 2 Replies View Related

Programming :: C++ Programming With Simple RTAI Functions Outputing Words?

Apr 11, 2011

I need help as I am not proficient with Linux C++ Programming. There are two parts which I need to do in the coding provided below.

1. Produce the program so it can output the word "Hey there!" and wait two minute and print the word "See you later!".

2. Produce the program that will output the text "Cool" every 20 seconds by setting a periodic task.

Quote:
#include <linux/kernel.h>
#include <linux/module.h>
MODULE_LICENSE("GPL");
int init_module(void)
{
printk("Hey there!

[Code]...

View 3 Replies View Related

OpenSUSE Install :: Immutable Section Of HDD + Differencing Section?

Jul 8, 2010

You maybe know that VirtualBox has an "immutable" feature for HDD images. I.e. setup the system, if the stuff is in place, you can set the image to IMMUTABLE to prevent any changes to the image. Differences are written to a separated image. So on the next boot you'll see that all the (unintended) changes are gone and the "old" system is up & running again. I run an old SuSE 10.3 on a write-protected SD-IDE-Adapter. Changing and playing with RPMs is a mess due to around 50 changes I had to do to make that work. Is there any option to mount an SD-card as RO and having all the changes written to e.g. /dev/sda3? To make it clear: I thought about something like a RAID-X system, but could not find any description on how to setup a raidtab.

View 3 Replies View Related

General :: Deleted The /etc/rc.d/functions Folder And Functions.d Script And Turned Arch Machine Into A Brick?

Mar 19, 2011

None of my daemon scripts work now, and the startup process displayed errors. Should I reinstall the OS and start from scratch, or is there a way to recover these files? Is there a way to rebuild the files I deleted?

View 2 Replies View Related

Programming :: All Hardware Drivers Included In Kernel Sources?

Jan 7, 2009

I am software developer, and I am new in kernel programming. I have token a look at linux sources, I found that drivers of all hardware are included in linux kernel sources. The question is, how Linux include this drivers on the Kernel?

- Including drivers statically in the the kernel is illogical of course. Since drivers will be loaded, all of them, even if they are not used.
- making drivers as dynamic libraries (.so) is not sufficient, too. How does the kernel include this library if it was already compiled and build ?

Moreover, will Linux sources grow every time a new driver take place ? this causes many troubles:
- Compiling linux will become slower year after year.
- linux evolution will be difficult because next versions must support old drivers.
- Linux Distributions will be huge in size.

View 2 Replies View Related

Programming :: Where Are Described Functions That Can Be Used With Stap

Mar 26, 2011

could you please explain few questions about systemtap.

1st
===
seems gettimeofday_s() always returns 0 Code: stap -ve 'probe timer.s(4){ printf("%d ",

[code]....

View 2 Replies View Related

Ubuntu :: Two IDLE Icons In Application Programming Section?

Feb 16, 2011

For some reason I have two IDLE icons in my application programming section:

IDLE
IDLE(using python-2.6)

Both are the exact same versions, and I'm not sure if I need both. I understand that ubuntu runs on 2.6 so I'm a bit hesitant to just delete one without checking here first.

View 1 Replies View Related

Programming :: Append A Block Of Text Into A Particular Section Of A File?

Mar 16, 2010

So I have file which looks something like this:

cat .opera/operaprefs.ini
Code:
[User Prefs]
Language Files Directory=

[code]...

View 1 Replies View Related

Programming :: Deadlock Due To Crash Inside Critical Section?

May 12, 2011

The following two pieces of codes share printing to stdout with a POSIX semaphore /dev/shm/sem.abcd

sema1.c:

Code:
int j;
sem_t *sem = sem_open( "/abcd", O_CREAT, S_IRUSR|S_IWUSR, 1 );
j = 0;
while (j < 100) {

[Code].....

If started at the same time, the first will finish in about 10 seconds; the second 20 secs.

What I want to ask is, if the first program crashes at Checkpoint A, then B will never gets to continue, then normally how do programmers avoid this kind of deadlock due to crashes inside the critical section?

View 3 Replies View Related

Programming :: Extract Dwarf Information Debug A Section?

May 10, 2011

I would like to extract debug information but I have some problems. For example, I have a executable a.out...

Quote:

nm -f sysv a.out | grep ".global_var" >vars.txt

With this command I extract all my variables. All of them are in .global_var section, and it give me follow information:

Quote:

CAN_station_n |08073258| D | OBJECT|00000001| |.global_var
CONTROLend |080732a7| D | OBJECT|00000001| |.global_var

[code]....

Well, I have only address of my vars, but I would like to know type var or struct of the variables. With dwarf dump I have all of information, but it is a mess...

Quote:

<1><117bc>: Abbrev Number: 32 (DW_TAG_variable)
<117bd> DW_AT_name : (indirect string, offset: 0x153d): draw_limits
<117c1> DW_AT_decl_file : 128
<117c2> DW_AT_decl_line : 207

[code]...

Is there any parser or way to put in order this information?? create a file with the follow information:

name of var - address - type - size - struct or not

View 5 Replies View Related

Programming :: Extracting Last Section Of File (Separated By Hashes)

Feb 22, 2011

I have a file which looks something like this:

##########
some
text
text also includes empty lines
##########
some
more
text
##########

Basically all sections are separated by 10 hashes and I need to somehow only print all lines in the last section (the "some more text" part in the example above"). I tried all kind of things with sed and awk but I didn't find any way to identify the last "section".

View 8 Replies View Related

Programming :: Definitions For C Library Functions ?

Apr 24, 2010

Where are the definitions for C library functions located? It was just recently that I realized that header files don't actually define any functions, they merely include their prototypes.

For instance, stdio.h includes the following line:

Code:

This just means that the definition of printf() is located in another file. What file? Is there some kind of default shared object file that is automatically included during compilation?

View 2 Replies View Related

Programming :: Unable To Use An Alias In The Ksh Functions

Apr 4, 2011

I have problem to use an alias that defined in ksh93 script,in the functions in the same script onm Linux.I definied an alias in main: alias echo='echo -e' in order that echo will read backslashes but when i executed it in function, the alias didnt work, and performewd a regular echo, without -e

cat test.ksh
#!/bin/ksh
alias echo='echo -e'
checkUsage

[code]....

View 1 Replies View Related

Programming :: Check The Db For Some Value And Run Some Functions To Do Some Checks?

May 15, 2011

have an application where from time to time I need to check the db for some value and run some functions to do some checks. is the best option do it as php daemon or cron job?Whatworried of cron job is the overalapping.

View 9 Replies View Related

Programming :: Defining Functions - What Is The Difference?

Aug 12, 2010

But what is the difference between this...

Code:
my_fucnction () {
echo "Hello World"
}
Code:
function my_fucnction {

[Code]...

View 10 Replies View Related

Programming :: Multithreading For Callback Functions

Jan 4, 2011

Im implementing a chat application using Jabber/XMPP and gloox framework which should send and receive messages concurrently in Ubuntu Linux.

The problem faced is both the threads are created and pthread_join( ) is called for both.The iSend thread is scheduled first but gets suspended at cin. Once the recv( ) function is called, which runs in iRecv thread, the recv call back function handleMessage( ) is called. However the control never shifts back to the iSend thread which should call SendMessage( ) function.

View 1 Replies View Related

Programming :: Nesting Switch Functions In C?

Apr 12, 2010

I am trying to write a simple program in C that involves nesting switches. For example switch 1 offers an option to go to module 1 or 2 or quit. when I go to module 1 there is another switch function offering two or more choices.

I can select either module 1 or 2 at the start of the program and the selection text for, say, module 1 prints to screen but then exits without allowing a second selection to be entered.

I tried using free([first selection]) thinking that might do the trick but it doesn't.

Is it possible to next switches on after another in C?

View 14 Replies View Related

Programming :: Macos Does Not Have Barrier Functions?

May 9, 2010

The pthreads library on macos does not have barrier functions (pthread_barrier_t ....). Is there a way to get around this? I know I can do :

#ifdef __APPLE__
pthread_barrier_t ...
#else
my_barrier ...
#endif

But I would like to avoid this approach as there are a lot of places in my program where I would have to make this change. Can I perhaps rebuild the pthreads library on macos without affecting other apps ?

View 2 Replies View Related

General :: List Files Beginning With Underscores First When Using `ls -l`?

Aug 3, 2011

I'm using ubuntu (natty), and when I use ls -l, the files are listed, but apparently the sorting algo ignores any special characters. For ages I've used underscores to mark special folders. And it seems to me, that they were always listed first. Now, the underscore is completely ignores. Let's assume that I have the files fileA, _fileB and fileC in a folder. Currently, ls -l orders them like so:

malbert@dredg:/tmp/1$ ls -l
total 0
-rw-r--r-- 1 malbert domain users 0 2011-08-03 15:27 fileA
-rw-r--r-- 1 malbert domain users 0 2011-08-03 15:27 _fileB
-rw-r--r-- 1 malbert domain users 0 2011-08-03 15:27 fileC

[Code]...

I've dug through the ls man page and could not find anything. Is there somewhere a system-wide collation option? Or something the like?

View 1 Replies View Related

Ubuntu :: Broken Shortcuts For Netbeans On Section Applications -> Programming?

Feb 16, 2010

I have two broken shortcuts for Netbeans on section Applications -> Programming.

View 3 Replies View Related

Programming :: Error With Socket Shared Between Functions?

Dec 21, 2010

Let's show the problem: I have a socked connection (in a fd var). In certain moment, I need to use the same socket in two threads. Lets see in the example:

Code: int main(void)
{
int fd; // the socket

[code]....

View 9 Replies View Related

Programming :: Wrapping Around Functions With Different Return Types?

Feb 1, 2010

I have functions which return different data like: int, char*, double...

I also have a list of datatypes (INTEGER, TEXT, REAL...) which can be returned.

I need to map a datatype with function, which purpose is to return it. Therefore, when I determine a datatype, I would like to call the required function without doing switch all the time.

My idea is to have an array of structs like this:

Code:
struct type_func_map
{
int type;
void (*func_wrapper_int)(void); //void (*func_wrapper_text)(void); void (*func_wrapper_real)(void);
};

[Code].....

View 10 Replies View Related

Programming :: C++ - Calling Functions From Other Files And Headers?

Apr 11, 2011

I feel like there should be a cleaner way of doing this. I have one file, for example "a.cpp", calling a function from another file, "b.cpp". Currently I have it set up so that header for "b", "b.h", has the declaration of its functions. And then I'm just including "b.h" in "a.cpp". Do I have to include the "b" header file in "a" to be able to call a function from "b"? Or is there a better way I could be doing this? Like doing something different at compile?

View 7 Replies View Related

Programming :: C File Functions Crash Unless Root

Jun 24, 2011

I've encountered a problem when running a simple bit of code, I'm using c to read write data to a binary file. It works fine when I run as root. However when I run as a user it produces the file, however when I try to open / write after it's produced it caused a seg fault. Is there any reason file functions ( fopen etc ) would work for root and not a user and is there a way to fix this?

View 14 Replies View Related

Programming :: Calling Kernel Functions From Userspace?

Feb 5, 2010

I'm trying to call some kernel functions from userspace, but I'm not sure if I'm doing it right. The functions control a pulse width modulator on an embedded platform. To pick one at random, the function:

Code:
struct pwm_device *pwm_request(int pwm_id, const char *label);
is defined in linux/pwm.h, and the implementation uses the macro EXPORT_SYMBOL(pwm_request), so I should be able to call this from user-space... right?

Anyway, I've got linux/pwm.h to #include in my source so the compiler knows what it's doing, but what do I link against? The only place in by kernel build tree where I can see a symbol pwm_request defined is in object files like vmlinux.o, built-in.o in the directory, etc. which I don't think I should be linking against.

View 2 Replies View Related

Programming :: How To Find Man Page Of Kernel Functions

Aug 2, 2010

My distribution is Fedora 12. When I want to get the infos of kernel functions such as printk, i type man printk, failed. I look up some articles and learn that in some distributions the kernel functions is in section 9 of man page. Then i type man 9 printk also no reply. How can i get man pages of kernel functions ?

View 2 Replies View Related

Programming :: How Many Of PHP Functions And Operators Remembered To Code

Jun 7, 2011

So if you are a PHP-programmer (average one) and code for money, how many of funtions and operators of PHP should you remember by heart (in real life)? I was looking through php.net and man there are millions of tons of them!

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved